From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 00:00:37 2011 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 4CF5F106568D; Sun, 19 Jun 2011 00:00: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 1B1E58FC26; Sun, 19 Jun 2011 00:00: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 p5J00a26069441; Sun, 19 Jun 2011 00:00:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J00af3069440; Sun, 19 Jun 2011 00:00:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106190000.p5J00af3069440@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 00:00: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: r223283 - head/tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 00:00:37 -0000 Author: jilles Date: Sun Jun 19 00:00:36 2011 New Revision: 223283 URL: http://svn.freebsd.org/changeset/base/223283 Log: sh: Add test for r223282. Added: head/tools/regression/bin/sh/execution/bg4.0 (contents, props changed) Added: head/tools/regression/bin/sh/execution/bg4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/bg4.0 Sun Jun 19 00:00:36 2011 (r223283) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +x='' +: ${x:=1} & +wait +exit ${x:-0} From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 00:07:11 2011 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 BB750106564A; Sun, 19 Jun 2011 00:07:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3D08F8FC1F; Sun, 19 Jun 2011 00:07:10 +0000 (UTC) Received: by gwb15 with SMTP id 15so368911gwb.13 for ; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=hTDFOFtk0ICIo1WmJD2ne/uwztrU/nRVGPvqXeCLUU4=; b=q0gjOT3tnG1p+aSvYyO3zsnamL1YsTonpR2H4/LLgn9cQAWV1B9W1rQPfoESYW+4OY cRvHC80020qFM9tvgCcf+nM7anHirNmU1ELG5a8jY8fREbwWwTEXfU6oisYslhRC4iTS 8zIBmLMUvGqf3lcJhvqNT7FxaoIm93Yda16ME= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ilrgZtSTD3h/7T2hQ2fJzdHPykB+jtK2BGi8W56zXGyIViX5dD3+oxgqBpeu7gtrMN LVROOTlo5IoNJnHYv/wShCOeBrcaObXGrTWcCsUasIurDfe+zXH5wdsoVWzMuXYiaDfI EYoE029jvrIm2X518NUEEIadnz8vZjAdqA3Gw= MIME-Version: 1.0 Received: by 10.150.132.15 with SMTP id f15mr3973092ybd.388.1308442030440; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.58.10 with HTTP; Sat, 18 Jun 2011 17:07:10 -0700 (PDT) In-Reply-To: <4DFD0BBA.1010502@freebsd.org> References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> <4DFD0BBA.1010502@freebsd.org> Date: Sun, 19 Jun 2011 08:07:10 +0800 X-Google-Sender-Auth: bO5ztR9FUGPb7uRZ5hBg3MPfxcQ Message-ID: From: Adrian Chadd To: Nathan Whitehorn Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy Subject: Re: svn commit: r223129 - 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: Sun, 19 Jun 2011 00:07:11 -0000 On 19 June 2011 04:34, Nathan Whitehorn wrote: > Since all of our install CDs for 9.0 (even the boot-only ones!) will be live > CDs, the full versions of everything in /rescue are on the CD in their usual > locations in /bin, /sbin, etc. and these can be used just as well for fixing > a system as the /rescue tools. > -Nathan Question - is sysinstall still installed on those? If so (it was installed on the USB -current image I used to install from a month or so ago) it confused me as I ran sysinstall fine but I couldn't install anything using it. Thanks, Adrian From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 01:44:51 2011 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 5165A106567C; Sun, 19 Jun 2011 01:44:51 +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 4016E8FC1C; Sun, 19 Jun 2011 01:44: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 p5J1ip23072484; Sun, 19 Jun 2011 01:44:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J1ipaq072482; Sun, 19 Jun 2011 01:44:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106190144.p5J1ipaq072482@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 01:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223284 - stable/8/sys/fs/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: Sun, 19 Jun 2011 01:44:51 -0000 Author: rmacklem Date: Sun Jun 19 01:44:50 2011 New Revision: 223284 URL: http://svn.freebsd.org/changeset/base/223284 Log: MFC: r222663 Modify the new NFS server so that the NFSv3 Pathconf RPC doesn't return an error when the underlying file system lacks support for any of the four _PC_xxx values used, by falling back to default values. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 19 00:00:36 2011 (r223283) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jun 19 01:44:50 2011 (r223284) @@ -2589,6 +2589,36 @@ nfsvno_pathconf(struct vnode *vp, int fl int error; error = VOP_PATHCONF(vp, flag, retf); + if (error == EOPNOTSUPP || error == EINVAL) { + /* + * Some file systems return EINVAL for name arguments not + * supported and some return EOPNOTSUPP for this case. + * So the NFSv3 Pathconf RPC doesn't fail for these cases, + * just fake them. + */ + switch (flag) { + case _PC_LINK_MAX: + *retf = LINK_MAX; + break; + case _PC_NAME_MAX: + *retf = NAME_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *retf = 1; + break; + case _PC_NO_TRUNC: + *retf = 1; + break; + default: + /* + * Only happens if a _PC_xxx is added to the server, + * but this isn't updated. + */ + *retf = 0; + printf("nfsrvd pathconf flag=%d not supp\n", flag); + }; + error = 0; + } return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 02:03:13 2011 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 574DB106564A; Sun, 19 Jun 2011 02:03:13 +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 45BB18FC12; Sun, 19 Jun 2011 02:03: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 p5J23DgZ073087; Sun, 19 Jun 2011 02:03:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J23Drw073085; Sun, 19 Jun 2011 02:03:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106190203.p5J23Drw073085@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 02:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223285 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 02:03:13 -0000 Author: rmacklem Date: Sun Jun 19 02:03:12 2011 New Revision: 223285 URL: http://svn.freebsd.org/changeset/base/223285 Log: MFC: r222718 Fix the new NFSv4 client so that it doesn't crash when a mount is done for a VIMAGE kernel. Modified: stable/8/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 01:44:50 2011 (r223284) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 02:03:12 2011 (r223285) @@ -943,6 +943,7 @@ nfscl_getmyip(struct nfsmount *nmp, int sad.sin_family = AF_INET; sad.sin_len = sizeof (struct sockaddr_in); sad.sin_addr.s_addr = sin->sin_addr.s_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -956,6 +957,7 @@ nfscl_getmyip(struct nfsmount *nmp, int } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #ifdef INET6 } else if (nmp->nm_nam->sa_family == AF_INET6) { struct sockaddr_in6 sad6, *sin6; @@ -966,6 +968,7 @@ nfscl_getmyip(struct nfsmount *nmp, int sad6.sin6_family = AF_INET6; sad6.sin6_len = sizeof (struct sockaddr_in6); sad6.sin6_addr = sin6->sin6_addr; + CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); if (rt != NULL) { if (rt->rt_ifp != NULL && @@ -980,6 +983,7 @@ nfscl_getmyip(struct nfsmount *nmp, int } RTFREE_LOCKED(rt); } + CURVNET_RESTORE(); #endif } return (retp); From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 02:24:37 2011 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 3CCEC106566B; Sun, 19 Jun 2011 02:24:37 +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 295DD8FC0A; Sun, 19 Jun 2011 02:24: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 p5J2ObAb073743; Sun, 19 Jun 2011 02:24:37 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J2ObLe073736; Sun, 19 Jun 2011 02:24:37 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106190224.p5J2ObLe073736@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 02:24: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: r223286 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 02:24:37 -0000 Author: rmacklem Date: Sun Jun 19 02:24:36 2011 New Revision: 223286 URL: http://svn.freebsd.org/changeset/base/223286 Log: MFC: r222719 The new NFSv4 client was erroneously using "p" instead of "p_leader" for the "id" for POSIX byte range locking. I think this would only have affected processes created by rfork(2) with the RFTHREAD flag specified. This patch fixes that by passing the "id" down through the various functions from nfs_advlock(). Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clrpcops.c stable/8/sys/fs/nfsclient/nfs_clstate.c stable/8/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Sun Jun 19 02:03:12 2011 (r223285) +++ stable/8/sys/fs/nfs/nfs_var.h Sun Jun 19 02:24:36 2011 (r223286) @@ -401,10 +401,10 @@ int nfsrpc_readdirplus(vnode_t, struct u int nfsrpc_commit(vnode_t, u_quad_t, int, struct ucred *, NFSPROC_T *, u_char *, struct nfsvattr *, int *, void *); int nfsrpc_advlock(vnode_t, off_t, int, struct flock *, int, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); int nfsrpc_lockt(struct nfsrv_descript *, vnode_t, struct nfsclclient *, u_int64_t, u_int64_t, struct flock *, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); int nfsrpc_lock(struct nfsrv_descript *, struct nfsmount *, vnode_t, u_int8_t *, int, struct nfscllockowner *, int, int, u_int64_t, u_int64_t, short, struct ucred *, NFSPROC_T *, int); @@ -439,16 +439,16 @@ struct nfsclclient *nfscl_findcl(struct void nfscl_clientrelease(struct nfsclclient *); void nfscl_freelock(struct nfscllock *, int); int nfscl_getbytelock(vnode_t, u_int64_t, u_int64_t, short, - struct ucred *, NFSPROC_T *, struct nfsclclient *, int, u_int8_t *, - u_int8_t *, struct nfscllockowner **, int *, int *); + struct ucred *, NFSPROC_T *, struct nfsclclient *, int, void *, int, + u_int8_t *, u_int8_t *, struct nfscllockowner **, int *, int *); int nfscl_relbytelock(vnode_t, u_int64_t, u_int64_t, struct ucred *, NFSPROC_T *, int, struct nfsclclient *, - struct nfscllockowner **, int *); + void *, int, struct nfscllockowner **, int *); int nfscl_checkwritelocked(vnode_t, struct flock *, - struct ucred *, NFSPROC_T *); + struct ucred *, NFSPROC_T *, void *, int); void nfscl_lockrelease(struct nfscllockowner *, int, int); void nfscl_fillclid(u_int64_t, char *, u_int8_t *, u_int16_t); -void nfscl_filllockowner(NFSPROC_T *, u_int8_t *); +void nfscl_filllockowner(void *, u_int8_t *, int); void nfscl_freeopen(struct nfsclopen *, int); void nfscl_umount(struct nfsmount *, NFSPROC_T *); void nfscl_renewthread(struct nfsclclient *, NFSPROC_T *); @@ -466,9 +466,10 @@ void nfscl_lockexcl(struct nfsv4lock *, void nfscl_lockunlock(struct nfsv4lock *); void nfscl_lockderef(struct nfsv4lock *); void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *); -void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *); +void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *, + int); int nfscl_lockt(vnode_t, struct nfsclclient *, u_int64_t, - u_int64_t, struct flock *, NFSPROC_T *); + u_int64_t, struct flock *, NFSPROC_T *, void *, int); int nfscl_mustflush(vnode_t); int nfscl_nodeleg(vnode_t, int); int nfscl_removedeleg(vnode_t, NFSPROC_T *, nfsv4stateid_t *); Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 02:03:12 2011 (r223285) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 02:24:36 2011 (r223286) @@ -500,7 +500,7 @@ nfscl_fillclid(u_int64_t clval, char *uu * Fill in a lock owner name. For now, pid + the process's creation time. */ void -nfscl_filllockowner(struct thread *td, u_int8_t *cp) +nfscl_filllockowner(void *id, u_int8_t *cp, int flags) { union { u_int32_t lval; @@ -508,37 +508,32 @@ nfscl_filllockowner(struct thread *td, u } tl; struct proc *p; -if (td == NULL) { - printf("NULL td\n"); - bzero(cp, 12); - return; -} - p = td->td_proc; -if (p == NULL) { - printf("NULL pid\n"); - bzero(cp, 12); - return; -} - tl.lval = p->p_pid; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp++ = tl.cval[3]; -if (p->p_stats == NULL) { - printf("pstats null\n"); - bzero(cp, 8); - return; -} - tl.lval = p->p_stats->p_start.tv_sec; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp++ = tl.cval[3]; - tl.lval = p->p_stats->p_start.tv_usec; - *cp++ = tl.cval[0]; - *cp++ = tl.cval[1]; - *cp++ = tl.cval[2]; - *cp = tl.cval[3]; + if (id == NULL) { + printf("NULL id\n"); + bzero(cp, NFSV4CL_LOCKNAMELEN); + return; + } + if ((flags & F_POSIX) != 0) { + p = (struct proc *)id; + tl.lval = p->p_pid; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp++ = tl.cval[3]; + tl.lval = p->p_stats->p_start.tv_sec; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp++ = tl.cval[3]; + tl.lval = p->p_stats->p_start.tv_usec; + *cp++ = tl.cval[0]; + *cp++ = tl.cval[1]; + *cp++ = tl.cval[2]; + *cp = tl.cval[3]; + } else { + printf("nfscl_filllockowner: not F_POSIX\n"); + bzero(cp, NFSV4CL_LOCKNAMELEN); + } } /* Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 19 02:03:12 2011 (r223285) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 19 02:24:36 2011 (r223286) @@ -3459,7 +3459,7 @@ nfsmout: */ APPLESTATIC int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, - int reclaim, struct ucred *cred, NFSPROC_T *p) + int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { struct nfscllockowner *lp; struct nfsclclient *clp; @@ -3511,11 +3511,11 @@ nfsrpc_advlock(vnode_t vp, off_t size, i error = nfscl_getcl(vp, cred, p, &clp); if (error) return (error); - error = nfscl_lockt(vp, clp, off, len, fl, p); + error = nfscl_lockt(vp, clp, off, len, fl, p, id, flags); if (!error) { clidrev = clp->nfsc_clientidrev; error = nfsrpc_lockt(nd, vp, clp, off, len, fl, cred, - p); + p, id, flags); } else if (error == -1) { error = 0; } @@ -3530,7 +3530,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i return (error); do { error = nfscl_relbytelock(vp, off, len, cred, p, callcnt, - clp, &lp, &dorpc); + clp, id, flags, &lp, &dorpc); /* * If it returns a NULL lp, we're done. */ @@ -3538,7 +3538,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i if (callcnt == 0) nfscl_clientrelease(clp); else - nfscl_releasealllocks(clp, vp, p); + nfscl_releasealllocks(clp, vp, p, id, flags); return (error); } if (nmp->nm_clp != NULL) @@ -3572,10 +3572,10 @@ nfsrpc_advlock(vnode_t vp, off_t size, i } callcnt++; } while (error == 0 && nd->nd_repstat == 0); - nfscl_releasealllocks(clp, vp, p); + nfscl_releasealllocks(clp, vp, p, id, flags); } else if (op == F_SETLK) { error = nfscl_getbytelock(vp, off, len, fl->l_type, cred, p, - NULL, 0, NULL, NULL, &lp, &newone, &donelocally); + NULL, 0, id, flags, NULL, NULL, &lp, &newone, &donelocally); if (error || donelocally) { return (error); } @@ -3625,7 +3625,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, i APPLESTATIC int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, - struct ucred *cred, NFSPROC_T *p) + struct ucred *cred, NFSPROC_T *p, void *id, int flags) { u_int32_t *tl; int error, type, size; @@ -3643,7 +3643,7 @@ nfsrpc_lockt(struct nfsrv_descript *nd, tl += 2; *tl++ = clp->nfsc_clientid.lval[0]; *tl = clp->nfsc_clientid.lval[1]; - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); (void) nfsm_strtom(nd, own, NFSV4CL_LOCKNAMELEN); error = nfscl_request(nd, vp, p, cred, NULL); if (error) Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clstate.c Sun Jun 19 02:03:12 2011 (r223285) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Sun Jun 19 02:24:36 2011 (r223286) @@ -226,7 +226,7 @@ nfscl_open(vnode_t vp, u_int8_t *nfhp, i * If none found, add the new one or return error, depending upon * "create". */ - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); NFSLOCKCLSTATE(); dp = NULL; /* First check the delegation list */ @@ -521,7 +521,7 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n * If p != NULL, we want to search the parentage tree * for a matching OpenOwner and use that. */ - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); error = nfscl_getopen(&clp->nfsc_owner, nfhp, fhlen, NULL, p, mode, NULL, &op); if (error == 0) { @@ -596,7 +596,7 @@ nfscl_getopen(struct nfsclownerhead *ohp op = NULL; while (op == NULL && (nproc != NULL || rown != NULL)) { if (nproc != NULL) { - nfscl_filllockowner(nproc, own); + nfscl_filllockowner(nproc->td_proc, own, F_POSIX); ownp = own; } else { ownp = rown; @@ -881,7 +881,7 @@ nfscl_clientrelease(struct nfsclclient * APPLESTATIC int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, - int recovery, u_int8_t *rownp, u_int8_t *ropenownp, + int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, struct nfscllockowner **lpp, int *newonep, int *donelocallyp) { struct nfscllockowner *lp; @@ -942,7 +942,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t if (recovery) { ownp = rownp; } else { - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); ownp = own; } if (!recovery) { @@ -1079,7 +1079,8 @@ nfscl_getbytelock(vnode_t vp, u_int64_t APPLESTATIC int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, - struct nfsclclient *clp, struct nfscllockowner **lpp, int *dorpcp) + struct nfsclclient *clp, void *id, int flags, + struct nfscllockowner **lpp, int *dorpcp) { struct nfscllockowner *lp; struct nfsclowner *owp; @@ -1116,7 +1117,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t sizeof (struct nfscllock), M_NFSCLLOCK, M_WAITOK); *other_lop = *nlop; } - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); dp = NULL; NFSLOCKCLSTATE(); if (callcnt == 0) @@ -1188,7 +1189,8 @@ nfscl_relbytelock(vnode_t vp, u_int64_t * Release all lockowners marked in progess for this process and file. */ APPLESTATIC void -nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p) +nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, + void *id, int flags) { struct nfsclowner *owp; struct nfsclopen *op; @@ -1197,7 +1199,7 @@ nfscl_releasealllocks(struct nfsclclient u_int8_t own[NFSV4CL_LOCKNAMELEN]; np = VTONFS(vp); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { @@ -1226,7 +1228,7 @@ nfscl_releasealllocks(struct nfsclclient */ APPLESTATIC int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, - struct ucred *cred, NFSPROC_T *p) + struct ucred *cred, NFSPROC_T *p, void *id, int flags) { struct nfsclowner *owp; struct nfscllockowner *lp; @@ -1266,7 +1268,7 @@ nfscl_checkwritelocked(vnode_t vp, struc error = nfscl_getcl(vp, cred, p, &clp); if (error) return (1); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); /* @@ -1641,7 +1643,7 @@ nfscl_cleanup(NFSPROC_T *p) if (!nfscl_inited) return; - nfscl_filllockowner(p, own); + nfscl_filllockowner(p->td_proc, own, F_POSIX); NFSLOCKCLSTATE(); /* @@ -3322,7 +3324,7 @@ nfscl_checkconflict(struct nfscllockowne */ APPLESTATIC int nfscl_lockt(vnode_t vp, struct nfsclclient *clp, u_int64_t off, - u_int64_t len, struct flock *fl, NFSPROC_T *p) + u_int64_t len, struct flock *fl, NFSPROC_T *p, void *id, int flags) { struct nfscllock *lop, nlck; struct nfscldeleg *dp; @@ -3340,7 +3342,7 @@ nfscl_lockt(vnode_t vp, struct nfsclclie return (NFSERR_INVAL); } np = VTONFS(vp); - nfscl_filllockowner(p, own); + nfscl_filllockowner(id, own, flags); NFSLOCKCLSTATE(); dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); error = nfscl_localconflict(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, @@ -3615,7 +3617,7 @@ nfscl_relock(vnode_t vp, struct nfsclcli off = lop->nfslo_first; len = lop->nfslo_end - lop->nfslo_first; error = nfscl_getbytelock(vp, off, len, lop->nfslo_type, cred, p, - clp, 1, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone, + clp, 1, NULL, 0, lp->nfsl_owner, lp->nfsl_openowner, &nlp, &newone, &donelocally); if (error || donelocally) return (error); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 02:03:12 2011 (r223285) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 02:24:36 2011 (r223286) @@ -2888,7 +2888,8 @@ nfs_advlock(struct vop_advlock_args *ap) * RFC3530 Sec. 9.3.2. */ if (ap->a_op == F_UNLCK && - nfscl_checkwritelocked(vp, ap->a_fl, cred, td)) + nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id, + ap->a_flags)) (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0); /* @@ -2897,7 +2898,7 @@ nfs_advlock(struct vop_advlock_args *ap) */ do { ret = nfsrpc_advlock(vp, np->n_size, ap->a_op, - ap->a_fl, 0, cred, td); + ap->a_fl, 0, cred, td, ap->a_id, ap->a_flags); if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) && ap->a_op == F_SETLK) { VOP_UNLOCK(vp, 0); From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 02:39:03 2011 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 78672106566C; Sun, 19 Jun 2011 02:39:03 +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 4DBA58FC08; Sun, 19 Jun 2011 02:39: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 p5J2d3ic074186; Sun, 19 Jun 2011 02:39:03 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J2d3kY074183; Sun, 19 Jun 2011 02:39:03 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106190239.p5J2d3kY074183@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 02:39:03 +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: r223287 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 02:39:03 -0000 Author: rmacklem Date: Sun Jun 19 02:39:02 2011 New Revision: 223287 URL: http://svn.freebsd.org/changeset/base/223287 Log: MFC: r222722 Add support for flock(2) locks to the new NFSv4 client. I think this should be ok, since the client now delays NFSv4 Close operations until VOP_INACTIVE()/VOP_RECLAIM(). As such, there should be no risk that the NFSv4 Open is closed while an associated byte range lock still exists. Modified: stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 02:24:36 2011 (r223286) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jun 19 02:39:02 2011 (r223287) @@ -530,8 +530,11 @@ nfscl_filllockowner(void *id, u_int8_t * *cp++ = tl.cval[1]; *cp++ = tl.cval[2]; *cp = tl.cval[3]; + } else if ((flags & F_FLOCK) != 0) { + bcopy(&id, cp, sizeof(id)); + bzero(&cp[sizeof(id)], NFSV4CL_LOCKNAMELEN - sizeof(id)); } else { - printf("nfscl_filllockowner: not F_POSIX\n"); + printf("nfscl_filllockowner: not F_POSIX or F_FLOCK\n"); bzero(cp, NFSV4CL_LOCKNAMELEN); } } Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 02:24:36 2011 (r223286) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 02:39:02 2011 (r223287) @@ -2874,8 +2874,11 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; - if (NFS_ISV4(vp) && (ap->a_flags & F_POSIX)) { - cred = p->p_ucred; + if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { + if ((ap->a_flags & F_POSIX) != 0) + cred = p->p_ucred; + else + cred = td->td_ucred; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 02:47:10 2011 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 27978106566B; Sun, 19 Jun 2011 02:47:10 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id A09F28FC14; Sun, 19 Jun 2011 02:47:09 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id p5J2l5jS018653; Sun, 19 Jun 2011 11:47:07 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 19 Jun 2011 11:47:04 +0900 (JST) Message-Id: <20110619.114704.59640143160110864.nyan@FreeBSD.org> To: benl@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 02:47:10 -0000 In article <201106181356.p5IDuXhW044171@svn.freebsd.org> Ben Laurie writes: > Author: benl > Date: Sat Jun 18 13:56:33 2011 > New Revision: 223262 > URL: http://svn.freebsd.org/changeset/base/223262 > > Log: > Fix clang warnings. > > Modified: head/sys/sys/diskpc98.h > ============================================================================== > --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) > +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) > @@ -36,8 +36,11 @@ > #include > > #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ > +#undef DOSPARTOFF > #define DOSPARTOFF 0 > +#undef DOSPARTSIZE > #define DOSPARTSIZE 32 > +#undef NDOSPART > #define NDOSPART 16 > #define DOSMAGICOFFSET 510 > #define DOSMAGIC 0xAA55 > @@ -52,6 +55,7 @@ > > #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) > #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) > +#undef DOSPTYP_386BSD > #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) > > struct pc98_partition { > I wonder why this is needed, and why only for diskpc98.h, not diskmbr.h. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 08:34:11 2011 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 6FD9B106564A; Sun, 19 Jun 2011 08:34: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 5F7378FC0C; Sun, 19 Jun 2011 08:34: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 p5J8YBvO084691; Sun, 19 Jun 2011 08:34:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J8YBNo084688; Sun, 19 Jun 2011 08:34:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106190834.p5J8YBNo084688@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 19 Jun 2011 08:34: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: r223288 - in 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: Sun, 19 Jun 2011 08:34:11 -0000 Author: hselasky Date: Sun Jun 19 08:34:10 2011 New Revision: 223288 URL: http://svn.freebsd.org/changeset/base/223288 Log: Add new USB ID to UDAV driver. Submitted by: Luiz Gustavo S. Costa MFC after: 7 days Modified: head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Sun Jun 19 02:39:02 2011 (r223287) +++ head/sys/dev/usb/net/if_udav.c Sun Jun 19 08:34:10 2011 (r223288) @@ -210,6 +210,7 @@ static const struct usb_device_id udav_d {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, }; static void Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jun 19 02:39:02 2011 (r223287) +++ head/sys/dev/usb/usbdevs Sun Jun 19 08:34:10 2011 (r223288) @@ -2014,6 +2014,7 @@ product KODAK DC280 0x0130 Digital Scie /* Kontron AG products */ product KONTRON DM9601 0x8101 USB Ethernet +product KONTRON JP1082 0x9700 USB Ethernet /* Konica Corp. Products */ product KONICA CAMERA 0x0720 Digital Color Camera From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 08:35:54 2011 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 6770E10656B7; Sun, 19 Jun 2011 08:35:54 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 941568FC17; Sun, 19 Jun 2011 08:35:53 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=3OyxrDLVq9sri6DuQhVzJBEiMCfYdL5zDZJFh5fE9Ak= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=V4P58aWE2P4A:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=56DwDi9HZ6sdPNhyP0QA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 142098522; Sun, 19 Jun 2011 10:35:51 +0200 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Sun, 19 Jun 2011 10:34:22 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201106190834.p5J8YBNo084688@svn.freebsd.org> In-Reply-To: <201106190834.p5J8YBNo084688@svn.freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201106191034.22488.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r223288 - in 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: Sun, 19 Jun 2011 08:35:54 -0000 On Sunday 19 June 2011 10:34:11 Hans Petter Selasky wrote: > Author: hselasky > Date: Sun Jun 19 08:34:10 2011 > New Revision: 223288 > URL: http://svn.freebsd.org/changeset/base/223288 > > Log: > Add new USB ID to UDAV driver. > Hope this commit was not too late for the code slush. --HPS From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 08:38:52 2011 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 3203A1065677; Sun, 19 Jun 2011 08:38:52 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from emx.nitro.dk (emx.nitro.dk [IPv6:2a01:4f8:120:7384::102]) by mx1.freebsd.org (Postfix) with ESMTP id BA2818FC1D; Sun, 19 Jun 2011 08:38:51 +0000 (UTC) Received: from mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) by emx.nitro.dk (Postfix) with ESMTP id E5180913F4; Sun, 19 Jun 2011 08:38:50 +0000 (UTC) Received: from emx.nitro.dk ([127.0.1.2]) by mailscan.leto.nitro.dk (mailscan.leto.nitro.dk [127.0.1.4]) (amavisd-new, port 10024) with LMTP id QOQOz2agq0m9; Sun, 19 Jun 2011 08:38:46 +0000 (UTC) Received: from [192.168.4.32] (unknown [90.184.171.166]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by emx.nitro.dk (Postfix) with ESMTPSA id 7D831913EC; Sun, 19 Jun 2011 08:38:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Simon L. B. Nielsen" In-Reply-To: <20110618204836.GA46582@stack.nl> Date: Sun, 19 Jun 2011 10:38:44 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618204836.GA46582@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1084) Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Philip Paeps Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 08:38:52 -0000 On 18 Jun 2011, at 22:48, Jilles Tjoelker wrote: > On Sat, Jun 18, 2011 at 01:56:33PM +0000, Ben Laurie wrote: >> Modified: = head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/lib/libdtrace/common/dt_subr.c = Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c = Sat Jun 18 13:56:33 2011 (r223262) >> @@ -45,6 +45,7 @@ >> #include >> #include >> #include >> +#include >>=20 >> #include >>=20 >> @@ -811,15 +812,14 @@ dt_basename(char *str) >> ulong_t >> dt_popc(ulong_t x) >> { >> -#ifdef _ILP32 >> +#if defined(_ILP32) >> x =3D x - ((x >> 1) & 0x55555555UL); >> x =3D (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); >> x =3D (x + (x >> 4)) & 0x0F0F0F0FUL; >> x =3D x + (x >> 8); >> x =3D x + (x >> 16); >> return (x & 0x3F); >> -#endif >> -#ifdef _LP64 >> +#elif defined(_LP64) >> x =3D x - ((x >> 1) & 0x5555555555555555ULL); >> x =3D (x & 0x3333333333333333ULL) + ((x >> 2) & = 0x3333333333333333ULL); >> x =3D (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; >> @@ -827,6 +827,8 @@ dt_popc(ulong_t x) >> x =3D x + (x >> 16); >> x =3D x + (x >> 32); >> return (x & 0x7F); >> +#else >> +# warning need td_popc() implementation >> #endif >> } >=20 > This commit uncovers breakage that had been present for a while. If I > compile this on stable/8 i386 for head i386, _ILP32 is not defined and > the warning is hit, breaking the build. Apparently, the code had been > broken for a while but I do not use dtrace so I would not have = noticed. > The tinderboxes have now also noticed the problem so it is not = something > weird about my system. What would be the correct (at least temporary) fix? Replace the _ILP32 = / _LP64 checks with specific architecture checks ? I can see that on i386 _ILP32 isn't actually defined - but on amd64 = _LP64 is... and it still breaks. [simon@zaphod:~] ssh ref9-i386.freebsd.org 'cpp -dM < /dev/null | grep = LP' [simon@zaphod:~] ssh ref9-amd64.freebsd.org 'cpp -dM < /dev/null | grep = LP' #define __LP64__ 1 #define _LP64 1 [simon@zaphod:~] ssh ref8-amd64.freebsd.org 'cpp -dM < /dev/null | grep = LP' #define __LP64__ 1 #define _LP64 1 I must be missing something... --=20 Simon L. B. Nielsen From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 08:51:56 2011 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 8867D106568D; Sun, 19 Jun 2011 08:51:56 +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 1E4758FC13; Sun, 19 Jun 2011 08:51:55 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p5J8pqvb070168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jun 2011 11:51:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p5J8ppvM093412; Sun, 19 Jun 2011 11:51:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5J8ppEk093411; Sun, 19 Jun 2011 11:51:51 +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: Sun, 19 Jun 2011 11:51:51 +0300 From: Kostik Belousov To: "Simon L. B. Nielsen" Message-ID: <20110619085151.GB48734@deviant.kiev.zoral.com.ua> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618204836.GA46582@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zk+PeIDuky64cHni" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, Jilles Tjoelker , Ben Laurie , svn-src-all@freebsd.org, Philip Paeps , svn-src-head@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 08:51:56 -0000 --Zk+PeIDuky64cHni Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2011 at 10:38:44AM +0200, Simon L. B. Nielsen wrote: >=20 > On 18 Jun 2011, at 22:48, Jilles Tjoelker wrote: >=20 > > On Sat, Jun 18, 2011 at 01:56:33PM +0000, Ben Laurie wrote: > >> Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/lib/libdtrace/common/dt_subr.c Sat J= un 18 13:54:36 2011 (r223261) > >> +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat J= un 18 13:56:33 2011 (r223262) > >> @@ -45,6 +45,7 @@ > >> #include > >> #include > >> #include > >> +#include > >>=20 > >> #include > >>=20 > >> @@ -811,15 +812,14 @@ dt_basename(char *str) > >> ulong_t > >> dt_popc(ulong_t x) > >> { > >> -#ifdef _ILP32 > >> +#if defined(_ILP32) > >> x =3D x - ((x >> 1) & 0x55555555UL); > >> x =3D (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); > >> x =3D (x + (x >> 4)) & 0x0F0F0F0FUL; > >> x =3D x + (x >> 8); > >> x =3D x + (x >> 16); > >> return (x & 0x3F); > >> -#endif > >> -#ifdef _LP64 > >> +#elif defined(_LP64) > >> x =3D x - ((x >> 1) & 0x5555555555555555ULL); > >> x =3D (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL= ); > >> x =3D (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; > >> @@ -827,6 +827,8 @@ dt_popc(ulong_t x) > >> x =3D x + (x >> 16); > >> x =3D x + (x >> 32); > >> return (x & 0x7F); > >> +#else > >> +# warning need td_popc() implementation > >> #endif > >> } > >=20 > > This commit uncovers breakage that had been present for a while. If I > > compile this on stable/8 i386 for head i386, _ILP32 is not defined and > > the warning is hit, breaking the build. Apparently, the code had been > > broken for a while but I do not use dtrace so I would not have noticed. > > The tinderboxes have now also noticed the problem so it is not something > > weird about my system. >=20 > What would be the correct (at least temporary) fix? Replace the _ILP32 /= _LP64 checks with specific architecture checks ? >=20 > I can see that on i386 _ILP32 isn't actually defined - but on amd64 _LP6= 4 is... and it still breaks. >=20 > [simon@zaphod:~] ssh ref9-i386.freebsd.org 'cpp -dM < /dev/null | grep LP' > [simon@zaphod:~] ssh ref9-amd64.freebsd.org 'cpp -dM < /dev/null | grep L= P' > #define __LP64__ 1 > #define _LP64 1 > [simon@zaphod:~] ssh ref8-amd64.freebsd.org 'cpp -dM < /dev/null | grep L= P' > #define __LP64__ 1 > #define _LP64 1 >=20 > I must be missing something... It breaks on amd64 while building compat32 libraries. The build step uses i386-targeted compiler, which lacks the ILP32 definition. --Zk+PeIDuky64cHni Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk39uKcACgkQC3+MBN1Mb4j15ACgpgwXIiikRlK4oV9StwH/VS5w sCMAnRchEvb5XvEW9URHPCMBebXl+3Ch =ucLP -----END PGP SIGNATURE----- --Zk+PeIDuky64cHni-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 08:53:16 2011 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 B2BBB106564A; Sun, 19 Jun 2011 08:53:16 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A290D8FC0C; Sun, 19 Jun 2011 08:53: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 p5J8rGsh085254; Sun, 19 Jun 2011 08:53:16 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5J8rGm4085251; Sun, 19 Jun 2011 08:53:16 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201106190853.p5J8rGm4085251@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 19 Jun 2011 08:53: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: r223289 - head/contrib/dialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 08:53:16 -0000 Author: jh Date: Sun Jun 19 08:53:16 2011 New Revision: 223289 URL: http://svn.freebsd.org/changeset/base/223289 Log: Don't #undef curses ERR in dialog.h. Otherwise, the macro will be unavailable if curses.h is included before dialog.h. PR: bin/156601 Obtained from: Thomas E. Dickey (upstream maintainer) Discussed with: nwhitehorn Modified: head/contrib/dialog/dialog.h Modified: head/contrib/dialog/dialog.h ============================================================================== --- head/contrib/dialog/dialog.h Sun Jun 19 08:34:10 2011 (r223288) +++ head/contrib/dialog/dialog.h Sun Jun 19 08:53:16 2011 (r223289) @@ -1,5 +1,5 @@ /* - * $Id: dialog.h,v 1.223 2011/03/02 10:04:09 tom Exp $ + * $Id: dialog.h,v 1.224 2011/06/13 14:29:42 tom Exp $ * * dialog.h -- common declarations for all dialog modules * @@ -44,7 +44,10 @@ #include /* fork() etc. */ #include /* sqrt() */ -#undef ERR /* header conflict with Solaris xpg4 */ +/* header conflict with Solaris xpg4 versus */ +#if defined(ERR) && (ERR == 13) +#undef ERR +#endif #if defined(HAVE_NCURSESW_NCURSES_H) #include From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 11:01:39 2011 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 513AA106566B; Sun, 19 Jun 2011 11:01:39 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 268AE8FC15; Sun, 19 Jun 2011 11:01: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 p5JB1d7m090896; Sun, 19 Jun 2011 11:01:39 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JB1ddI090893; Sun, 19 Jun 2011 11:01:39 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106191101.p5JB1ddI090893@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 19 Jun 2011 11:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223290 - 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, 19 Jun 2011 11:01:39 -0000 Author: bcr (doc committer) Date: Sun Jun 19 11:01:38 2011 New Revision: 223290 URL: http://svn.freebsd.org/changeset/base/223290 Log: MFC r223160: Fix some wording and grammar in the BUGS section. PR: docs/157901 Submitted by: Niclas Zeising (niclas dot zeising at gmail dot com) Reviewed by: mav Modified: stable/8/share/man/man4/snd_hda.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/snd_hda.4 ============================================================================== --- stable/8/share/man/man4/snd_hda.4 Sun Jun 19 08:53:16 2011 (r223289) +++ stable/8/share/man/man4/snd_hda.4 Sun Jun 19 11:01:38 2011 (r223290) @@ -669,16 +669,20 @@ and A few Hardware/OEM vendors tend to screw up BIOS settings, thus rendering the .Nm -driver useless, which usually results in a state where the +driver useless. +This usually results in a state where the .Nm -driver seems to attach and work, but without any sound. Some of -that cases can be solved by tuning loader.conf variables. But before -trying to fix problem that way, make sure that problem is really exists -and the PCM audio device you are using really corresponds to expected +driver seems to attach and work, but no sound is played. +Some cases can be solved by tuning +.Pa loader.conf +variables. +Before trying to fix problem that way, make sure that there really is a problem +and that the PCM audio device in use really corresponds to the expected audio connector. .Pp -Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec -to control external amplifiers. In some cases setting proper combination of -GPIO bits may be needed to make sound work on specific device. +Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec +to control external amplifiers. +In some cases setting a combination of GPIO bits may be needed to make +sound work on a specific device. .Pp HDMI and DisplayPort audio may also require support from video driver. From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 11:14:03 2011 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 36B19106564A; Sun, 19 Jun 2011 11:14:03 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0A48FC0A; Sun, 19 Jun 2011 11:14: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 p5JBE2R9091317; Sun, 19 Jun 2011 11:14:02 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JBE2KB091315; Sun, 19 Jun 2011 11:14:02 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106191114.p5JBE2KB091315@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 19 Jun 2011 11:14:02 +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: r223291 - stable/7/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, 19 Jun 2011 11:14:03 -0000 Author: bcr (doc committer) Date: Sun Jun 19 11:14:02 2011 New Revision: 223291 URL: http://svn.freebsd.org/changeset/base/223291 Log: MFC r223160: Fix some wording and grammar in the BUGS section. PR: docs/157901 Submitted by: Niclas Zeising (niclas dot zeising at gmail dot com) Reviewed by: mav Modified: stable/7/share/man/man4/snd_hda.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/snd_hda.4 ============================================================================== --- stable/7/share/man/man4/snd_hda.4 Sun Jun 19 11:01:38 2011 (r223290) +++ stable/7/share/man/man4/snd_hda.4 Sun Jun 19 11:14:02 2011 (r223291) @@ -626,17 +626,21 @@ and A few Hardware/OEM vendors tend to screw up BIOS settings, thus rendering the .Nm -driver useless, which usually results in a state where the +driver useless. +This usually results in a state where the .Nm -driver seems to attach and work, but without any sound. Some of -that cases can be solved by tuning loader.conf variables. But before -trying to fix problem that way, make sure that problem is really exists -and the PCM audio device you are using really corresponds to expected +driver seems to attach and work, but no sound is played. +Some cases can be solved by tuning +.Pa loader.conf +variables. +Before trying to fix problem that way, make sure that there really is a problem +and that the PCM audio device in use really corresponds to the expected audio connector. .Pp -Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec -to control external amplifiers. In some cases setting proper combination of -GPIO bits may be needed to make sound work on specific device. +Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec +to control external amplifiers. +In some cases setting a combination of GPIO bits may be needed to make +sound work on a specific device. .Pp HDMI and DisplayPort audio may also require support from video driver. .Pp From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 11:26:46 2011 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 C47121065674; Sun, 19 Jun 2011 11:26:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCA08FC1D; Sun, 19 Jun 2011 11:26:45 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5JBQf11007476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jun 2011 21:26:42 +1000 Date: Sun, 19 Jun 2011 21:26:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: TAKAHASHI Yoshihiro In-Reply-To: <20110619.114704.59640143160110864.nyan@FreeBSD.org> Message-ID: <20110619193320.Y917@besplex.bde.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: benl@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 11:26:46 -0000 On Sun, 19 Jun 2011, TAKAHASHI Yoshihiro wrote: > In article <201106181356.p5IDuXhW044171@svn.freebsd.org> > Ben Laurie writes: >> >> Log: >> Fix clang warnings. >> >> Modified: head/sys/sys/diskpc98.h >> ============================================================================== >> --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -36,8 +36,11 @@ >> #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ >> +#undef DOSPARTOFF >> #define DOSPARTOFF 0 >> +#undef DOSPARTSIZE >> #define DOSPARTSIZE 32 >> +#undef NDOSPART >> #define NDOSPART 16 >> #define DOSMAGICOFFSET 510 >> #define DOSMAGIC 0xAA55 >> @@ -52,6 +55,7 @@ >> >> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >> +#undef DOSPTYP_386BSD >> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >> >> struct pc98_partition { >> > > I wonder why this is needed, and why only for diskpc98.h, not > diskmbr.h. This is needed to break the warning even more. There are are enormous number of layers of brokenness: o These header files unfortunately define some ioctls (just 1), so kdump/mkioctls generates an include of both in ioctl.c. This causes conflicts. The conflicts should cause errors (though the conflicting definitions aren't actually used in ioctl.c), but they only generates warnings. o If you compile ioctl.c standalone to test this, then it compiles with no warnings with both gcc and clang, since -Wno-system-headers is the default for gcc and apparently for clang too. However, for world builds there is magic that results in being $(realpath /usr/obj)/src/tmp/usr/include/sys instead of just /usr/include/sys. I'm not sure if clang only is confused by this so that -Wno-system-headers doesn't break the warnings for clang only, or if the warnings have always been happening and they are just more obvious with clang colorizing them. o The build system knows about -Wno-system-headers breaking warnings, so it puts -Wsystem-headers in CFLAGS to turn this off. But it only does this at WARNS >= 1, and kdump still uses WARNS = 0. o Poor structuring of the disk headers. I've always thought that diskmbr.h shouldn't exist. It doesn't describe "the" disk mbr structure, but only the "i386" one. It should have been named something like diski386.h. The current problem shows that these files should have been purely MD so that they can be kept separate. Their names should have been something like . Or for simplicity, keep all of their definitions with ifdefs in like they used to be as recently as FreeBSD-4. disklabel.h still has some ugly unsorted MD ifdefs (just 2, for LABELSECTOR and LABELOFFSET). Of course, definitions for MBRs should never have been in disklabel.h. For simplicity with fewer hacks, put all the MBR definitions with ifdefs in . The current problem shows that many ifdefs are needed with the current structuring anyway. We only escape having to ifdef everything in both of the files (or complications in mkioctls) because some names are different (e.g., struct pc98_partition instead of struct dos_partition, and more importantly, DIOCSPC98 instead of DIOCSMBR -- the latter allows both ioctls to be defined in ioctl.c, though only the pc98 is normally used on pc98. BTW, can pc98 handle i386-formatted disks? MacOS supports i386-mbr formatted USB drives better than WinXP does -- WinXP can only mount FAT32 partitions in MBR slot 1, though it can recognize them in any slot. Such support is easiest if all the mbr ioctls are available in all arches. But I now think that depending on any disk ioctl in an application like fdisk or newfs is a bug. Such applications should be able to work on any "direct addressable" file (including regular files and foreign disks). Some Linux disk applications now work better on FreeBSD than FreeBSD ones do, since they don't depend so much on ioctls :-(). This is only "needed" for diskpc98.h because 'm' is less than 'p', so diskmbr.h is always included before diskpc98.h. I thought at first that the order of the includes could not be depended on, because the find(1) in mkioctls produced output in (unsorted) tree traversal order. But the find is actually on "*" in each directory in the include path, so the shell will sort the includes alphabetically within each directory. I now remember that this is intentional, to get the same breakage as an application which complies with style(9) will get if there are any bogus ordering requirements for directories that are not accidentally satisified by keeping the includes sorted. See the /* XXX obnoxious prerequisites. */ section in mkioctls. This intentionally includes a few headers out of order, to work around cases where the normal order doesn't work. One of these headers is disklabel.h, which might not be needed there any more now that it has been cleaned up. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 11:42:49 2011 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 22DF8106564A; Sun, 19 Jun 2011 11:42:49 +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 128E68FC12; Sun, 19 Jun 2011 11:42: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 p5JBgmsC092184; Sun, 19 Jun 2011 11:42:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JBgmaK092182; Sun, 19 Jun 2011 11:42:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106191142.p5JBgmaK092182@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 11:42: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: r223292 - head/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, 19 Jun 2011 11:42:49 -0000 Author: jilles Date: Sun Jun 19 11:42:48 2011 New Revision: 223292 URL: http://svn.freebsd.org/changeset/base/223292 Log: rc.subr: Eliminate a fork from check_kern_features, like r223227. MFC after: 2 weeks Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jun 19 11:14:02 2011 (r223291) +++ head/etc/rc.subr Sun Jun 19 11:42:48 2011 (r223292) @@ -1744,7 +1744,7 @@ check_kern_features() local _v [ -n "$1" ] || return 1; - _v=`eval echo "\\$_rc_cache_kern_features_$1"` + eval _v=\$_rc_cache_kern_features_$1 [ -n "$_v" ] && return "$_v"; if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 11:55:22 2011 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 F05881065672; Sun, 19 Jun 2011 11:55:22 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id A52DD8FC14; Sun, 19 Jun 2011 11:55:22 +0000 (UTC) Received: by pvg11 with SMTP id 11so1061030pvg.13 for ; Sun, 19 Jun 2011 04:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=YruydtxjfqY19tiXunjg9rJNl+80F2F/NqJZ6TlJ4+M=; b=dy5hLi82yxhrziadhydF6adv3XJ5waZQPAi5GcEFgIQU0C8S3wqax43Q9jmeSSHVOs oiD2F8dFizaWx3csdLo9p0raUKI2TCZoY79uSLGwCAM0XQpeFik7bOMq7oAJ5PDDDCIh cVBRY29mJBxRsqj+jqqKW7QXurPqiJaCIvcR0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=rLe6nXLgSTHeZ3ZxH+eSTY/wQEDD36bavv8LDKwZBPzft3RPHxGGop6Y0k14aCytAs KHsZIZTebcLuqqdl+LYjMtu/xiCXXSx6RZF6MM/nb7ImOAseDtZxRtnrdN/QFoqv/I2c 5JCpiqEryjGrqvDbW86y2ofn6JcyDvpUxFAm0= Received: by 10.68.34.72 with SMTP id x8mr1624697pbi.312.1308484522168; Sun, 19 Jun 2011 04:55:22 -0700 (PDT) Received: from [192.168.20.56] (c-24-6-49-154.hsd1.ca.comcast.net [24.6.49.154]) by mx.google.com with ESMTPS id m9sm2588342pbd.39.2011.06.19.04.55.20 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2011 04:55:21 -0700 (PDT) References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> <20110619193320.Y917@besplex.bde.org> In-Reply-To: <20110619193320.Y917@besplex.bde.org> Mime-Version: 1.0 (iPhone Mail 8J2) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <2FF8921B-04E8-43CA-9140-1DEB0933C8E3@gmail.com> X-Mailer: iPhone Mail (8J2) From: Garrett Cooper Date: Sun, 19 Jun 2011 04:55:16 -0700 To: Bruce Evans Cc: "benl@FreeBSD.org" , "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , TAKAHASHI Yoshihiro Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 11:55:23 -0000 On Jun 19, 2011, at 4:26 AM, Bruce Evans wrote: > On Sun, 19 Jun 2011, TAKAHASHI Yoshihiro wrote: >=20 >> In article <201106181356.p5IDuXhW044171@svn.freebsd.org> >> Ben Laurie writes: >>>=20 >>> Log: >>> Fix clang warnings. >>>=20 >>> Modified: head/sys/sys/diskpc98.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >>> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >>> @@ -36,8 +36,11 @@ >>> #include >>>=20 >>> #define DOSBBSECTOR 0 /* DOS boot block relative sector number *= / >>> +#undef DOSPARTOFF >>> #define DOSPARTOFF 0 >>> +#undef DOSPARTSIZE >>> #define DOSPARTSIZE 32 >>> +#undef NDOSPART >>> #define NDOSPART 16 >>> #define DOSMAGICOFFSET 510 >>> #define DOSMAGIC 0xAA55 >>> @@ -52,6 +55,7 @@ >>>=20 >>> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >>> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >>> +#undef DOSPTYP_386BSD >>> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >>>=20 >>> struct pc98_partition { >>>=20 >>=20 >> I wonder why this is needed, and why only for diskpc98.h, not >> diskmbr.h. >=20 > This is needed to break the warning even more. There are are enormous > number of layers of brokenness: >=20 > o These header files unfortunately define some ioctls (just 1), so > kdump/mkioctls generates an include of both in ioctl.c. This causes > conflicts. The conflicts should cause errors (though the conflicting > definitions aren't actually used in ioctl.c), but they only generates > warnings. >=20 > o If you compile ioctl.c standalone to test this, then it compiles with > no warnings with both gcc and clang, since -Wno-system-headers is the > default for gcc and apparently for clang too. However, for world builds > there is magic that results in being > $(realpath /usr/obj)/src/tmp/usr/include/sys instead of just > /usr/include/sys. I'm not sure if clang only is confused by this so > that -Wno-system-headers doesn't break the warnings for clang only, > or if the warnings have always been happening and they are just more > obvious with clang colorizing them. >=20 > o The build system knows about -Wno-system-headers breaking warnings, so > it puts -Wsystem-headers in CFLAGS to turn this off. But it only does > this at WARNS >=3D 1, and kdump still uses WARNS =3D 0. >=20 > o Poor structuring of the disk headers. I've always thought that > diskmbr.h shouldn't exist. It doesn't describe "the" disk mbr > structure, but only the "i386" one. It should have been named > something like diski386.h. The current problem shows that these > files should have been purely MD so that they can be kept separate. > Their names should have been something like . > Or for simplicity, keep all of their definitions with ifdefs in > like they used to be as recently as FreeBSD-4. > disklabel.h still has some ugly unsorted MD ifdefs (just 2, for > LABELSECTOR and LABELOFFSET). Of course, definitions for MBRs > should never have been in disklabel.h. For simplicity with fewer > hacks, put all the MBR definitions with ifdefs in . > The current problem shows that many ifdefs are needed with the > current structuring anyway. We only escape having to ifdef everything > in both of the files (or complications in mkioctls) because some names > are different (e.g., struct pc98_partition instead of struct > dos_partition, and more importantly, DIOCSPC98 instead of DIOCSMBR -- > the latter allows both ioctls to be defined in ioctl.c, though only > the pc98 is normally used on pc98. BTW, can pc98 handle i386-formatted > disks? MacOS supports i386-mbr formatted USB drives better than > WinXP does -- WinXP can only mount FAT32 partitions in MBR slot 1, > though it can recognize them in any slot. Such support is easiest > if all the mbr ioctls are available in all arches. But I now think > that depending on any disk ioctl in an application like fdisk or > newfs is a bug. Such applications should be able to work on any > "direct addressable" file (including regular files and foreign > disks). Some Linux disk applications now work better on FreeBSD than > FreeBSD ones do, since they don't depend so much on ioctls :-(). >=20 > This is only "needed" for diskpc98.h because 'm' is less than 'p', so > diskmbr.h is always included before diskpc98.h. I thought at first > that the order of the includes could not be depended on, because the > find(1) in mkioctls produced output in (unsorted) tree traversal order. > But the find is actually on "*" in each directory in the include path, > so the shell will sort the includes alphabetically within each directory. > I now remember that this is intentional, to get the same breakage as > an application which complies with style(9) will get if there are any > bogus ordering requirements for directories that are not accidentally > satisified by keeping the includes sorted. See the /* XXX obnoxious > prerequisites. */ section in mkioctls. This intentionally includes > a few headers out of order, to work around cases where the normal > order doesn't work. One of these headers is disklabel.h, which > might not be needed there any more now that it has been cleaned up. If my ktrace WARNS 0 -> 6 patch had been reviewed that I submitted some week= s ago, then this would be moot. It's not a perfect solution, but it worked. Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 12:12:17 2011 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 13BC4106564A; Sun, 19 Jun 2011 12:12:17 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id AF6F38FC0C; Sun, 19 Jun 2011 12:12:16 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id 644FF33C1F; Sun, 19 Jun 2011 13:12:15 +0100 (BST) Message-ID: <4DFDE79F.6030803@links.org> Date: Sun, 19 Jun 2011 13:12:15 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110619.114704.59640143160110864.nyan@FreeBSD.org> In-Reply-To: <20110619.114704.59640143160110864.nyan@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: benl@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 12:12:17 -0000 On 19/06/2011 03:47, TAKAHASHI Yoshihiro wrote: > In article <201106181356.p5IDuXhW044171@svn.freebsd.org> > Ben Laurie writes: > >> Author: benl >> Date: Sat Jun 18 13:56:33 2011 >> New Revision: 223262 >> URL: http://svn.freebsd.org/changeset/base/223262 >> >> Log: >> Fix clang warnings. >> >> Modified: head/sys/sys/diskpc98.h >> ============================================================================== >> --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -36,8 +36,11 @@ >> #include >> >> #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ >> +#undef DOSPARTOFF >> #define DOSPARTOFF 0 >> +#undef DOSPARTSIZE >> #define DOSPARTSIZE 32 >> +#undef NDOSPART >> #define NDOSPART 16 >> #define DOSMAGICOFFSET 510 >> #define DOSMAGIC 0xAA55 >> @@ -52,6 +55,7 @@ >> >> #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) >> #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) >> +#undef DOSPTYP_386BSD >> #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) >> >> struct pc98_partition { >> > > I wonder why this is needed, and why only for diskpc98.h, not > diskmbr.h. It is needed because it is defined elsewhere, of course. I don't know why it isn't needed for diskmbr.h - perhaps that's the elsewhere? > > --- > TAKAHASHI Yoshihiro > > -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 12:15:59 2011 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 F0209106564A; Sun, 19 Jun 2011 12:15:59 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB2A8FC0A; Sun, 19 Jun 2011 12:15:59 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id C5D0A33C21; Sun, 19 Jun 2011 13:15:58 +0100 (BST) Message-ID: <4DFDE87E.2050309@links.org> Date: Sun, 19 Jun 2011 13:15:58 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Kostik Belousov References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618174531.GW48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110618174531.GW48734@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 12:16:00 -0000 On 18/06/2011 18:45, Kostik Belousov wrote: >> Modified: head/sys/sys/param.h >> ============================================================================== >> --- head/sys/sys/param.h Sat Jun 18 13:54:36 2011 (r223261) >> +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) >> @@ -319,4 +319,10 @@ __END_DECLS >> #define member2struct(s, m, x) \ >> ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) >> >> +/* >> + * Access a variable length array that has been declared as a fixed >> + * length array. >> + */ >> +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) >> + >> #endif /* _SYS_PARAM_H_ */ > > The "typeof" there should be "__typeof", most likely. Hmm. Clang's own headers use __typeof__, it seems. gcc's docs also use __typeof__. -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 12:21:02 2011 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 4C3A9106566B; Sun, 19 Jun 2011 12:21:02 +0000 (UTC) (envelope-from ben@links.org) Received: from mail.links.org (mail.links.org [217.155.92.109]) by mx1.freebsd.org (Postfix) with ESMTP id EFCD08FC0A; Sun, 19 Jun 2011 12:21:01 +0000 (UTC) Received: from [193.133.15.218] (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.links.org (Postfix) with ESMTPS id 0E3B833C22; Sun, 19 Jun 2011 13:21:01 +0100 (BST) Message-ID: <4DFDE9AC.1090000@links.org> Date: Sun, 19 Jun 2011 13:21:00 +0100 From: Ben Laurie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ben Kaduk References: <201106181356.p5IDuXhW044171@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ben Laurie , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 12:21:02 -0000 On 18/06/2011 16:54, Ben Kaduk wrote: > On Sat, Jun 18, 2011 at 9:56 AM, Ben Laurie wrote: >> +# warning need td_popc() implementation > > We seem to still be in dt_popc(), here. Oops. -- http://www.apache-ssl.org/ben.html http://www.links.org/ "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 12:52:51 2011 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 1FE52106566C; Sun, 19 Jun 2011 12:52:51 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC908FC08; Sun, 19 Jun 2011 12:52: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 p5JCqofk094260; Sun, 19 Jun 2011 12:52:50 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JCqo6K094258; Sun, 19 Jun 2011 12:52:50 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201106191252.p5JCqo6K094258@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 19 Jun 2011 12:52: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: r223293 - head/cddl/contrib/opensolaris/lib/libdtrace/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: Sun, 19 Jun 2011 12:52:51 -0000 Author: simon Date: Sun Jun 19 12:52:50 2011 New Revision: 223293 URL: http://svn.freebsd.org/changeset/base/223293 Log: Do not use #warning to warn about missing implementation of dt_popc(), but just have a comment that this is broken. This is just a bandaid until somebody can fix this correctly. The code is just a broken as it was before r223262 - now buildworld just doesn't fail. Tested by: i386 + amd64 buildworld With hat: benl co-mentor Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 11:42:48 2011 (r223292) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sun Jun 19 12:52:50 2011 (r223293) @@ -828,7 +828,7 @@ dt_popc(ulong_t x) x = x + (x >> 32); return (x & 0x7F); #else -# warning need td_popc() implementation +/* This should be a #warning but for now ignore error. Err: "need td_popc() implementation" */ #endif } From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 13:35:36 2011 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 61C7F106564A; Sun, 19 Jun 2011 13:35:36 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 518278FC08; Sun, 19 Jun 2011 13:35: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 p5JDZa0k095646; Sun, 19 Jun 2011 13:35:36 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZaa3095644; Sun, 19 Jun 2011 13:35:36 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZaa3095644@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35: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: r223294 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 13:35:36 -0000 Author: kan Date: Sun Jun 19 13:35:36 2011 New Revision: 223294 URL: http://svn.freebsd.org/changeset/base/223294 Log: Do not set thread name to less than informative 'initial thread'. Modified: head/lib/libthr/thread/thr_init.c Modified: head/lib/libthr/thread/thr_init.c ============================================================================== --- head/lib/libthr/thread/thr_init.c Sun Jun 19 12:52:50 2011 (r223293) +++ head/lib/libthr/thread/thr_init.c Sun Jun 19 13:35:36 2011 (r223294) @@ -409,7 +409,6 @@ init_main_thread(struct pthread *thread) thread->cancel_enable = 1; thread->cancel_async = 0; - thr_set_name(thread->tid, "initial thread"); /* Initialize the mutex queue: */ TAILQ_INIT(&thread->mutexq); From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 13:35:42 2011 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 9DBB2106574F; Sun, 19 Jun 2011 13:35:41 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B95DE8FC0A; Sun, 19 Jun 2011 13:35: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 p5JDZfuB095681; Sun, 19 Jun 2011 13:35:41 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZfES095679; Sun, 19 Jun 2011 13:35:41 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZfES095679@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35: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: r223295 - 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: Sun, 19 Jun 2011 13:35:42 -0000 Author: kan Date: Sun Jun 19 13:35:41 2011 New Revision: 223295 URL: http://svn.freebsd.org/changeset/base/223295 Log: Minimize backward seeks when trying to load ELF relocatable modules. Some of loader filesystems are very ill equipped to handle seeking backwards within the file. Namely, tftp requires trasfer to be restarted from the start of the file every time we go backwards. Modified: head/sys/boot/common/load_elf_obj.c Modified: head/sys/boot/common/load_elf_obj.c ============================================================================== --- head/sys/boot/common/load_elf_obj.c Sun Jun 19 13:35:36 2011 (r223294) +++ head/sys/boot/common/load_elf_obj.c Sun Jun 19 13:35:41 2011 (r223295) @@ -196,7 +196,7 @@ static int __elfN(obj_loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off) { Elf_Ehdr *hdr; - Elf_Shdr *shdr; + Elf_Shdr *shdr, *cshdr, *lshdr; vm_offset_t firstaddr, lastaddr; int i, nsym, res, ret, shdrbytes, symstrindex; @@ -294,12 +294,35 @@ __elfN(obj_loadimage)(struct preloaded_f /* Clear the whole area, including bss regions. */ kern_bzero(firstaddr, lastaddr - firstaddr); - /* Now read it all in. */ - for (i = 0; i < hdr->e_shnum; i++) { - if (shdr[i].sh_addr == 0 || shdr[i].sh_type == SHT_NOBITS) - continue; - if (kern_pread(ef->fd, (vm_offset_t)shdr[i].sh_addr, - shdr[i].sh_size, (off_t)shdr[i].sh_offset) != 0) { + /* Figure section with the lowest file offset we haven't loaded yet. */ + for (cshdr = NULL; /* none */; /* none */) + { + /* + * Find next section to load. The complexity of this loop is + * O(n^2), but with the number of sections being typically + * small, we do not care. + */ + lshdr = cshdr; + + for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_addr == 0 || + shdr[i].sh_type == SHT_NOBITS) + continue; + /* Skip sections that were loaded already. */ + if (lshdr != NULL && + lshdr->sh_offset >= shdr[i].sh_offset) + continue; + /* Find section with smallest offset. */ + if (cshdr == lshdr || + cshdr->sh_offset > shdr[i].sh_offset) + cshdr = &shdr[i]; + } + + if (cshdr == lshdr) + break; + + if (kern_pread(ef->fd, (vm_offset_t)cshdr->sh_addr, + cshdr->sh_size, (off_t)cshdr->sh_offset) != 0) { printf("\nelf" __XSTRING(__ELF_WORD_SIZE) "_obj_loadimage: read failed\n"); goto out; From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 13:35:46 2011 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 C00C8106566B; Sun, 19 Jun 2011 13:35:46 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFC2A8FC18; Sun, 19 Jun 2011 13:35: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 p5JDZkx2095717; Sun, 19 Jun 2011 13:35:46 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JDZk11095714; Sun, 19 Jun 2011 13:35:46 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201106191335.p5JDZk11095714@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 19 Jun 2011 13:35: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: r223296 - head/lib/libc/iconv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 13:35:46 -0000 Author: kan Date: Sun Jun 19 13:35:46 2011 New Revision: 223296 URL: http://svn.freebsd.org/changeset/base/223296 Log: Put a quick bandaid on internal citrus locking. The code is not quite right still, but it programs from deadlocking on themselves if one enables new citrus code by mistake. Modified: head/lib/libc/iconv/citrus_mapper.c head/lib/libc/iconv/iconv.c Modified: head/lib/libc/iconv/citrus_mapper.c ============================================================================== --- head/lib/libc/iconv/citrus_mapper.c Sun Jun 19 13:35:41 2011 (r223295) +++ head/lib/libc/iconv/citrus_mapper.c Sun Jun 19 13:35:46 2011 (r223296) @@ -337,7 +337,9 @@ _citrus_mapper_open(struct _citrus_mappe goto quit; /* open mapper */ + UNLOCK; ret = mapper_open(ma, &cm, module, variable); + WLOCK; if (ret) goto quit; cm->cm_key = strdup(mapname); Modified: head/lib/libc/iconv/iconv.c ============================================================================== --- head/lib/libc/iconv/iconv.c Sun Jun 19 13:35:41 2011 (r223295) +++ head/lib/libc/iconv/iconv.c Sun Jun 19 13:35:46 2011 (r223296) @@ -85,7 +85,7 @@ _iconv_open(const char *out, const char errno = ENOMEM; return ((iconv_t)-1); } - + p = out_truncated; while (*p != 0) { if (p[0] == '/' && p[1] == '/') { From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 15:17:49 2011 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 23D0A106566C; Sun, 19 Jun 2011 15:17:49 +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 B0A838FC14; Sun, 19 Jun 2011 15:17:48 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5JFHjuG016001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 01:17:46 +1000 Date: Mon, 20 Jun 2011 01:17:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ben Laurie In-Reply-To: <4DFDE87E.2050309@links.org> Message-ID: <20110620010724.I1817@besplex.bde.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> <20110618174531.GW48734@deviant.kiev.zoral.com.ua> <4DFDE87E.2050309@links.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , Ben Laurie , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 15:17:49 -0000 On Sun, 19 Jun 2011, Ben Laurie wrote: > On 18/06/2011 18:45, Kostik Belousov wrote: >>> Modified: head/sys/sys/param.h >>> ============================================================================== >>> --- head/sys/sys/param.h Sat Jun 18 13:54:36 2011 (r223261) >>> +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) >>> @@ -319,4 +319,10 @@ __END_DECLS >>> #define member2struct(s, m, x) \ >>> ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) >>> >>> +/* >>> + * Access a variable length array that has been declared as a fixed >>> + * length array. >>> + */ >>> +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) >>> + >>> #endif /* _SYS_PARAM_H_ */ >> >> The "typeof" there should be "__typeof", most likely. > > Hmm. Clang's own headers use __typeof__, it seems. gcc's docs also use > __typeof__. gcc supports but __foo__ and __foo for most things. The excessive underscores in __foo are style bugs and are not used in FreeBSD if possible. (They are useless, unlike leading underscores which are used to put identifiers in reserved namespaces.) Unfortunately, gcc doesn't actually document the alternative __foo form, at least in gcc*.info, and it doesn't support the __foo form for a few identifiers (notably for attributes). typeof in the above is an error because it is in the application namespace. The above also has some style bugs. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 15:23:33 2011 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 4A4B11065673; Sun, 19 Jun 2011 15:23:33 +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 3A5978FC1B; Sun, 19 Jun 2011 15:23: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 p5JFNXWD099020; Sun, 19 Jun 2011 15:23:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JFNXaJ099018; Sun, 19 Jun 2011 15:23:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106191523.p5JFNXaJ099018@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 19 Jun 2011 15:23: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: r223298 - head/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, 19 Jun 2011 15:23:33 -0000 Author: jilles Date: Sun Jun 19 15:23:32 2011 New Revision: 223298 URL: http://svn.freebsd.org/changeset/base/223298 Log: rc.subr: Make sure all functions are under if [ -z "${_rc_subr_loaded}" ]. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jun 19 14:22:35 2011 (r223297) +++ head/etc/rc.subr Sun Jun 19 15:23:32 2011 (r223298) @@ -1732,8 +1732,6 @@ check_required_after() return 0 } -fi - # check_kern_features mib # Return existence of kern.features.* sysctl MIB as true or # false. The result will be cached in $_rc_cache_kern_features_ @@ -1775,4 +1773,6 @@ _echoonce() esac } +fi # [ -z "${_rc_subr_loaded}" ] + _rc_subr_loaded=: From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 15:33:33 2011 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 E16AD106566B; Sun, 19 Jun 2011 15:33:33 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id ED6FF8FC0C; Sun, 19 Jun 2011 15:33:32 +0000 (UTC) Received: by fxm11 with SMTP id 11so1523810fxm.13 for ; Sun, 19 Jun 2011 08:33:31 -0700 (PDT) Received: by 10.223.14.131 with SMTP id g3mr1359125faa.46.1308495768976; Sun, 19 Jun 2011 08:02:48 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-067-197-199.pools.arcor-ip.net [88.67.197.199]) by mx.google.com with ESMTPS id a18sm2302203fak.29.2011.06.19.08.02.45 (version=SSLv3 cipher=OTHER); Sun, 19 Jun 2011 08:02:47 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: src-committers@freebsd.org Date: Sun, 19 Jun 2011 17:03:13 +0200 User-Agent: KMail/1.13.7 (FreeBSD/8.2-STABLE; KDE/4.6.3; amd64; ; ) References: <201106181227.p5ICRnsN041126@svn.freebsd.org> In-Reply-To: <201106181227.p5ICRnsN041126@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106191703.13721.bschmidt@freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r223255 - in stable/8/sys: conf contrib/dev/iwn modules/iwnfw/iwn1000 modules/iwnfw/iwn5000 modules/iwnfw/iwn6050 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 15:33:34 -0000 On Saturday 18 June 2011 14:27:49 Bernhard Schmidt wrote: > Author: bschmidt > Date: Sat Jun 18 12:27:49 2011 > New Revision: 223255 > URL: http://svn.freebsd.org/changeset/base/223255 > > Log: > MFC r220892: > Update iwn(4) firmware blobs: > - bump iwn1000fw to 39.31.5.1 > - bump iwn5000fw to 8.83.5.1 > - bump iwn6050fw to 41.28.5.1 Just a heads up, this seems to have broken the firmware modules if -DNOCLEAN is used. Basically, the resulting .ko is linked with old and new objects files with different version numbers (same on HEAD). I'd appreciate if someone with more clue about Makefiles is willing to help me on resolving this. I have a rough idea about how to do it, but that's about it. -- Bernhard From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 13:56:51 2011 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 00996106566B; Sun, 19 Jun 2011 13:56:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id C036E8FC12; Sun, 19 Jun 2011 13:56:50 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LN100000IQPTM00@smtpauth2.wiscmail.wisc.edu>; Sun, 19 Jun 2011 08:56:49 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-76-208-70-37.dsl.mdsnwi.sbcglobal.net [76.208.70.37]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LN100GZ9IQORB00@smtpauth2.wiscmail.wisc.edu>; Sun, 19 Jun 2011 08:56:49 -0500 (CDT) Date: Sun, 19 Jun 2011 08:56:48 -0500 From: Nathan Whitehorn In-reply-to: To: Adrian Chadd Message-id: <4DFE0020.9050301@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.70.37 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.19.135114, SenderIP=76.208.70.37 References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> <4DFD0BBA.1010502@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 X-Mailman-Approved-At: Sun, 19 Jun 2011 15:43:04 +0000 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Jeremy Subject: Re: svn commit: r223129 - 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: Sun, 19 Jun 2011 13:56:51 -0000 On 06/18/11 19:07, Adrian Chadd wrote: > On 19 June 2011 04:34, Nathan Whitehorn wrote: > >> Since all of our install CDs for 9.0 (even the boot-only ones!) will be live >> CDs, the full versions of everything in /rescue are on the CD in their usual >> locations in /bin, /sbin, etc. and these can be used just as well for fixing >> a system as the /rescue tools. >> -Nathan > Question - is sysinstall still installed on those? > > If so (it was installed on the USB -current image I used to install > from a month or so ago) it confused me as I ran sysinstall fine but I > couldn't install anything using it. Yes, it is. But it won't work for anything except system configuration. It would need to be updated to use the new distfile format, and that won't has not yet been done. -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 16:51:30 2011 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 E8E7B106564A; Sun, 19 Jun 2011 16:51:30 +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 C03CA8FC1A; Sun, 19 Jun 2011 16:51: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 p5JGpUGI001824; Sun, 19 Jun 2011 16:51:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JGpUoV001823; Sun, 19 Jun 2011 16:51:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191651.p5JGpUoV001823@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 16:51:30 +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: r223299 - vendor/tnftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 16:51:31 -0000 Author: gavin Date: Sun Jun 19 16:51:30 2011 New Revision: 223299 URL: http://svn.freebsd.org/changeset/base/223299 Log: Remove my previous import of tnftp, I'm going to do it again properly to preseve past history. Deleted: vendor/tnftp/ From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 16:54:06 2011 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 860F71065670; Sun, 19 Jun 2011 16:54:06 +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 745B48FC22; Sun, 19 Jun 2011 16:54: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 p5JGs6Jd001927; Sun, 19 Jun 2011 16:54:06 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JGs6G6001923; Sun, 19 Jun 2011 16:54:06 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191654.p5JGs6G6001923@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 16:54:06 +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: r223300 - in vendor/lukemftp/dist: . contrib 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: Sun, 19 Jun 2011 16:54:06 -0000 Author: gavin Date: Sun Jun 19 16:54:06 2011 New Revision: 223300 URL: http://svn.freebsd.org/changeset/base/223300 Log: Bootstrap lukemftp vendor area Added: - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/COPYING - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/ChangeLog - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/FreeBSD-patchset - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/INSTALL - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/Makefile.in - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/NEWS - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/README - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/THANKS - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/acconfig.h - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/aclocal.m4 - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/config.h.in - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/configure - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/configure.in - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/diffout - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/install-sh - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/lukemftp.h vendor/lukemftp/dist/src/ - copied from r223298, vendor/lukemftp/dist/contrib/lukemftp/src/ - copied unchanged from r223298, vendor/lukemftp/dist/contrib/lukemftp/todo Directory Properties: vendor/lukemftp/dist/COPYING (props changed) vendor/lukemftp/dist/ChangeLog (props changed) vendor/lukemftp/dist/FreeBSD-patchset (props changed) vendor/lukemftp/dist/INSTALL (props changed) vendor/lukemftp/dist/Makefile.in (props changed) vendor/lukemftp/dist/NEWS (props changed) vendor/lukemftp/dist/README (props changed) vendor/lukemftp/dist/THANKS (props changed) vendor/lukemftp/dist/acconfig.h (props changed) vendor/lukemftp/dist/aclocal.m4 (props changed) vendor/lukemftp/dist/config.h.in (props changed) vendor/lukemftp/dist/configure (props changed) vendor/lukemftp/dist/configure.in (props changed) vendor/lukemftp/dist/diffout (props changed) vendor/lukemftp/dist/install-sh (props changed) vendor/lukemftp/dist/lukemftp.h (props changed) vendor/lukemftp/dist/todo (props changed) Deleted: vendor/lukemftp/dist/contrib/ Modified: Directory Properties: vendor/lukemftp/dist/src/Makefile (props changed) vendor/lukemftp/dist/src/Makefile.in (props changed) vendor/lukemftp/dist/src/cmds.c (props changed) vendor/lukemftp/dist/src/cmdtab.c (props changed) vendor/lukemftp/dist/src/complete.c (props changed) vendor/lukemftp/dist/src/domacro.c (props changed) vendor/lukemftp/dist/src/extern.h (props changed) vendor/lukemftp/dist/src/fetch.c (props changed) vendor/lukemftp/dist/src/ftp.1 (props changed) vendor/lukemftp/dist/src/ftp.c (props changed) vendor/lukemftp/dist/src/ftp.cat1 (props changed) vendor/lukemftp/dist/src/ftp_var.h (props changed) vendor/lukemftp/dist/src/main.c (props changed) vendor/lukemftp/dist/src/progressbar.c (props changed) vendor/lukemftp/dist/src/progressbar.h (props changed) vendor/lukemftp/dist/src/ruserpass.c (props changed) vendor/lukemftp/dist/src/util.c (props changed) vendor/lukemftp/dist/src/version.h (props changed) Copied: vendor/lukemftp/dist/COPYING (from r223298, vendor/lukemftp/dist/contrib/lukemftp/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lukemftp/dist/COPYING Sun Jun 19 16:54:06 2011 (r223300, copy of r223298, vendor/lukemftp/dist/contrib/lukemftp/COPYING) @@ -0,0 +1,47 @@ +Copyright 1999, 2000 Luke Mewburn . 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 Luke Mewburn. +4. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +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. + +This product also contains software developed by other people, and you +are advised to read the various source files to read the full details +of the other licenses. Those licenses also require the following +acknowledgements: + + This product includes software developed by the NetBSD Foundation, + Inc. and its contributors. Those contributors include: + - Jaromir Dolecek + - Klaus Klein + - Luke Mewburn + - Jason R. Thorpe of the Numerical Aerospace Simulation + Facility, NASA Ames Research Center. + + This product includes software developed by the University of + California, Berkeley and its contributors. Those contributors include: + - Christos Zoulas of Cornell University. + - Guido van Rossum. + + This product includes software developed by Christos Zoulas. + Copied: vendor/lukemftp/dist/ChangeLog (from r223298, vendor/lukemftp/dist/contrib/lukemftp/ChangeLog) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/lukemftp/dist/ChangeLog Sun Jun 19 16:54:06 2011 (r223300, copy of r223298, vendor/lukemftp/dist/contrib/lukemftp/ChangeLog) @@ -0,0 +1,1084 @@ +Mon Jun 10 08:12:35 UTC 2002 lukem + + * crank FTP_VERSION from 1.6-beta1 to 1.6-beta2 + + * replace missing fseeko(), with a wrapper to fseek() which + checks that the offset isn't > LONG_MAX + + * #include #if HAVE_REGEX_H + +Mon Jun 10 01:27:46 UTC 2002 lukem + + * check for and replace sa_family_t definition + + * don't bother checking for issetugid(); it was only used in the + internal libedit to prevent $HOME/.editrc from being used if + running set-id, and the newer libedit code wouldn't even read + $HOME/.editrc if issetugid() wasn't available. as many target + operating systems don't have issetugid(), and lukemftp isn't + likely to be run set-id (and $HOME/.netrc is used in any case), + the issetugid() check has been disabled in libedit. + + * add back cpp code which #defines REGEX #if HAVE_REGEX_H + +Wed Jun 5 14:39:11 UTC 2002 lukem + + * crank FTP_VERSION from 1.6alpha1 to 1.6-beta1 + + * implement replacement setprogname() + + * use getprogname() instead of __progname + + * convert to christos' replacement fgetln(), as it's better than mine + + * merge ftp from NetBSD 20020605 to 20020606: + - use setprogname() + - only support -6 if INET6 is defined + +Wed Jun 5 13:08:25 UTC 2002 lukem + + * don't bother checking if is usable (see below). + + * always compile in local glob; it's the best way to ensure that + various security issues are fixed + + * update libukem/glob.c from NetBSD's __glob13.c rev 1.22 and rev 1.23 + + * merge libedit from NetBSD 20010413 to 20020606: + - constify; passes all gcc and lint strict checks. + - add config.h [Jason Evans], to create a portable version of + libedit that can be easily compiled on other OS's. + - PR/12963:Jason Waterman: Fix signed cast problems. + - Fixed an __P remnant + - Close quoting. + - Generate <>& symbolically. + - Punctuation and whitespace nits, fix a typo. + - PR/14188: Anthony Mallet: Provide an opaque data + pointer to client programs. + - a couple of minor fixes. originally by Ruslan Ermilov + , highlighted to me by way of Mike Barcroft + (thanks!) + - PR/14067: Anthony Mallet: Provide a programmatic way + to set the read_char function via a new el_set() operation. + Thanks, nicely done :-) + - `existent', not `existant' + - Don't use HAVE_ yet. + - Fix a warning. + - Remove an unused variable. + - If term_init() fails, cleanup and return NULL. This + avoids other lossage. Pointed by charles. + - va_{start,end} audit: Make sure that each va_start has one + and only one matching va_end, especially in error cases. + If the va_list is used multiple times, do multiple + va_starts/va_ends. If a function gets va_list as argument, + don't let it use va_end (since it's the callers + responsibility). Improved by comments from enami and + christos -- thanks! + - history_def_enter: fix off-by-one mistake in delete + condition (the behaviour to keep at least one entry on the + history list is retained). This fixes lib/9704 by Phil Nelson. + + * merge ftp from NetBSD 20020524 to 20020605: + - when showing the final progress bar, replace "00:00 ETA" + with the elapsed time. (suggested by simonb) + - actually display transfer stats after a URL fetch. + (bug introduced a *long* time ago) + - update copyright & version + + * merge ftp from NetBSD 20001127 to 20020524: + - Use "r+" instead of "r+w", since the latter is not standard. + Noted by in private email. + - Only send port number in HTTP/1.1 Host: request if port != + 80. Fixes [bin/15415] from Takahiro Kambe + + - Fix bad mode passed by mls() to recvrequest(). Fixes + [bin/16642] from + - update copyrights + - minor knf + - invoke cmdtab.c_handler()s with argv[0] == c_name instead + of the supplied name. that way the full (unambiguous) name + is displayed in error messages and usage strings. + - line2 may overrun if line is too long (> 200). be more + careful on strcpy. + - Handle URLs without files correctly (e.g, when using '-o -'). + Fix from Anders Dinsen in [bin/13768] + - portnum is unsigned, use %u instead of %d + - Add -4 to force IPv4 and -6 to force IPv6 address usage. + From Hajimu UMEMOTO, via Mike Heffner of FreeBSD. + - use u_char instead of char in base64_encode(). + problem noticed by Jorgen Lundman in private mail. + - don't make broken file with -R option. + - handle "*" in Content-Range properly. + - If no_proxy condition is true && urltype == FTP_URL_T, + use fetch_ftp to retrieve + - convert to use getprogname() + - Fix description for "form", "mode", and "struct" commands. + Inspired by [bin/16736] from Steve McClellan + + - Generate <>& symbolically. I'm avoiding .../dist/... + directories for now. + - Punctuation nits. + - Whitespace cleanup. + - put "site" in alphabetical order. noted by Mike Barcroft + in private email + - avoid buffer overrun on PASV from malicious server. + - Large file ASCII mode support by using fseeko() + instead of fseek(). From Andrey A. Chernov of FreeBSD, + via Mike Heffner. + - Deal with const'ification if el_parse(). + - call setlocale() on startup + - display a limited progress bar (containing bytes xferred + and xfer rate) when the file size is unknown + - disable progress bar during remglob() + +Thu Mar 14 05:41:49 UTC 2002 lukem + + * ensure all AF_INET6 use is protected with #ifdef INET6 + + * remove unnecessary __attribute__ goop + + * libukem/snprintf.c: fix compile errors with gcc 3.x + +Tue Apr 17 08:07:29 UTC 2001 lukem + + * autoconf check for %q long long support in *printf() + (instead of %ll), define and use HAVE_PRINTF_QD if so + + * ipv6 isn't compatible with socks, so disable the former + + * look for (instead of ) and + + * don't check for fparseln() twice + + * fix getaddrinfo() checks + + * crank FTP_VERSION from 1.5 to 1.6alpha1 + + * always ensure _PATH_BSHELL and _PATH_TMP are defined + + * prototype inet_pton() if its missing + + * don't bother trying to use if_indextoname() in ip6_sa2str() + (fixes problems on MacOS X) + + * in inet_pton(), pull in for IN6ADDRSZ and INT16SZ, + and define if missing + +Fri Apr 13 15:24:44 UTC 2001 lukem + + * only include if we have it + + * update glob(3) to netbsd-current (20010329), adding support + for GLOB_LIMIT and fixing various buffer overflows. + + * update editline from NetBSD 20000915 -> NetBSD 20010413 + - Enlarge editline buffers as needed to support arbitrary + length lines. This also addresses lib/9712 by Phil Nelson. + - consistently check for allocation failures and return -1, + if we could not get more memory. + - add support for home and end keys. + - improve debugging support + - el_line_t: make 'limit' const + +Mon Nov 27 23:23:40 EST 2000 lukem + + * merge ftp from NetBSD-current (20001127): + - implement "mreget"; as per "mget" but uses "reget" instead + of "get" + - add -N netrc and $NETRC, as methods to select an alternative + .netrc file + - cache local user name and home directory for further use + - in mget(), use docase() instead of a local version to do + the case conversion. + - format string cleanups + - be more explicit that $ftp_proxy and $http_proxy are not + supported for interactive sessions + - cope with 2553bis getnameinfo (always attach scope id) + getnameinfo error check. + - use NI_MAXHOST with getnameinfo. we can assume presence of + getnameinfo. + +Tue Nov 7 00:16:23 EST 2000 lukem + + * libukem/snprintf.c had a non-functional `%s' due to a + function declaration mismatch. problem found and fixed + by Hubert Feyrer + +Wed Oct 11 14:06:19 EST 2000 lukem + + * released version 1.5 + +Tue Oct 3 10:22:36 EST 2000 lukem + + * crank to version 1.5 beta6 + + * merge ftp from NetBSD-current (20001003) + - explicitly use SOCK_STREAM with socket() instead of + res->ai_socktype, because it appears that linux with glibc + doesn't set the latter correctly after one of getaddrinfo() + or getnameinfo(). + - clarify that $ftp_proxy only works for full URLs and can't + be used for interactive connections. + +Mon Sep 25 21:52:12 EST 2000 lukem + + * crank to version 1.5 beta5 + +Sun Sep 24 13:31:19 EST 2000 lukem + + * merge ftp from NetBSD-current (20000924) + - since everything else here uses ANSI C, we might as well + replace __STRING() with the ANSI C stringization stuff... + - base64_encode should be static. picked up by hp/ux(!) + compiler + - It appears that whilst Apache 1.3.9 incorrectly puts a + trailing space after the chunksize (before the \r\n), + Apache 1.3.11 puts *multiple* trailing spaces after the + chunksize. I 'm fairly certain that this is contrary to + RFC 2068 section 3.6, but whatever... + Found by David Brownlee + - always include , not just when INET6 is defined. + resolves PR [bin/10970] by Richard Earnshaw + > + - in progressmeter() perform the check for foregroundproc() a + little earlier + - removed unused variable `items' in list_vertical() + +Sat Sep 23 15:43:34 EST 2000 lukem + + * remove unused sverrno in warnx() and errx() + + * remove unused h_error in getnameinfo() + + * in getaddrinfo(), don't bother declaring in6_addrany[] and + in6_loopback #ifndef INET6 + +Thu Sep 21 11:26:35 EST 2000 lukem + + * in getaddrinfo.c::str_isnumber(), use strtol() and check the + result, instead of using strtoul() and not checking the result. + + * define INADDRSZ if it's not found (e.g, HP/UX doesn't seem to have + it in ) + +Wed Sep 20 09:23:59 EST 2000 lukem + + * crank to version 1.5 beta4 + +Mon Sep 18 18:19:54 EST 2000 lukem + + * add AC_AIX test, which defines _ALL_SOURCE under AIX + + * use ANSI # stringization instead of __STRING() + + * define HAVE_RFC2553_NETDB if defines AI_NUMERICHOST + (et al) and has getaddrinfo(). (some systems only implement RFC2133) + + * don't bother with AC_C_CONST as we depend upon ANSI C elsewhere + + * when HAVE_RFC2553_NETDB isn't set, and we're #defining various EAI_, + AI_, and NI_ items, #undef first incase a system partially implements + these in + + * look for tgetent() in -ltinfo before -lncurses, because ncurses 5.0 + has been split up into multiple libraries. + from Arkadiusz Miskiewicz + +Fri Sep 15 01:09:10 EST 2000 lukem + + * don't bother defining __P() or __STRING() based on whether + __STDC__ is available or not, since these aren't used any more + + * fix mkstemp() prototype + + * declare getpass() if necessary + + * we don't need the readline xxgdb hack in libedit... + + * convert to ansi declarations + + * use ansi prototypes instead of __P() + + * merge in changes from makelist 1.4 -> 1.6: + - generate ansi prototypes instead of using __P(). noted by + christos + - fix a couple of comments + - add -m option to makelist, which generates an mdoc table + with the key bindings and their descriptions + - manually add the output of 'sh ./makelist -m vi.c ed.c + common.c' to a new section in editrc(5) called + `EDITOR COMMANDS' + + * merge libedit from NetBSD-current (20000915) + * convert to new style guide, which includes: + - ansi prototypes & features (such as stdargs) + - 8 space indents + * history_def_set has a `const int' as a third arg, not an + `int'. picked up by the ultrix compiler, reported by + simonb@ ... + * generate ansi prototypes instead of using __P(). noted by + christos. fix a couple of comments + * make xxgdb and a gdb linked with libedit's readline emulation + work properly together. xxgdb communicates with a gdb + running on a pty that it sets to -echo,-onlcr prior to + forking the gdb process. GNU readline preserves the -echo + setting while libedit was undoing it (setting the tty to a + sane state and totally confusing xxgdb's parser). + this diff simply disables libedit if both readline emulation + and "stty -echo" are used/set. that is enough to make + xxgdb work once again, but (XXX) this is not how GNU readline + handles stty -echo (it does not echo anything, but editing + commands like ^A,^K, etc. still work), so the readline + emulation isn't perfect. + +Tue Aug 29 18:00:08 EST 2000 lukem + + * don't bother testing for #if __STDC__; just assume we have it... + +Mon Aug 28 22:45:08 EST 2000 lukem + + * refine tests for IPv6 #defines (EAI_, AI_, NI_, ...). + should improve portability on systems which implement + RFC 2133 but not RFC 2553. + +Wed Aug 9 02:12:51 EST 2000 lukem + + * use #if __STDC__ instead of #ifdef __STDC__ + + * only test 'case NETDB_INTERNAL:' if it's defined + + * fix support for --program-prefix et al + + * only include in the files that need it, because + the DELETE define in some system's implementations causes name + collisions in libedit. + +Mon Aug 7 08:17:37 EST 2000 lukem + + * merge ftp from NetBSD-current (20000807) + * implement parseport(), which takes a string and attempts to + convert it to a numeric port number + * use parseport() in parse_url() and hookup() + * don't try and lookup the port number using getaddrinfo(), + as it's too hard to separate a failed host name lookup from + a failed service name lookup. this was causing lossage on + systems that don't have `http' in services(5) (such as + solaris), but only crept in when we started using + getaddrinfo() unconditionally. + +Wed Aug 2 23:43:50 EST 2000 lukem + + * crank to version 1.5 beta3 + + * define NO_LONG_LONG not NO_QUAD + + * detect if struct sockaddr.sa_len exists (rather than relying upon + #ifdef BSD4_4) + + * detect if socklen_t exists, and if not, typedef as unsigned int + + * detect if struct addrinfo exists, and if not declare it and #define + associated EAI_, AI_, and NI_ defines. + + * look for & replace: getaddrinfo(), getnameinfo(), inet_ntop(), + inet_pton() + * look for gethostbyname2() + + * don't bother looking for hstrerror() or inet_aton() anymore + + * include and + + * define USE_SELECT instead of __USE_SELECT + + * always define HAVE_H_ERRNO + + * add Brian Stark to THANKS, for lots of AIX porting feedback + + * improve detection of sin_len for AIX (now part of sa_len test) + + * add functions needed by recent ftp import: + getaddrinfo(), getnameinfo(), inet_ntop(), inet_pton() + remove functions not needed anymore: + hstrerror(), inet_aton() + + * use #if HAVE_ISSETUGID not #ifdef + + * update from NetBSD-current (20000802): + - rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* + (unsigned) equivalents. name change suggested by Klaus + Klein + - change defined(BSD4_4) || HAVE_SIN_LEN tests into + HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists + +Mon Jul 31 10:59:10 EST 2000 lukem + + * merge ftp from NetBSD-current (20000731) + - we can't just rename BSD4_4 -> HAVE_SIN_LEN, since bsd + systems define BSD4_4; change tests to test for either + defined(BSD4_4) or HAVE_SIN_LEN + - more KNF + +Sun Jul 30 16:55:09 EST 2000 lukem + + * merge ftp from NetBSD-current (20000730): + - clean up NO_QUAD support: create helper #defines and use as + appropriate: + #define NOQUAD ! NOQUAD + ------- ------ - ------ + QUADF "%ld" "%lld" + QUADFP(x) "%" x "ld" "%" x "lld" + QUADT long long long + STRTOL(x,y,z) strtol(x,y,z) strtoll(x,y,z) + - always use getaddrinfo() and getnameinfo() instead of + maintaining two code paths. + - rename __USE_SELECT to USE_SELECT + - rename BSD4_4 to HAVE_SIN_LEN + - replace union sockunion {} with struct sockinet {}, and + modify the code accordingly. this is possibly more portable, + as it doesn't rely upon the structure alignment within the + union for our own stuff. + +Fri Jul 28 22:11:17 EST 2000 lukem + + * merge ftp from NetBSD-current (20000728): + - no trailing , on last item (FEAT_max) in enum + - rename "opts" to "remopts", so people used to "o host" + don't get bitten + +Wed Jul 26 18:59:19 EST 2000 lukem + + * merge ftp from NetBSD-current (20000726): + - add support for FEAT and OPTS commands with `features' and + `opts'. (from RFC 2389). + - add support for MLST & MLSD (machine parseble listings) + with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. + (from draft-ietf-ftpext-mlst-11) + - rename remotesyst() to getremoteinfo(), and modify to parse + the result from FEAT (if supported), and take into account + the support for the various extensions such as MDTM, SIZE, + REST (STREAM), MLSD, and FEAT/OPTS. + - put each feature into one of the following categories: + - known to work (explicit FEAT) + - unknown but assume works until explicit failure, + when it's then tagged as `known not to work'. + - known not to work (FEAT succeeded but didn't return + anything, or was unknown and then explicit failure) + assign results into features[] matrix. + - add support to getreply() so that an optional callback will + be called for each line received from the server except for + the first and last. this is used in FEAT (and MLST) parsing. + - modify various commands to check if REST (STREAM), MDTM and + SIZE are explicitly or implicitly supported before using. + - fix `syst' when verbose is off. + - minor knf (indent goto labels by one space, etc). + - simply various command usage handlers by assuming that + argv != NULL except for quit() and disconnect(). + - errx?/warnx? audit. do not pass variable alone, use %s. + + * check for issetugid() and don't use in libedit if it doesn't exist. + + * merge libedit from NetBSD-current (20000726): + * Only look in home directory for .editrc. (Discussed + with Christos.) + + * in glob.c #undef TILDE before redefining, because some AIX systems + #define TILDE in + +Mon Jul 10 00:28:51 EST 2000 lukem + + * released lukemftp 1.4 + +Thu Jun 15 23:28:49 EST 2000 lukem + + * merge ftp from NetBSD-current (20000615): + * migrate the SYST parsing from setpeer() into a separate + remotesyst(). call remotesyst() only when login has been + successful some servers don't let you run SYST until you've + successfully logged in. + * in fetch_ftp(), always call setpeer() with autologin + disabled, and use the following ftp_login() to DTRT. this + prevents ftp from trying to login a second time if the + first autologin fails when connecting to a remote site + anonymously using autofetch. + * reset unix_proxy and unix_server in cleanuppeer() + * missed a function conversion in the KNF sweep... + +Mon Jun 12 01:16:12 EST 2000 lukem + + * change lukemftp.h to check !HAVE_STRDUP instead of !HAVE_STRSUP. + fixes compile problem on systems which have strdup() as a macro. + + * merge ftp from NetBSD-current (20000612): + from itojun: better fix for previous (doesn't need + in_addr_t or u_int32_t) + +Sun Jun 11 12:19:52 EST 2000 lukem + + * merge ftp from NetBSD-current (20000611): + portability fixes for lukemftp: + * initconn(): use in_addr_t instead of u_int32_t when + manipulating IPv6 addresses (and assume anything with ipv6 + has in_addr_t; if not, i'll add an autoconf test for it) + * ai_unmapped(): not all systems have sin_len; so only set + #ifdef BSD4_4 + * fix some lint + +Mon Jun 5 21:10:31 EST 2000 lukem + + * released lukemftp 1.3 + +Mon Jun 5 19:53:49 EST 2000 lukem + + * convert various support files to ANSI C + + * look for strtoll() instead of strtoq() + + * update COPYRIGHT, THANKS, NEWS + + * merge ftp from NetBSD-current (20000605): + - fix ai_unmapped() to be a no-op in the !def INET6 case + - display `(-INET6)' at the end of the version string if + !def INET6 + - clarify in the man page that IPv6 support may not be present + (for lukemftp :) + + * ensure has VIS_WHITE et al + +Sun Jun 4 18:00:07 EST 2000 lukem + + * merge ftp from NetBSD-current (20000604): + - Change `ls' to use the `LIST' and not `NLST' FTP protocol + command. Now that after many years on not caring we find + certain popular ftp servers are starting to obey RFC959 to + the letter of the law and will only return a list of + filenames (not directories or other filetypes) in the + output of `NLST', then `LIST' is more useful in this case. + (Note that the aforementioned pedanticness means that + filename completion isn't as useful as it could be...) + Fixes [bin/8937] by David A. Gatwood + + - convert to ANSI KNF + - Add support for `fget localfile', which reads a list of + filenames to retrieve from localfile. Based on work by + Darren Reed. + - Update copyright dates. + - s/strtoq/strtoll/ (the latter is standardised) + - Add support for 'ftp -u url file ...', to upload a list of + files to given url. Mostly based on [bin/10019] by Scott + Aaron Bamford + - convert IPv4 mapped address (::ffff:10.1.1.1) into real IPv4 + address before touching it. IPv4 mapped address complicates + too many things in FTP protocol handling. + - do not pass scoped IPv6 address notation on Host: directive, + since scope identifier is local to the originating node. + do not allow scoped IPv6 address notation in URL, if it is + via proxy. + - fixes from cgd: + * sanity check a length (otherwise certain bogus responses + can crash ftp) + * allow a transfer encoding type of `binary'; certain + firewall vendors return this bogus type... + - make debugging output unambiguous on IPv6 numeric addrs + (don't use host:port) + - http://[::1]:8080/ is legal. + - send Host: directive with RFC2732 bracket notation for IPv6 + numeric, otherwise "host:port" is ambiguous to servers + (clarification will be submitted as update to RFC2732). + - only use getaddrinfo() et al if both NI_NUMERICHOST *and* + INET6 are defined... (allows --disable-ipv6 in lukemftp's + configure script to disable this as well, which is good for + testing when it appears getaddrinfo() is borken) + - updated comment on IPv4 mapped address. sync with kame. + - Fix examples on using pipes in local filenames. AFAICT, + ftp has always required `dir . |more' not as `dir |more' + treats `|more' as the remote filename. Resolves [bin/9922] + by Geoff Wing + - ftp(1): treats IPv4 mapped destination as IPv4 peer, not + native IPv6 peer. this does not support network with SIIT + translator. + - inhibit too-noisy message for scoped address data transfer + (will be enabled in "debug" mode). + - only use IPTOS_ setsockopt()s if they're defined (e.g, SunOS + doesn't). from Havard.Eidnes@runit.sintef.no + - allow IPv6 extended numeric address in host part. + (draft-ietf-ipngwg-scopedaddr-format-01.txt). fixes PR 9616. + + * merge libedit from NetBSD-current (20000604): + - use strtol() (instead of atoi()) for sane error detection + +Wed May 31 19:24:53 EST 2000 lukem + + * merge libedit from NetBSD-current (20000531): + - Fix refresh glitches when using auto-margin. + - Don't dump core on empty .editrc files. + - el_insertstr takes a "const char *" not "char *" now as it + doesn't modify the argument. + +Thu Feb 3 20:19:40 EST 2000 lukem + + * released lukemftp 1.2 + +Tue Feb 1 09:47:51 EST 2000 lukem + + * add --enable-ipv6 and --disable-ipv6 to configure + + * modify libedit/sig.? to use sigfunc instead of sig_t, and + deprecate autoconf tests for retsigtype and sig_t. + This fixes portability problems with Digital UNIX 5.0. + + * merge ftp from NetBSD-current (20000201): + - define private type `sigfunc' as + typedef void (*sigfunc) __P((int)); + and replace use of sig_t and void (*)(int). + certain other OSes define sig_t differently to that (they + add extra arguments), and it causes problems due to + function mismatches, etc... + +Wed Jan 26 22:54:38 EST 2000 lukem + + * search for tgetent() in -ltermcap then -lcurses and -lncurses + + * merge ftp from NetBSD-current (20000126): + - roll back to using sscanf() instead of strptime() to parse + `yyyymmddhhmmss' strings, since the latter technically can't + parse dates without non alphanumerics between the elements + (even though NetBSD's strptime() copes). + +Tue Jan 25 19:09:37 EST 2000 lukem + + * merge ftp from NetBSD-current (20000125): + - complete_ambiguous(): be consistent about completing + unambiguous matches; if the word is already complete then + return CC_REFRESH so that the higher layer may append a + suffix if necessary. Fix from Launey Thomas + - change references from draft-ietf-ipngwg-url-literal-01.txt + to RFC2732 + - work around bug in apache 1.3.9 which incorrectly puts a + trailing space after the chunksize. noted by Jun-ichiro + itojun Hagino in [bin/9096] + - work around lame ftpd's that don't return a correct post-Y2K + date in the output of `MDTM'. obviously the programmer of + aforementioned lame ftpd's did something like + "19%02d", tm->tm_year + instead of + "%04d", tm->tm_year + TM_YEAR_BASE + fixes [bin/9289] by jbernard@mines.edu + + * merge libedit from NetBSD-current (20000125): + - PR/9244: Kevin Schoedel: libedit dumps bindings + inconsistently + - PR/9243: Kevin Schoedel: libedit ignores repeat count + - Add support for automatic and magic margins (from tcsh) + This makes the rightmost column usable on all programs + that use editline. + +Tue Dec 21 08:59:22 EST 1999 lukem + + * update INSTALL notes for some systems + + * if sl_init() exists, check return value of sl_add() is int and + compile in a replacement copy if it's not the case + + * don't look for - always use local prototypes; older + NetBSD systems may have conflicting prototypes + +Mon Dec 20 11:21:28 EST 1999 lukem + + * merge ftp from NetBSD-current (19991220): + - Move version from ftp_var.h to version.h + - Fix chunked support; probably broke after rate limiting was added. + Problem noticed/debugging assisted by giles lean + . + - remove unnecessary freeaddrinfo(res), since res0 was changed to be + freed earlier in itojun's last commit. fixes [bin/8948]. + - remove `const char *reason'; it was being assigned but not used. + - fix memory leak in fetch_url (no freeaddrinfo was there). + sync with recent KAME. + - separate out the main `data pump' loop into two: one that supports + rate limiting and one that doesn't. simplifies the code, and speeds + up the latter case a bit, at the expense of duplicating a few + lines... + +Sun Nov 28 18:20:41 EST 1999 lukem + + * merge ftp from NetBSD-current (19991128): + - implement xsl_init() and xsl_add(); error checking forms of + sl_{init,add}() + - fix bug where the second press of on an empty word (i.e, list + all options) may have resulted in an strncmp() against NULL. + (detected by _DIAGASSERT()) + - in cleanuppeer(), reset username to NULL after free()ing it. + fixes [bin/8870] by Wolfgang Rupprecht + - complete_remote(): use remglob("", ...) instead of remglob(".", ...), + for listings of the current working directory; some ftp servers don't + like `NLST .'. + [noted by Giles Lean ] + - recvrequest(): treat remote=="" as remote==NULL when calling + command(). (to support the above change) + - support `[user@]' in `[user@]host' and `[user@]host[:][path]'. + [based on idea (and initial code) from David Maxwell ] + - `idle' may be invoked without any args + - reformat some comments + - reformat usage string in program and man page + - call updateremotepwd() after successful login, not after successful + connect + - always call setsockopt(, IPPROTO_IP, IP_TOS, ) (et al); using #if + defined(IPPROTO_IP) doesn't work on certain foreign systems where + enums instead of #defines are used... + [noted by Matthias Pfaller ] + +Mon Nov 15 23:01:58 EST 1999 lukem + + * released lukemftp 1.1 + +Mon Nov 15 09:07:01 EST 1999 lukem + + * merge libedit from NetBSD-current (19991115): + - instead of using a private coord_t global variable to store + the size of the rprompt, use the previously unused coord_t + el->el_rprompt.p_pos + +Sat Nov 13 14:42:22 EST 1999 lukem + + * support caching of results in AC_MSG_TRY_{COMPILE,LINK} + autoconf tests + + * add NEWS file + + * clarify copyright statement in COPYING + + * merge ftp from NetBSD-current (19991113): + - implement `set rprompt'; right side version of `set prompt'. + depends on EL_RPROMPT support i added to editline(3). + - allow $FTPPROMPT and $FTPRPROMPT to override defaults for + the relevant prompts + - move `%' formatting code from prompt() to expandbuf(). + - implement `%.' and `%c', similar to the same % codes in + tcsh(1) (functionality I added to tcsh nearly 6 years ago), + except that `%.' always does `...trailing' and `%c' always + does `/trailing'. + - unknown `%foo' codes get printed as `%foo' + - implement updateremotepwd(); update the global variable + `remotepwd' to contain the remote working directory. + - add `set prompt', a user configurable prompt. (defaults to + `ftp> '). the following escape characters a la tcsh(1) are + supported: %/, %m, %M, and %n. + - add global var `username'; used by prompt code + - fix a couple of minor memory leaks + - bump version + - prevent minor memory leak (unnecessary strdup) + - implement restarting file:/// non-proxied http:// URLs + (with -R). + - fix a semicolono which stopped file:/// from working + - split the version string into product and version + - be consistent about reporting the version between: + + status command + + about:version URL fetch + + User-agent sent in http requests + - hookup(): when using getservbyname() (when getaddrinfo() + isn't available), if the provided port is a valid number + use that rather than trying to do getservbyname() against + it. fixes a problem on foreign systems noted by Chuck + Silvers + - support `about:version'. also display the version in the + output of `status'. + + * merge libedit from NetBSD-current (19991113): + - implement printing a right-side prompt. code derived from + similar work I wrote for tcsh(1) three years ago. + - implement EL_RPROMPT, which allows a setting/getting of a + function which returns a string to be used as the + right-side prompt. + + * replace manually managed config.h.in with acconfig.h and use + autoheader to generate the former. + + * add missing entry for `#undef write' in acconfig.h (for SOCKS) + + * configure.in: + - use `LL' suffix on long long constant used to test + snprintf("%lld") + - test for EL_RPROMPT instead of EL_EDITMODE, since the + former is is a newer required feature + + * in makelist, set LC_ALL="C", in case the locale confuses awk. + problem noted by Peter Seebach + +Wed Oct 27 07:00:00 UTC 1999 lukem + + * released 1.0 + + * removed libedit/TEST/test.c; no need to distribute it + +Mon Oct 25 21:59:54 EST 1999 lukem + + * released 1.0b7 + + * put VERSION string into lukemftp.h, and display with the `status' + command + +Mon Oct 25 11:36:59 EST 1999 lukem + + * merge ftp from NetBSD-current (19991025): + - fix up confirm() (broke `a' and `p' in last commit) + - simplify main loop (don't need `top' variable any more) + - use a struct sockaddr_in6.sin6_addr for the result from inet_pton(), + rather than u_char buf[16] + - add a few more comments + + new features: + - add `usage'; displays the usage of a command. + implemented by calling the c_handler() with argc = 0, argv = + "funcname". + - add `passive auto'; does the same as $FTPMODE=auto. + - add `set [option value]'; display all options, or set an option to + a value. + - add `unset option'; unset an option. + - add getoptionvalue() to retrieve an option's value, and replace a few + global variables with calls to this. + - implement cleanuppeer(), which resets various bits of state back to + `disconnected'. call in disconnect() and lostpeer(). + - support completing on `options'. + - improve recovery after a SIGINT may have closed the connection. + XXX: there's still a couple to fix + + other stuff: + - various consistency fixes in the man page. + - ensure that the command usage strings in the code and man page + match reality. + - mput/mget: check that the connection still exists before each xfer. + - minor cosmetic changes in confirm(). + - set code correctly in sizecmd() and modtime() + - don't need \n in err() strings. + - change lostpeer to take an argument (rather than casting + (sig_t)lostpeer in signal handlers) + - knf and whitespace police. + +Sun Oct 24 17:02:59 EST 1999 lukem + + * merge libedit from NetBSD-current (19991024): + - don't assume locales are not working - it may not be + the case + - re_refresh(): cast the character passed to re_addc() to + unsigned char, so we don't end up calling isprint() with + negative value when chars are signed and character value + is >= 128 + - Fix pointer arithmatic (caused problems on LP64, including + ftp dumping core when `edit' was turned off then on). + Problem solved by David Huggins-Daines + +Tue Oct 12 18:05:21 EST 1999 lukem + + * install man page from ${srcdir} not from . + +Tue Oct 12 17:00:41 EST 1999 lukem + + * released 1.0b6 + + * merge from NetBSD-current (19991012): + a few user interface and cosmetic tweaks: + - confirm(): move from util.c to cmds.c. display mnemonic + string in its prompt. add support for `q' (terminate + current xfer), `?' (show help list) + - in various signal handlers, output a linefeed only if + fromatty. + - if fgets(stdin) returned NULL (i.e, EOF), clearerr(stdin) + because you don't want future fgets to fail. this is not + done for the fgets() in the main command loop, since ftp + will quit at that point. + - unless ftp is invoked with -a, don't retain the anonftp + setting between hosts (`ftp somehost:' sets anonftp, but + you don't want that to `stick' if you close that connection + and open a new one). + +Mon Oct 11 23:06:38 EST 1999 lukem + + * check for working const + + * reorganise addition of -lukem to LIBS (was being added twice) + + * merge from netbsd-current: + - use sigjmp_buf instead of jmp_buf for sigsetjmp() buffer + + * libedit: don't bother generating & compiling editline.c, since + its component parts are compiled anyway. + +Sun Oct 10 12:08:39 EST 1999 lukem + + * released 1.0b5 + + * in libedit, use xsignal_restart() (from src/util.c) instead of + signal(); the isn't guaranteed to work on some foreign systems + (e.g, IRIX) if sigaction() is used in the same program. + + * merge from netbsd-current: + - use sigsetjmp()/siglongjump() instead of setjmp()/longjmp(); + the latter don't save the signal mask on some foreign systems. + - ensure signal handlers don't use stdio and do reset errno + if they don't exit with siglongjmp() + - use a common SIGINT handler for {send,recv}request() + - allow a second SIGINT during the "xfer aborted. waiting for + remote to finish abort." stage. if this occurs, just call + lostpeer() to close the connection. whilst this might be + considered brutal, it's also extremely handy if you're + impatient or there's lossage at the remote end. + + * add preformatted manual page + + * fix --enable-editline + +Wed Oct 6 10:19:00 EST 1999 lukem + + * released 1.0b4 + + * don't defining SIGINFO to SIGQUIT if the former doesn't exist; the + code now supports both as a method of getting the transfer stats + + * rototill signal handling in the actual data xfer routines, and + specifically set SIGQUIT to psummary in each one, to override + editline's handler + +Tue Oct 5 23:48:29 EST 1999 lukem + + * factor out SIGINFO setting into a handler that is always active + (but only prints out info if bytes > 0). only set the handler if + SIGINFO is defined + + * hijack SIGQUIT to be the same as SIGINFO *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 17:02:42 2011 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 BADBF106566B; Sun, 19 Jun 2011 17:02:42 +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 9273A8FC0C; Sun, 19 Jun 2011 17: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 p5JH2gDn002238; Sun, 19 Jun 2011 17:02:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JH2gHd002237; Sun, 19 Jun 2011 17:02:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191702.p5JH2gHd002237@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 17: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: r223301 - head/contrib/lukemftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 17:02:42 -0000 Author: gavin Date: Sun Jun 19 17:02:42 2011 New Revision: 223301 URL: http://svn.freebsd.org/changeset/base/223301 Log: Bootstrap mergeinfo Modified: Directory Properties: head/contrib/lukemftp/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 17:07:59 2011 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 46DFE1065670; Sun, 19 Jun 2011 17:07:59 +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 37A3A8FC0A; Sun, 19 Jun 2011 17:07: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 p5JH7xtt002423; Sun, 19 Jun 2011 17:07:59 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JH7xfO002422; Sun, 19 Jun 2011 17:07:59 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201106191707.p5JH7xfO002422@svn.freebsd.org> From: Steve Kargl Date: Sun, 19 Jun 2011 17:07: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: r223302 - 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: Sun, 19 Jun 2011 17:07:59 -0000 Author: kargl Date: Sun Jun 19 17:07:58 2011 New Revision: 223302 URL: http://svn.freebsd.org/changeset/base/223302 Log: In the libm access macros for the double type, z can sometimes be used uninitialized. This can lead to spurious exceptions and bit clobbering. Submitted by: bde Approved by: das (mentor) Modified: head/lib/msun/src/e_rem_pio2.c Modified: head/lib/msun/src/e_rem_pio2.c ============================================================================== --- head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:02:42 2011 (r223301) +++ head/lib/msun/src/e_rem_pio2.c Sun Jun 19 17:07:58 2011 (r223302) @@ -171,9 +171,8 @@ medium: } /* set z = scalbn(|x|,ilogb(x)-23) */ GET_LOW_WORD(low,x); - SET_LOW_WORD(z,low); e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ - SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20))); + INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low); for(i=0;i<2;i++) { tx[i] = (double)((int32_t)(z)); z = (z-tx[i])*two24; From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 17:14:41 2011 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 9ACB9106564A; Sun, 19 Jun 2011 17:14:41 +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 724E48FC12; Sun, 19 Jun 2011 17:14: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 p5JHEfrH002661; Sun, 19 Jun 2011 17:14:41 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JHEfHf002660; Sun, 19 Jun 2011 17:14:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191714.p5JHEfHf002660@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 17:14:41 +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: r223303 - vendor/tnftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 17:14:41 -0000 Author: gavin Date: Sun Jun 19 17:14:41 2011 New Revision: 223303 URL: http://svn.freebsd.org/changeset/base/223303 Log: lukemftp was renamed tnftp back in 2003, copy the vendor area to match. Added: vendor/tnftp/ - copied from r223302, vendor/lukemftp/ From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 17:36:02 2011 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 D7E44106564A; Sun, 19 Jun 2011 17:36:02 +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 C491F8FC15; Sun, 19 Jun 2011 17:36: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 p5JHa2JC003332; Sun, 19 Jun 2011 17:36:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JHa2XP003327; Sun, 19 Jun 2011 17:36:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191736.p5JHa2XP003327@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 17:36:02 +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: r223304 - in vendor/tnftp/dist: . buildaux libedit libedit/readline libnetbsd 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: Sun, 19 Jun 2011 17:36:02 -0000 Author: gavin Date: Sun Jun 19 17:36:02 2011 New Revision: 223304 URL: http://svn.freebsd.org/changeset/base/223304 Log: Vendor import of tnftp-20100108. Added: vendor/tnftp/dist/Makefile.am (contents, props changed) vendor/tnftp/dist/buildaux/ vendor/tnftp/dist/buildaux/config.guess (contents, props changed) vendor/tnftp/dist/buildaux/config.sub (contents, props changed) vendor/tnftp/dist/buildaux/depcomp (contents, props changed) vendor/tnftp/dist/buildaux/install-sh (contents, props changed) vendor/tnftp/dist/buildaux/ltmain.sh (contents, props changed) vendor/tnftp/dist/buildaux/missing (contents, props changed) vendor/tnftp/dist/configure.ac (contents, props changed) vendor/tnftp/dist/libedit/ vendor/tnftp/dist/libedit/Makefile.am (contents, props changed) vendor/tnftp/dist/libedit/Makefile.in (contents, props changed) vendor/tnftp/dist/libedit/chared.c (contents, props changed) vendor/tnftp/dist/libedit/chared.h (contents, props changed) vendor/tnftp/dist/libedit/common.c (contents, props changed) vendor/tnftp/dist/libedit/editline.3 (contents, props changed) vendor/tnftp/dist/libedit/editrc.5 (contents, props changed) vendor/tnftp/dist/libedit/el.c (contents, props changed) vendor/tnftp/dist/libedit/el.h (contents, props changed) vendor/tnftp/dist/libedit/emacs.c (contents, props changed) vendor/tnftp/dist/libedit/filecomplete.c (contents, props changed) vendor/tnftp/dist/libedit/filecomplete.h (contents, props changed) vendor/tnftp/dist/libedit/hist.c (contents, props changed) vendor/tnftp/dist/libedit/hist.h (contents, props changed) vendor/tnftp/dist/libedit/histedit.h (contents, props changed) vendor/tnftp/dist/libedit/history.c (contents, props changed) vendor/tnftp/dist/libedit/key.c (contents, props changed) vendor/tnftp/dist/libedit/key.h (contents, props changed) vendor/tnftp/dist/libedit/makelist.in (contents, props changed) vendor/tnftp/dist/libedit/map.c (contents, props changed) vendor/tnftp/dist/libedit/map.h (contents, props changed) vendor/tnftp/dist/libedit/parse.c (contents, props changed) vendor/tnftp/dist/libedit/parse.h (contents, props changed) vendor/tnftp/dist/libedit/prompt.c (contents, props changed) vendor/tnftp/dist/libedit/prompt.h (contents, props changed) vendor/tnftp/dist/libedit/read.c (contents, props changed) vendor/tnftp/dist/libedit/read.h (contents, props changed) vendor/tnftp/dist/libedit/readline/ vendor/tnftp/dist/libedit/readline.c (contents, props changed) vendor/tnftp/dist/libedit/readline/readline.h (contents, props changed) vendor/tnftp/dist/libedit/refresh.c (contents, props changed) vendor/tnftp/dist/libedit/refresh.h (contents, props changed) vendor/tnftp/dist/libedit/search.c (contents, props changed) vendor/tnftp/dist/libedit/search.h (contents, props changed) vendor/tnftp/dist/libedit/sig.c (contents, props changed) vendor/tnftp/dist/libedit/sig.h (contents, props changed) vendor/tnftp/dist/libedit/sys.h (contents, props changed) vendor/tnftp/dist/libedit/term.c (contents, props changed) vendor/tnftp/dist/libedit/term.h (contents, props changed) vendor/tnftp/dist/libedit/tokenizer.c (contents, props changed) vendor/tnftp/dist/libedit/tty.c (contents, props changed) vendor/tnftp/dist/libedit/tty.h (contents, props changed) vendor/tnftp/dist/libedit/vi.c (contents, props changed) vendor/tnftp/dist/libnetbsd/ vendor/tnftp/dist/libnetbsd/Makefile.am (contents, props changed) vendor/tnftp/dist/libnetbsd/Makefile.in (contents, props changed) vendor/tnftp/dist/libnetbsd/dirname.c (contents, props changed) vendor/tnftp/dist/libnetbsd/err.c (contents, props changed) vendor/tnftp/dist/libnetbsd/fgetln.c (contents, props changed) vendor/tnftp/dist/libnetbsd/fseeko.c (contents, props changed) vendor/tnftp/dist/libnetbsd/ftpglob.h (contents, props changed) vendor/tnftp/dist/libnetbsd/ftpvis.h (contents, props changed) vendor/tnftp/dist/libnetbsd/getaddrinfo.c (contents, props changed) vendor/tnftp/dist/libnetbsd/getnameinfo.c (contents, props changed) vendor/tnftp/dist/libnetbsd/glob.c (contents, props changed) vendor/tnftp/dist/libnetbsd/inet_ntop.c (contents, props changed) vendor/tnftp/dist/libnetbsd/inet_pton.c (contents, props changed) vendor/tnftp/dist/libnetbsd/mkstemp.c (contents, props changed) vendor/tnftp/dist/libnetbsd/setprogname.c (contents, props changed) vendor/tnftp/dist/libnetbsd/sl_init.c (contents, props changed) vendor/tnftp/dist/libnetbsd/snprintf.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strdup.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strerror.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strlcat.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strlcpy.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strptime.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strsep.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strtoll.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strunvis.c (contents, props changed) vendor/tnftp/dist/libnetbsd/strvis.c (contents, props changed) vendor/tnftp/dist/libnetbsd/timegm.c (contents, props changed) vendor/tnftp/dist/libnetbsd/usleep.c (contents, props changed) vendor/tnftp/dist/libnetbsd/utimes.c (contents, props changed) vendor/tnftp/dist/src/Makefile.am (contents, props changed) vendor/tnftp/dist/tnftp.h (contents, props changed) vendor/tnftp/dist/tnftp_config.h.in (contents, props changed) Deleted: vendor/tnftp/dist/FreeBSD-patchset vendor/tnftp/dist/acconfig.h vendor/tnftp/dist/config.h.in vendor/tnftp/dist/configure.in vendor/tnftp/dist/diffout vendor/tnftp/dist/install-sh vendor/tnftp/dist/lukemftp.h vendor/tnftp/dist/src/Makefile vendor/tnftp/dist/src/ftp.cat1 Modified: vendor/tnftp/dist/COPYING (contents, props changed) vendor/tnftp/dist/ChangeLog (contents, props changed) vendor/tnftp/dist/INSTALL (contents, props changed) vendor/tnftp/dist/Makefile.in (contents, props changed) vendor/tnftp/dist/NEWS (contents, props changed) vendor/tnftp/dist/README (contents, props changed) vendor/tnftp/dist/THANKS (contents, props changed) vendor/tnftp/dist/aclocal.m4 (contents, props changed) vendor/tnftp/dist/configure (contents, props changed) vendor/tnftp/dist/src/Makefile.in (contents, props changed) vendor/tnftp/dist/src/cmds.c (contents, props changed) vendor/tnftp/dist/src/cmdtab.c (contents, props changed) vendor/tnftp/dist/src/complete.c (contents, props changed) vendor/tnftp/dist/src/domacro.c (contents, props changed) vendor/tnftp/dist/src/extern.h (contents, props changed) vendor/tnftp/dist/src/fetch.c (contents, props changed) vendor/tnftp/dist/src/ftp.1 (contents, props changed) vendor/tnftp/dist/src/ftp.c (contents, props changed) vendor/tnftp/dist/src/ftp_var.h (contents, props changed) vendor/tnftp/dist/src/main.c (contents, props changed) vendor/tnftp/dist/src/progressbar.c (contents, props changed) vendor/tnftp/dist/src/progressbar.h (contents, props changed) vendor/tnftp/dist/src/ruserpass.c (contents, props changed) vendor/tnftp/dist/src/util.c (contents, props changed) vendor/tnftp/dist/src/version.h (contents, props changed) vendor/tnftp/dist/todo (contents, props changed) Modified: vendor/tnftp/dist/COPYING ============================================================================== --- vendor/tnftp/dist/COPYING Sun Jun 19 17:14:41 2011 (r223303) +++ vendor/tnftp/dist/COPYING Sun Jun 19 17:36:02 2011 (r223304) @@ -1,4 +1,10 @@ -Copyright 1999, 2000 Luke Mewburn . All rights reserved. +$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $ + +Copyright (c) 2001-2010 The NetBSD Foundation, Inc. +All rights reserved. + +This code is derived from software contributed to The NetBSD Foundation +by Simon Burge, Luke Mewburn, and Christos Zoulas. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -10,20 +16,24 @@ are met: 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 Luke Mewburn. -4. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -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. + This product includes software developed by the NetBSD + Foundation, Inc. and its contributors. +4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + This product also contains software developed by other people, and you are advised to read the various source files to read the full details @@ -32,11 +42,13 @@ acknowledgements: This product includes software developed by the NetBSD Foundation, Inc. and its contributors. Those contributors include: + - Simon Burge - Jaromir Dolecek - Klaus Klein - Luke Mewburn - Jason R. Thorpe of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. + - Christos Zoulas This product includes software developed by the University of California, Berkeley and its contributors. Those contributors include: Modified: vendor/tnftp/dist/ChangeLog ============================================================================== --- vendor/tnftp/dist/ChangeLog Sun Jun 19 17:14:41 2011 (r223303) +++ vendor/tnftp/dist/ChangeLog Sun Jun 19 17:36:02 2011 (r223304) @@ -1,3 +1,713 @@ +$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $ + +Tue Jan 12 06:58:15 UTC 2010 lukem + + * Release as "tnftp 20100108" + + * Rename onoff() argument "bool" to "val". + +Tue Jan 5 09:12:01 UTC 2010 lukem + + * If ARG_MAX isn't defined, use the result from sysconf(_SC_ARG_MAX). + Fixes build when using newer glibc. + + * Add libnetbsd.la to the LIBADD for libedit. + Fix provided by Adam Sampson. + +Mon Jan 4 06:28:07 UTC 2010 lukem + + * Distribute various files not shipped by default automake rules, + to use 'make dist' instead of 'cvs export'. + +Wed Dec 30 00:12:47 UTC 2009 lukem + + * Release as "tnftp 20091122" + +Sun Nov 15 10:14:44 UTC 2009 lukem + + * Merge NetBSD ftp from 20090520 to 20090915. Change: + - Rename internal getline() to get_line() to avoid + conflict with libc with former. + - Avoid a NULL dereference in an error message. + +Sat Nov 14 09:21:19 UTC 2009 lukem + + * Convert to automake & libtool. + +Sat Jun 6 07:17:38 UTC 2009 lukem + + * Release as "tnftp 20090606" + +Fri May 22 01:11:15 UTC 2009 lukem + + * configure fixes: + - Add the time.h headers to accheck_includes, for the strptime check. + - Remove the check for el_init in libedit; we're always replacing + the library and the presence of strvis() in some versions + confuses other checks. + +Wed May 20 13:47:43 UTC 2009 lukem + + * Release as "tnftp 20090520" + + * Merge NetBSD ftp from 20070722 to 20090520. Changes: + - Only attempt to el_parse() a command unknown by the default + parser if editing is enabled. + Fixes PR 38589. + - Turn off the alarmtimer before resetting the SIGALRM handler + back to SIG_DFL. + Fixes PR 35630. + - Add epsv6 and epsv to disable extended passive mode for ipv6 or + both ipv4 and ipv6 respectively. This hack is due to our + friends a Juniper Networks who break epsv in ipv6. + Should be fixed in ScreenOS 6.2.X. + - Improve parsing of chunked transfer chunks per RFC2616: + - more stringent chunk-size parsing + - ignore optional trailing ';chunk-ext' stuff, instead of barfing + - detect EOF before final \r\n. + - Use the service name to getaddrinfo() (along with the host + name), so that features such as DNS Service Discovery have a + better chance of working. + Display the service name in various status & error messages. + - Don't getservbyname() the :port component of a URL; RFC 3986 + says it's just an unsigned number, not a service name. + - Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare). + - Fix -Wshadow issues + - Update copyrights + - Remove clause 3 and 4 from TNF licenses + - Rename HAVE_STRUCT_SOCKADDR_SA_LEN to + HAVE_STRUCT_SOCKADDR_IN_SIN_LEN to accurately reflect the + structure member being used. + - Use AF_INET instead of AF_UNSPEC as the default family if + !defined(INET6). + + * configure improvements: + - Style tweaks. + - Use AC_LANG_PROGRAM() instead of AC_LANG_SOURCE() + - Add a check for strptime() requiring separators between + conversions, and use our replacement one if it does. + +Sat Dec 20 15:28:24 UTC 2008 lukem + + * configure improvements: + - Move IPv6 check from tnftp.h to configure.ac (as per tnftpd). + - Rework option descriptions. + - Highlight when tests are for a specific option. + - Move configuration results to the end of the file. + - Display $prefix in configure results. + +Fri Aug 15 03:03:36 UTC 2008 lukem + + * Add a "Configuration results" display at the end of configure. + Cosmetic tweaks. + +Fri Feb 29 09:45:56 UTC 2008 lukem + + * Support @EXEEXT@ for Cygwin (etc). + +Mon Aug 6 04:55:19 UTC 2007 lukem + + * Release as "tnftp 20070806" + + * Add a NEWS file. + + * Reduce differences between NetBSD-ftp and local copy. + + * Merge NetBSD ftp from 20070605 to 20070722. + Changes: + - Document about:ftp and about:version. + + * Add autoconf check for (Dante) SOCKS5. + (Needs run-time testing and more portability testing.) + +Mon Jul 23 11:44:42 UTC 2007 lukem + + * Don't use non-standard: u_char u_short u_int. + Use uint32_t instead of u_int32_t. + + * Consistently use AS_CASE() and AS_IF() in configure.ac. + + * Don't use defined() with HAVE_DECL_xxx. + Use `LL' instead of `L' suffix for fallback + defines of LLONG_MIN and LLONG_MAX. + +Sun Jul 22 12:00:17 UTC 2007 lukem + + * Include if available, and provide fallback #defines. + + * Sync with lib/libc/inet/inet_pton.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Fix some lint + + * Sync with lib/libc/inet/inet_ntop.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Use socklen_t instead of size_t + * Use snprintf() instead of SPRINTF() + * Improve detection of various boundary conditions + + * Sync to NetBSD glob.h 1.21, glob.c 1.16: + * Standards compliance fix + * De-lint + * Don't overflow when DEBUG is defined. + + * Sync fgetln.c to tools/compat/fgetln.c 1.7: + * Clause 3 removal. + + * Sync to config.guess 2007-07-22, config.sub 2007-06-28. + + * Consistency tweaks in configure help strings. + + * Add check for struct sockaddr.sa_len. + Change tests for HAVE_foo to defined(HAVE_foo). + Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN. + + * Remove pretence of supporting SOCKS for now; + no test system is available, and the old + autoconf 2.13 support wasn't upgraded to 2.61. + + * configure.ac style consistency tweaks. + Move autoconf aux files from ./ to build-aux/ + + * Remove duplicate HAVE_STRERROR replacement in tnftp.h. + +Thu Jun 7 04:47:47 UTC 2007 lukem + + * Merge NetBSD ftp from 20070510 to 20070605. Changes: + - Enforce restriction that (http) proxied URL fetchs don't + support being restarted at this time. + Addresses NetBSD Problem Report 28697. + - Display times in RFC2822 form rather than using ctime(3), + since the former is more explicit about the timezone offset. + - main: call tzset() to ensure TZ is setup for other + functions. + - remotemodtime(): use strptime() to parse the reply. + - fetch_url(): ensure struct tm is zeroed before calling + strptime(). + - Modify parse_url() to consistently strip the leading `/' + off ftp URLs. + Fixes NetBSD Problem Report 17617. + - Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be + consistent with the style in the RFC index. + - Refer to RFC3916 instead of 1738 or 2732. + - Expand the list of supported RFCs in ftp(1) to contain the + document name as well. + +Fri May 11 04:39:55 UTC 2007 lukem + + * Update INSTALL and COPYING. + + * Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only + require support for 'long long' in that check rather than + needing sizeof(off_t)>=8, as some systems have a separate + off64_t when Large File Support is enabled. + + * config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*' + +Thu May 10 15:23:33 UTC 2007 lukem + + * Remove checks for util.h and libutil.h, and replacement for + fparseln(), since fparseln() isn't used any more. + + * Merge NetBSD ftp from 20070418 to 20070510. Changes: + - Switch from fparseln() to the internal getline() when + parsing HTTP headers. Makes ftp a bit more portable + (not needing fparseln()) at the expense of not supporting + arbitrary long header lines, which I'm not concerned about + because we don't support header line continuation either... + - Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. + - Fix misplaced const. + - Implement copy_bytes() to copy bytes from one fd to another + via the provided buffer, with optional rate-limiting and + hash-mark printing, using one loop and handle short writes. + Refactor sendrequest() and recvrequest() to use copy_data(). + Addresses NetBSD Problem Report 15943. + +Wed May 9 05:24:55 UTC 2007 lukem + + * Fix typo in poll()-based implementation of usleep() replacement. + +Wed May 9 04:58:50 UTC 2007 lukem + + * Rename configure.in to configure.ac, as the latter is the + preferred name in autoconf 2.61. + + * Convert from autoconf 2.13 to 2.61: + * Use a consistent quoting mechanism. + * Use modern autoconf macros, #define names, etc. + * Search for more header files, and only #include if found. + * Remove old-style config.h.in generation. + This may fix various tests on platforms such as FreeBSD and OS X. + + * Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the + linker supports it. This is needed so we use our libedit + rather than the system one. + + XXX: SOCKS support is currently disabled until I update the + autoconf support. + +Mon Apr 23 06:04:26 UTC 2007 lukem + + * Merge NetBSD ftp from 20050610 to 20070418. Changes: + - Add '-s srcaddr'. + - Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of + 10^n "KB", "MB", ... + - Recognize 307 redirect code. + - Suppress printing non-COMPLETE reply strings when EPSV/EPRT + fails and we fall-back to PASV/PORT. Should fix a problem + with the emacs ftp wrapper. + - Fix display of 'Continue with ' messages. + - Prevent segfaults in .netrc parsing. + - Flush stdout before each command; ftp as slave process on + a pipe should work. + - getpass() can return NULL in some implementations; cope. + - Support '-q quittime' when waiting for server replies. + - Various spelling & grammatical fixes in the manual. + - Plug some memory leaks. + - If a file upload (via -u) fails, return an non-zero exit + value based on the index of the file that caused the + problem (a la auto-fetch retrieval). + - Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610 + - Don't remove trailing character during auth_url() + - Fix progressbar display on narrow terminals (<43 columns) + +Fri Mar 16 06:00:14 UTC 2007 lukem + + * Change the return value of the replacement gai_strerror() + from "char *" to "const char *", to match the current + standards. + Problem noted by Thomas Klausner. + +Thu Oct 26 07:24:22 UTC 2006 lukem + + * Correctly parse "AM" and "PM" in the replacement strptime(). + Problem noted by Kathryn Hogg. + +Sat Jun 25 06:27:00 UTC 2005 lukem + + * Release as "tnftp 20050625" + + * Simplify the detection & replacement of dirname() and fparseln() + and just use AC_REPLACE_FUNCS. + (We don't care if the vendor has a working version in -lgen or -lutil + instead of -lc; they'll get our replacement version in that case). + Fixes build issue on older Darwin where the previous autoconf check + wouldn't find dirname() in the default system libraries. + + * Only provide a prototype for dirname() if we can't find one in + + + * Search for NS_IN6ADDRSZ instead of IN6ADDRSZ, since we use the + former and not the latter and older Darwin has the former. + (This allows INET6 support to be enabled on Darwin 7.9.0) + +Mon Jun 13 09:22:13 UTC 2005 lukem + + * Tweak SOCKS5 support: + acconfig.h: + - fix a comment + - ensure close() is replaced + - list entries in the same order as aclocal.m4 + (and the SOCKS5 FAQ) + aclocal.m4: + - ensure getpeername() is replaced + - don't replace listen() twice + +Fri Jun 10 04:39:33 UTC 2005 lukem + + * Release as "tnftp 20050610" + + * Add dependencies on ${srcdir}/../tnftp.h and ../config.h + + * Merge NetBSD ftp from 20050609 to 20050610. Changes: + - Implement getline() to read a line into a buffer. + - Convert to use getline() instead of fgets() whenever reading + user input to ensure that an overly long input line doesn't + leave excess characters for the next input operation to + accidentally use as input. + - Zero out the password & account after we've finished with it. + - Consistently use getpass(3) (i.e, character echo suppressed) + when reading the account data. For some reason, historically + the "login" code suppressed echo for Account: yet the "user" + command did not! + - Display the hostname in the "getaddrinfo failed" warning. + - Appease some -Wcast-qual warnings. Fixing all of these + requires significant code refactoring. (mmm, legacy code). + +Thu Jun 9 16:49:05 UTC 2005 lukem + + * src, libnetbsd: Excise RCSID block, rather than using + #if 0 ... #endif. The point was to minimise RCSID + conflicts, and the latter isn't helping there. + + * Merge NetBSD ftp from 20050531 to 20050609. Changes: + - Only print the "Trying
..." message if verbose + and there's more than one struct addrinfo in the + getaddrinfo() result. + - Don't use non-standard "u_int". + +Wed Jun 1 15:08:01 UTC 2005 lukem + + * Look for dirname(3), which may be in -lgen on IRIX, and + replace it if not found.. + +Wed Jun 1 11:48:58 UTC 2005 lukem + + * libnetbsd: + - Don't use non-standard: u_char u_short u_int. + - Use uint32_t instead of u_int32_t. + - Don't use register. + + * libedit: Don't use non-standard uint or u_int. + +Tue May 31 02:23:08 UTC 2005 lukem + + * tnftp.h: need for dirname(3) + + * Merge ftp from 20050513 to 20050531. Changes: + - Helps if the definition of xconnect() matches its + declaration.... + - Fix some cast issues highlighted by Scott Reynolds using + gcc 4 on OSX.4 + - Use size_t instead of int where appropriate. + - Make this compile on sparc64 (size_t != int). + - Printf field widths and size_t don't always mix well, so + cast to int. Fixes build problem for alpha. + - Some const cleanups. + - tab cleanup + - Improve method used in fileindir() to determine if `file' + is in or under `dir': realpath(3) on non-NetBSD systems may + fail if the target filename doesn't exist, so instead use + realpath(3) on the parent directory of `file'. + Per discussion with Todd Eigenschink. + - formatbuf(): fix %m and %M to use the hostname, not the + username. + - fetch_ftp(): preserve 'anonftp' across a disconnect() so + that multiple ftp auto-fetches on the same command line + login automatically. + - auto_fetch(): use an initialized volatile int to appease + IRIX cc. + + * Merge libedit from NetBSD 20050105 to 20050531. Changes include: + - Rui Paulo: Incorrect tok_line and tok_str declarations. + - Remove clause 3 from the UCB license. + - Luke Mewburn: Don't abuse unconstify'ing a string + and writing to it, because you'll core dump. Also remove + extra const that gives pain to the irix compiler. + - Make sure we flush after we prepare when we are unbuffered + otherwise the prompt will not appear immediately. + - Terminate the arglist with a NULL instead of 0. + (Shuts up gcc4.x) + +Sat May 28 13:19:38 UTC 2005 lukem + + * libnetbsd/strvis.c: + - Sync to NetBSD's vis.c 1.33: + Use malloc(3) instead of alloca(3). + - Remove extraenous #endif + +Fri May 27 05:46:58 UTC 2005 lukem + + * libnetbsd/strvis.c: Sync to NetBSD's vis.c 1.30: + Use a more standard TNF license. + + * libedit/sig.c: Include "src/progressbar.h" for xsignal_restart() + prototype. + + * Ensure that fallback #define of __attribute__ is available. + Fixes build problem on HP-UX with cc. + +Thu May 26 14:21:08 UTC 2005 lukem + + * Extend xpoll()'s HAVE_SELECT implementation to support POLLRDNORM, + POLLWRNORM, and POLLRDBAND - the latter using exceptfds. + Per discussion with Christos Zoulas. + +Mon May 16 13:33:27 UTC 2005 lukem + + * Pull in or if they exist even if we're + not using poll, as struct pollfd might exist in those. + Fixes build problem on OSX.3. + + * Separate CPPFLAGS from CFLAGS. + + * Sync various files in libnetbsd with the original versions + in NetBSD. Notable changes + - Convert 4 clause UCB license to 3 clause. + - Use strlcpy instead of strcpy. + - Update ISC copyright. + - Use NS_INADDRSZ, NS_IN6ADDRSZ and NS_INT16SZ instead of + equivalents without NS_ prefix. + - Use socklen_t instead of size_t where appropriate. + - Improve bounds checking. + - Don't update the size of allocated storage until + realloc succeeds. + - Fix comment about return value. + - Reverse the order of two loop invariant to make + 'strlcat(0, "foo", 0)' not get a SEGV. + - Use Todd C. Miller's latest copyright notice (more loose). + - Use "long long" instead of "quad" in various + comments & constants. + - Support VIS_HTTPSTYLE. + - Implement svis(), strsvis(), strsvisx(), strunvisx(). + + * Prefer poll over select when implementing replacement usleep(). + +Sat May 14 04:44:35 UTC 2005 lukem + + * Release "tnftp 20050514" + + * Fail if we can't find a library with tgetent (needed for libedit). + NetBSD PR pkg/28925. + * Improve quoting when using various autoconf macros. + + * Merge NetBSD-ftp 20050513: + - Correct the "optlen" argument passed to getsockopt(3) and + setsockopt(3) in various places. Fixes a problem noted by + Allen Briggs. + - Improve warning printed when connect(2) for the data + channel fails. + +Wed May 11 04:19:43 UTC 2005 lukem + + * Release "tnftp 20050511" + +Wed May 11 04:10:01 UTC 2005 lukem + + * Update the THANKS file. + + * Only use poll() to implement xpoll() if it's available, + otherwise attempt to use select() if that's available, + otherwise #error. + + * Detect if struct pollfd is available in or . + Improve consistency in use of autoconf macros. + +Wed May 11 02:42:08 UTC 2005 lukem + + * Merge NetBSD-ftp 20050511: + - Use socklen_t instead of int as the 5th argument to + getsockopt(). Improve invocation of setsockopt() and + associated failure messages. + +Wed May 11 01:46:29 UTC 2005 lukem + + * Clean up RCSID usage in vendor-derived code, restoring original + IDs where possible. + +Wed May 11 00:08:16 UTC 2005 lukem + + * Merge NetBSD-ftp 20050510: + - Prevent an overly-long input line causing a core dump when + editing is enabled. + Issue noted by Ryoji Kanai in FreeBSD Problem Report # 77158. + - Implement a timeout on the accept(2) in dataconn() and the + connect(2) in xconnect() by temporarily setting O_NONBLOCK + on the socket and using xpoll() to wait for the operation + to succeed. The timeout used is the '-q quittime' argument + (defaults to 60s for accept(2), and the system default for + connect(2)). Idea inspired by discussion with Chuck Cranor. + This may (indirectly) fix various problems with timeouts in + active mode through broken firewalls. + - Implement xpoll() as a wrapper around poll(2), to make it + easier to replace on systems without a functional poll(2). + Unconditionally use xpoll() instead of conditionally using + select(2) or poll(2). + - In fetch_url(), don't call freeaddrinfo(res0) too early, as + we use pointers to its contents later in the function. + Problem found by Onno van der Linden. + - Fix ftp url reget when globs are being used. + Provided by Mathieu Arnold . + - Factor out common string processing code eliminating static + buffers, making functions that should be static be static, + and cleaning up const usage. Added a guard against buffer + overflow, but the domap function is a bit too complicated + to tackle right now. + - Clean up whitespace. + - Expand description of http_proxy by suggesting the use of + RFC 1738 '%xx' encoding for "unsafe URL" characters in + usernames and passwords. + +Wed Jan 5 05:53:59 UTC 2005 lukem + + * For now, assume libedit is not up-to-date and use our own version. + + * Merge libedit from NetBSD 20020605 to 20050105. Changes include: + - Improve vi-mode. + - Delete-previous-char and delete-next-char without an + argument are not supposed to modify the yank buffer in + emacs-mode. + - Improve incremental searching. + - Improve memory allocation & usage. + - Move UCB-licensed code from 4-clause to 3-clause. + - Make the tokenization functions publically available. + - Various tty access bug-fixes. + - Improve readline emulation. + +Tue Jan 4 13:33:40 UTC 2005 lukem + + * Unixware 7.1.1 implements RFC 2133 (Basic Socket Interface + Extensions for IPv6) but not the successor RFC 2553. The configure + script detects this and decides that tnftp needs to compile its own + version of getaddrinfo(). This produces the error message + /usr/include/netdb.h:248: `getaddrinfo' previously defined here + because Unixware provides an implementation of getaddrinfo() in + netdb.h instead of a prototype declaration :-/. Since netdb.h + cannot be omitted, we will always get this definition and tnftp's + version of getaddrinfo will always create a conflict. This ugly + preprocessor hack works around the problem. Hints for a better + solution welcome. Fix from pkgsrc/net/tnftp. + + * Workaround poll() being a compatibility function on Darwin 7 + (MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which + is defined in poll.h on some MacOSX 10.3 systems. Not all 10.3 + systems have poll.h, so only do the poll() test if at least one + of the header files is found. Fix from pkgsrc/net/tnftp. + + * Add a utimes() replacement (using utime()) for Interix. + From pkgsrc/net/tnftp. + +Mon Jan 3 10:21:57 UTC 2005 lukem + + * Release "tnftp 20050103" + + * Merge NetBSD-ftp 20050103: + - Forbid filenames returned from mget that aren't in (or below) + the current directory. The previous behaviour (of trusting + the remote server's response when retrieving the list of + files to mget with prompting disabled) has been in ftp + ~forever, and has been a "known issue" for a long time. + Recently an advisory was published by D.J. Bernstein on + behalf of Yosef Klein warning of the problems with the + previous behaviour, so to alleviate concern I've fixed + this with a sledgehammer. + - Remember the local cwd after any operation which may + change it. + - Use "remotecwd" instead of "remotepwd". + - Add (unsigned char) cast to ctype functions + - Ensure that "mname" is set in ls() and mls() so that an + aborted confirm() prints the correct name. + Problem highlighted & suggested fix from PR [bin/17766] + by Steve McClellan. + - If an ftp auto-fetch transfer is interrupted by SIGINT + (usually ^C), exit with 130 instead of 1 (or rarely, 0). + This allows an ftp auto-fetch in a shell loop to correctly + terminate the loop. + Should fix PR [pkg/26351], and possibly others. + - Save approximately 8K by not including http authentication, + extended status messages and help strings when the + appropriate options are set. + - Move UCB-licensed code from 4-clause to 3-clause licence. + Patches provided by Joel Baker in PR 22365, verified by + Alistair Crooks. + - Always decode %xx in a url's user & pass components. + - Only remember {WWW,Proxy}-Authenticate "Basic" challenges; no + point in tracking any others since ftp doesn't support them. + - Improve the parsing of HTTP responses. + - Don't base64 encode the trailing NUL in the HTTP basic auth + response. Problem noted by Eric Haszlakiewicz. + - Improve parsing of HTTP response headers to be more RFC2616 + compliant, and skip LWS (linear white space; CR, LF, space, + tab) and the end of lines and between the field name and + the field value. This still isn't 100% compliant, since we + don't support "multi line" responses at this time. + This should fix PR [bin/22611] from TAMURA Kent (although I + can't easily find a http server to reproduce the problem + against.) + - Fix a minor memory leak when parsing HTTP response headers. + - Don't unnecessarily display a 401/407 error when running + with -V. Fix from PR [bin/18535] by Jeremy Reed. + - Don't warn about "ignored setsockopt" failures unless + debugging is enabled. Suggested by Todd Vierling. + - Allow empty passwords in ftp://user:@host/file auto-fetch + URLs, per RFC 1738. Requested by Simon Poole. + - correct URL syntax in comment + - Note potentially surprising file-saving behaviour in case + of HTTP redirects + - -n is ignored for auto-fetch transfers + - If connect(2) in xconnect() fails with EINTR, call select(2) + on the socket until it's writable or it fails with something + other than EINTR. This matches the behaviour in SUSv3, and + prevents the problem when pressing ^T (SIGINFO, which is + marked as restartable) during connection setup would cause + ftp to fail with EADDRINUSE or EALREADY when the second + connect(2) was attempted on the same socket. Problem found + and solution provided by Maxime Henrion . + - Add -q to usage. From Kouichirou Hiratsuka in PR 26199. + - PR/25566: Anders Magnusson: ftp(1) do not like large TCP + windows. Limit it to 8M. + +Mon Oct 6 01:23:03 UTC 2003 lukem + + * configure.in improvements: + - When testing for IN6ADDRSZ in , pull in + first. From Stoned Elipot + - Whitespace cleanup + +Mon Aug 25 11:45:45 UTC 2003 lukem + + * Release "tnftp 20030825" + + * Add autoconf test for ; Cygwin needs it for ARG_MAX. + Per discussion with Eugene Kotlyarov . + +Thu Jul 31 07:30:00 UTC 2003 lukem + + * release "tnftp 20030731" + + * merge ftp from NetBSD 20030731 to 20030731b: + - Work around broken ftp servers (notably ProFTPd) that can't + even follow RFC 2389, and skip any amount of whitespace + before a FEATure response. The RFC says 'single space' yet + ProFTPd puts two. Noted by DervishD . + - Improve formatting of features[] debug dump. + - Invalidate remote directory completion cache if any command + which may change the remote contents completes successfully, + including: del, mdel, ren, mkdir, rmdir, quote, and all + upload commands. Patch from Yar Tikhiy . + + * merge ftp from NetBSD 20030228 to 20030731: + - $FTPUSERAGENT overrides the HTTP User-Agent header. + Based on patch from Douwe Kiela . + - Add about:tnftp + - Fix URL in about:netbsd + - netbsd.org->NetBSD.org + - strlcpy fix in fetch.c + - Uppercase "URL" + - fix a bogus error message when given a HTTP URL with a + trailing slash + - groff fixes in man page + - tweak progressbar.c copyright; the stuff jason did in util.c + wasn't migrated to this file + - Don't coredump when printing '%n' in the prompt if there's + no username yet. + Fix from Maxim Konovalov + + * Add test for HAVE_IN6ADDRSZ (which older Darwin is lacking), + and only enable INET6 if it exists. + Patch from Amitai Schlair . + + * Improve ipv6 check for older linux systems that don't provide + sin6_scope_id. + Patch from YAMANO Yuji . + +Fri Feb 28 10:57:30 UTC 2003 lukem + + * tagged as "tnftp 2.0 beta1" + +Fri Feb 28 10:07:07 UTC 2003 lukem + + * renamed to `tnftp' (from `lukemftp') + + * renamed `libukem' to `libnetbsd' + + +Mon Jun 17 06:50:13 UTC 2002 lukem + + * #if USE_GLOB_H, use instead of "ftpglob.h". + Requested by Mike Heffner + Mon Jun 10 08:12:35 UTC 2002 lukem * crank FTP_VERSION from 1.6-beta1 to 1.6-beta2 @@ -223,7 +933,7 @@ Tue Oct 3 10:22:36 EST 2000 lukem Mon Sep 25 21:52:12 EST 2000 lukem * crank to version 1.5 beta5 - + Sun Sep 24 13:31:19 EST 2000 lukem * merge ftp from NetBSD-current (20000924) @@ -243,7 +953,7 @@ Sun Sep 24 13:31:19 EST 2000 lukem - in progressmeter() perform the check for foregroundproc() a little earlier - removed unused variable `items' in list_vertical() - + Sat Sep 23 15:43:34 EST 2000 lukem * remove unused sverrno in warnx() and errx() @@ -406,7 +1116,7 @@ Wed Aug 2 23:43:50 EST 2000 lukem * update from NetBSD-current (20000802): - rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* (unsigned) equivalents. name change suggested by Klaus - Klein + Klein - change defined(BSD4_4) || HAVE_SIN_LEN tests into HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists @@ -451,7 +1161,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - add support for FEAT and OPTS commands with `features' and `opts'. (from RFC 2389). - add support for MLST & MLSD (machine parseble listings) - with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. + with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. (from draft-ietf-ftpext-mlst-11) - rename remotesyst() to getremoteinfo(), and modify to parse the result from FEAT (if supported), and take into account @@ -473,7 +1183,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - minor knf (indent goto labels by one space, etc). - simply various command usage handlers by assuming that argv != NULL except for quit() and disconnect(). - - errx?/warnx? audit. do not pass variable alone, use %s. + - errx?/warnx? audit. do not pass variable alone, use %s. * check for issetugid() and don't use in libedit if it doesn't exist. @@ -572,12 +1282,12 @@ Sun Jun 4 18:00:07 EST 2000 lukem - do not pass scoped IPv6 address notation on Host: directive, since scope identifier is local to the originating node. do not allow scoped IPv6 address notation in URL, if it is - via proxy. + via proxy. - fixes from cgd: * sanity check a length (otherwise certain bogus responses can crash ftp) * allow a transfer encoding type of `binary'; certain - firewall vendors return this bogus type... + firewall vendors return this bogus type... - make debugging output unambiguous on IPv6 numeric addrs (don't use host:port) - http://[::1]:8080/ is legal. @@ -705,7 +1415,7 @@ Sun Nov 28 18:20:41 EST 1999 lukem - implement xsl_init() and xsl_add(); error checking forms of sl_{init,add}() - fix bug where the second press of on an empty word (i.e, list - all options) may have resulted in an strncmp() against NULL. + all options) may have resulted in an strncmp() against NULL. (detected by _DIAGASSERT()) - in cleanuppeer(), reset username to NULL after free()ing it. fixes [bin/8870] by Wolfgang Rupprecht @@ -985,7 +1695,7 @@ Mon Oct 4 10:57:41 EST 1999 lukem * Add support for --{en,dis}able-editcomplete (defaults to enabled), which prevents libedit support from being compiled in. - From Chris G. Demetriou + From Chris G. Demetriou Sun Oct 3 16:49:01 EST 1999 lukem Modified: vendor/tnftp/dist/INSTALL ============================================================================== --- vendor/tnftp/dist/INSTALL Sun Jun 19 17:14:41 2011 (r223303) +++ vendor/tnftp/dist/INSTALL Sun Jun 19 17:36:02 2011 (r223304) @@ -1,8 +1,7 @@ INSTALLATION INTRODUCTION ------------------------- -This file describes how to compile and install lukemftp on your -system. +This file describes how to compile and install tnftp on your system. ============================================ = = @@ -11,24 +10,20 @@ system. ============================================ -For most systems, execute the following to compile and install -lukemftp: +For most systems, execute the following to compile and install tnftp: ./configure make make install -A preformatted manual page (src/ftp.cat1) is also installed. If -you wish to install the source (src/ftp.1), ensure that your system -has up-to-date mandoc macros. groff ships with this macro suite, -but it has bugs. Try: - ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/tmac/ -for a more recent version. +A preformatted manual page (src/ftp.cat1) is also installed. +If you wish to install the source (src/ftp.1), ensure that your system +has up-to-date mandoc macros, such as those that are shipped with groff. CONFIGURATION OPTIONS --------------------- -lukemftp is configured using an `autoconf' generated `configure' +tnftp is configured using an `autoconf' generated `configure' script. `configure' supports the following options: * The standard `autoconf configure' options, including: @@ -41,14 +36,11 @@ script. `configure' supports the follow * Specific options: --enable-editcomplete Turn on command line editing and completion. - --disable-editcomplete Turn off command line editing and completion - [default: enabled]. - --enable-ipv6 Enable IPv6 support (if your OS supports it) - --disable-ipv6 Disable IPv6 support (even if your OS supports it.) - [default: enabled]. - --with-socks Compile with SOCKS firewall traversal support. - --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support. - --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support. + (default: enabled) + --enable-ipv6 Enable IPv6 support (if your OS supports it). + (default: enabled) + --disable-largefile omit support for large files + --with-socks enable support for (Dante) SOCKS5 proxy The following environment variables can be set to override various compiler related settings. @@ -66,146 +58,3 @@ This can be achieved with: = = ============================================ - -PLATFORM SPECIFIC NOTES ------------------------ - -The following platforms & compilers have been tested: - -- AIX 4.1.5: -- AIX 4.2.1: -- AIX 4.3.3: - - Compiler: xlc -qlanglvl=ansi - version: xlC 3.1.4.10 -- C for AIX Compiler - version: ibmcxx.cmp 3.6.6.6 -- IBM C and C++ Compilers - - Configure with: - env CC="xlc" CFLAGS="-qlanglvl=ansi" ./configure - -- BSD/OS 4.0.1 (x86) -- BSD/OS 4.1 (x86) -- BSD/OS 4.1 (sparc) -- BSD/OS 4.2 (x86) - - Compiler: /bin/cc - version: gcc 2.7.2.1 - version: gcc version 2.95.2 19991024 - -- Digital UNIX 4.0b -- Digital UNIX 4.0d -- Digital UNIX 4.0f - - Compiler: cc -std - version: DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) - version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229) - - Configure with - env CC="cc -std" ./configure - - - Compiler: gcc - version: 2.95.1 - -- Digital UNIX 5.0 - - Compiler: cc - version: Compaq C V6.1-011 on Digital UNIX V5.0 (Rev. 910) - -- FreeBSD 3.4 (i386): -- FreeBSD 3.5 (i386): -- FreeBSD 4.1 (i386): - - Compiler: cc - version: gcc version 2.7.2.3 - version: gcc version 2.95.2 19991024 - -- HP/UX 10.20: -- HP/UX 11.00: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.10.32.03 - - Configure with - env CC="cc -Ae" ./configure - - To generate code that will run on old architectures you - may need to add "+DAportable" to CC. - - -- IRIX 6.5.4 -- IRIX 6.5.8 - Compiler: /bin/cc - version: MIPSpro Compilers: Version 7.2.1 - Compiler: - version: gcc version 2.95.2 - -- HP/UX 11.00: -- HP/UX 11.00 64 bit: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.11.01.00 - - Configure with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 17:37:02 2011 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 CD90C1065670; Sun, 19 Jun 2011 17:37:02 +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 A4CE58FC1F; Sun, 19 Jun 2011 17:37: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 p5JHb216003401; Sun, 19 Jun 2011 17:37:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JHb2hK003400; Sun, 19 Jun 2011 17:37:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106191737.p5JHb2hK003400@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 17:37:02 +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: r223305 - vendor/tnftp/20100108 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 17:37:02 -0000 Author: gavin Date: Sun Jun 19 17:37:02 2011 New Revision: 223305 URL: http://svn.freebsd.org/changeset/base/223305 Log: Tag for tnftp-20100108. Added: vendor/tnftp/20100108/ - copied from r223304, vendor/tnftp/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 18:09:45 2011 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 52B261065670; Sun, 19 Jun 2011 18:09:45 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id CA6758FC14; Sun, 19 Jun 2011 18:09:44 +0000 (UTC) Received: by vws18 with SMTP id 18so481302vws.13 for ; Sun, 19 Jun 2011 11:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=Sgj7G3st4e0+ZeurWeU39BOrlnZ2APQh5fL0g55mPH8=; b=HNwbiUHE0GCaxrmYYJmukuhOfHZqhAJCHz5K2y/dOQWYeLbVD+cfq3+QWsLmgOmMjA s0DQe/3ehg6c3mfGupIl2CQSvmDBI4o7cfQhU0EAVFVv9XDA+y/Y8OmqY0V5TaLYwxtP JQVuPLL8t9y/cp8jjD8IjDSpLvgn5sASu4hW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=ZdwE/L0mJekHmfv1diiI+c3LyY7C9b83OWSQjUypxWRZLly+Hb0WBEArhh/dJfXwWU 4RR3aKNqbJOQ9XcaDwdoJNW6BZR3/MA5cHrJSP8ie7toWL4u4g2HT0Ea2q3YdNvnWm8N 6n3qCVt/GhEgJ8k56cKGsP4H8CDv8iG9rIcJM= Received: by 10.52.94.50 with SMTP id cz18mr2357033vdb.299.1308506983776; Sun, 19 Jun 2011 11:09:43 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id l31sm263957vbr.23.2011.06.19.11.09.41 (version=SSLv3 cipher=OTHER); Sun, 19 Jun 2011 11:09:42 -0700 (PDT) Date: Sun, 19 Jun 2011 14:09:34 -0400 From: Alexander Kabaev To: Craig Rodrigues Message-ID: <20110619140934.08375095@kan.dnsalias.net> In-Reply-To: <201106152213.p5FMDMWP000491@svn.freebsd.org> References: <201106152213.p5FMDMWP000491@svn.freebsd.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ilJimhLH9t.o+OsibXxI69z"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223124 - 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: Sun, 19 Jun 2011 18:09:45 -0000 --Sig_/ilJimhLH9t.o+OsibXxI69z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 15 Jun 2011 22:13:22 +0000 (UTC) Craig Rodrigues wrote: > Author: rodrigc > Date: Wed Jun 15 22:13:22 2011 > New Revision: 223124 > URL: http://svn.freebsd.org/changeset/base/223124 >=20 > Log: > (1) When sending the TFTP RRQ packet to read a file, > send along the "blksize" option specified in RFC2348, > and the "tsize" option specified in RFC2349. > =20 > Add code to parse the TFTP Option Acknowledgement (OACK) > packet as specified in RFC2347. > =20 > For TFTP servers which support the "blksize" option, we can > specify a TFTP Data block size larger than the default 512 > bytes specified in RFC1350. This offers greater read performance when > downloading files. > =20 > We request an initial size of 1428 bytes, which is less than > the Ethernet MTU of 1500 bytes. If the TFTP server sends back an OACK > packet, then use the block size specified in the OACK packet. > Most times it is usually the same value as what we request. > If the TFTP server supports RFC2348, we will see performance > improvements by transferring files over TFTP with larger block sizes. > =20 > If we do not get back an OACK packet, then we most likely we > are interoperating with a legacy TFTP server that does not > support TFTP extension options, so default to the block size of > 512 bytes. > =20 > (2) If the "tftp.blksize" environment variable is set, then > take that value and use it when sending the TFTP RRQ packet, > instead of 1428. This allows us to set different values of > "tftp.blksize" in the loader, so that we can test out different > TFTP block sizes at run time. > =20 > Obtained from: Juniper Networks > Fixed by: rodrigc >=20 Has this code been reviewed by anyone outside of Juniper? --=20 Alexander Kabaev --Sig_/ilJimhLH9t.o+OsibXxI69z Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFN/jtkQ6z1jMm+XZYRAkPjAJwNCaXWx//1zVtErp9TxMC7JsaReACgsWda YJc3I++q8CjXfupQNUTyVNc= =kwQG -----END PGP SIGNATURE----- --Sig_/ilJimhLH9t.o+OsibXxI69z-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 18:34:49 2011 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 D7398106566B; Sun, 19 Jun 2011 18:34:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5EA98FC13; Sun, 19 Jun 2011 18:34: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 p5JIYn3I005145; Sun, 19 Jun 2011 18:34:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JIYnMh005137; Sun, 19 Jun 2011 18:34:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106191834.p5JIYnMh005137@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 19 Jun 2011 18:34: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: r223306 - in head/usr.sbin/makefs: . cd9660 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 18:34:49 -0000 Author: marcel Date: Sun Jun 19 18:34:49 2011 New Revision: 223306 URL: http://svn.freebsd.org/changeset/base/223306 Log: Add support for using mtree(5) manifest files to define the image to be created. The support is based on mtree version 2.0, as used in libarchive, but adds new features on top of it. The current implementation is fully functional, but is envisioned to grow at least the following additional features over time: o Add support for the /include special command so that manifest files can be constructed using includable fragments. o Add support specifying a search path to locate content files. o Content file filters: commands that provide file contents on stdout. The manifest file eliminates the need to first construct a tree as root in order to create an image and allows images (releases) to be created directly from object trees and/or source trees. Reviewed by: deo Sponsored by: Juniper Networks, Inc Added: head/usr.sbin/makefs/mtree.c (contents, props changed) Modified: head/usr.sbin/makefs/Makefile head/usr.sbin/makefs/cd9660/cd9660_write.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.8 head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/Makefile Sun Jun 19 18:34:49 2011 (r223306) @@ -7,6 +7,7 @@ CFLAGS+=-I${.CURDIR} SRCS= cd9660.c ffs.c \ getid.c \ makefs.c \ + mtree.c \ walk.c MAN= makefs.8 @@ -26,4 +27,7 @@ SRCS+= misc.c spec.c .PATH: ${.CURDIR}/../../sys/ufs/ffs SRCS+= ffs_tables.c +DPADD= ${LIBSBUF} +LDADD= -lsbuf + .include Modified: head/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_write.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/cd9660/cd9660_write.c Sun Jun 19 18:34:49 2011 (r223306) @@ -294,10 +294,12 @@ cd9660_write_file(FILE *fd, cd9660node * INODE_WARNX(("%s: writing inode %d blocks at %" PRIu32, __func__, (int)inode->st.st_ino, inode->ino)); inode->flags |= FI_WRITTEN; - cd9660_compute_full_filename(writenode, - temp_file_name, 0); + if (writenode->node->contents == NULL) + cd9660_compute_full_filename(writenode, + temp_file_name, 0); ret = cd9660_copy_file(fd, writenode->fileDataSector, - temp_file_name); + (writenode->node->contents != NULL) ? + writenode->node->contents : temp_file_name); if (ret == 0) goto out; } Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/ffs.c Sun Jun 19 18:34:49 2011 (r223306) @@ -776,9 +776,11 @@ ffs_populate_dir(const char *dir, fsnode continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; - if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) - >= sizeof(path)) - errx(1, "Pathname too long."); + if (cur->contents == NULL) { + if (snprintf(path, sizeof(path), "%s/%s", dir, + cur->name) >= sizeof(path)) + errx(1, "Pathname too long."); + } if (cur->child != NULL) continue; /* child creates own inode */ @@ -802,7 +804,8 @@ ffs_populate_dir(const char *dir, fsnode if (membuf != NULL) { ffs_write_file(&din, cur->inode->ino, membuf, fsopts); } else if (S_ISREG(cur->type)) { - ffs_write_file(&din, cur->inode->ino, path, fsopts); + ffs_write_file(&din, cur->inode->ino, + (cur->contents) ? cur->contents : path, fsopts); } else { assert (! S_ISDIR(cur->type)); ffs_write_inode(&din, cur->inode->ino, fsopts); Modified: head/usr.sbin/makefs/makefs.8 ============================================================================== --- head/usr.sbin/makefs/makefs.8 Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.8 Sun Jun 19 18:34:49 2011 (r223306) @@ -40,7 +40,7 @@ .Os .Sh NAME .Nm makefs -.Nd create a file system image from a directory tree +.Nd create a file system image from a directory tree or a mtree manifest .Sh SYNOPSIS .Nm .Op Fl x @@ -57,14 +57,16 @@ .Op Fl s Ar image-size .Op Fl t Ar fs-type .Ar image-file -.Ar directory +.Ar directory | manifest .Sh DESCRIPTION The utility .Nm creates a file system image into .Ar image-file from the directory tree -.Ar directory . +.Ar directory +or from the mtree manifest +.Ar manifest . No special devices or privileges are required to perform this task. .Pp The options are as follows: @@ -106,6 +108,8 @@ as an .Xr mtree 8 .Sq specfile specification. +This option has no effect when the image is created from a mtree manifest +rather than a directory. .Pp If a specfile entry exists in the underlying file system, its permissions and modification time will be used unless specifically @@ -330,6 +334,7 @@ Use RockRidge extensions (for longer fil Volume set identifier of the image. .El .Sh SEE ALSO +.Xr mtree 5 , .Xr mtree 8 , .Xr newfs 8 .Sh HISTORY Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.c Sun Jun 19 18:34:49 2011 (r223306) @@ -38,6 +38,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -80,11 +82,13 @@ int main(int, char *[]); int main(int argc, char *argv[]) { + struct stat sb; struct timeval start; fstype_t *fstype; fsinfo_t fsoptions; fsnode *root; int ch, len; + char *subtree; char *specfile; setprogname(argv[0]); @@ -244,26 +248,47 @@ main(int argc, char *argv[]) if (fsoptions.onlyspec != 0 && specfile == NULL) errx(1, "-x requires -F mtree-specfile."); - /* walk the tree */ - TIMER_START(start); - root = walk_dir(argv[1], NULL); - TIMER_RESULTS(start, "walk_dir"); + /* Accept '-' as meaning "read from standard input". */ + if (strcmp(argv[1], "-") == 0) + sb.st_mode = S_IFREG; + else { + if (stat(argv[1], &sb) == -1) + err(1, "Can't stat `%s'", argv[1]); + } + + switch (sb.st_mode & S_IFMT) { + case S_IFDIR: /* walk the tree */ + subtree = argv[1]; + TIMER_START(start); + root = walk_dir(subtree, NULL); + TIMER_RESULTS(start, "walk_dir"); + break; + case S_IFREG: /* read the manifest file */ + subtree = "."; + TIMER_START(start); + root = read_mtree(argv[1], NULL); + TIMER_RESULTS(start, "manifest"); + break; + default: + errx(1, "%s: not a file or directory", argv[1]); + /* NOTREACHED */ + } if (specfile) { /* apply a specfile */ TIMER_START(start); - apply_specfile(specfile, argv[1], root, fsoptions.onlyspec); + apply_specfile(specfile, subtree, root, fsoptions.onlyspec); TIMER_RESULTS(start, "apply_specfile"); } if (debug & DEBUG_DUMP_FSNODES) { - printf("\nparent: %s\n", argv[1]); + printf("\nparent: %s\n", subtree); dump_fsnodes(".", root); putchar('\n'); } /* build the file system */ TIMER_START(start); - fstype->make_fs(argv[0], argv[1], root, &fsoptions); + fstype->make_fs(argv[0], subtree, root, &fsoptions); TIMER_RESULTS(start, "make_fs"); free_fsnodes(root); @@ -311,7 +336,7 @@ usage(void) "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n" "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n" -"\t[-N userdb-dir] image-file directory\n", +"\t[-N userdb-dir] image-file directory | manifest\n", prog); exit(1); } Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Sun Jun 19 17:37:02 2011 (r223305) +++ head/usr.sbin/makefs/makefs.h Sun Jun 19 18:34:49 2011 (r223306) @@ -93,11 +93,13 @@ typedef struct _fsnode { uint32_t type; /* type of entry */ fsinode *inode; /* actual inode data */ char *symlink; /* symlink target */ + char *contents; /* file to provide contents */ char *name; /* file name */ int flags; /* misc flags */ } fsnode; #define FSNODE_F_HASSPEC 0x01 /* fsnode has a spec entry */ +#define FSNODE_F_OPTIONAL 0x02 /* fsnode is optional */ /* * fsinfo_t - contains various settings and parameters pertaining to @@ -147,6 +149,7 @@ typedef struct { void apply_specfile(const char *, const char *, fsnode *, int); void dump_fsnodes(const char *, fsnode *); const char * inode_type(mode_t); +fsnode * read_mtree(const char *, fsnode *); int set_option(option_t *, const char *, const char *); fsnode * walk_dir(const char *, fsnode *); void free_fsnodes(fsnode *); Added: head/usr.sbin/makefs/mtree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/makefs/mtree.c Sun Jun 19 18:34:49 2011 (r223306) @@ -0,0 +1,1051 @@ +/*- + * Copyright (c) 2011 Marcel Moolenaar + * 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(S) ``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(S) 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 +#include +#include +#include +#include +#include + +#include "makefs.h" + +#define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0') +#define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0') + +struct mtree_fileinfo { + SLIST_ENTRY(mtree_fileinfo) next; + FILE *fp; + const char *name; + u_int line; +}; + +/* Global state used while parsing. */ +static SLIST_HEAD(, mtree_fileinfo) mtree_fileinfo = + SLIST_HEAD_INITIALIZER(mtree_fileinfo); +static fsnode *mtree_root; +static fsnode *mtree_current; +static fsnode mtree_global; +static fsinode mtree_global_inode; +static u_int errors, warnings; + +static void mtree_error(const char *, ...) __printflike(1, 2); +static void mtree_warning(const char *, ...) __printflike(1, 2); + +static int +mtree_file_push(const char *name, FILE *fp) +{ + struct mtree_fileinfo *fi; + + fi = malloc(sizeof(*fi)); + if (fi == NULL) + return (ENOMEM); + + if (strcmp(name, "-") == 0) + fi->name = strdup("(stdin)"); + else + fi->name = strdup(name); + if (fi->name == NULL) { + free(fi); + return (ENOMEM); + } + + fi->fp = fp; + fi->line = 0; + + SLIST_INSERT_HEAD(&mtree_fileinfo, fi, next); + return (0); +} + +static void +mtree_print(const char *msgtype, const char *fmt, va_list ap) +{ + struct mtree_fileinfo *fi; + + if (msgtype != NULL) { + fi = SLIST_FIRST(&mtree_fileinfo); + if (fi != NULL) + fprintf(stderr, "%s:%u: ", fi->name, fi->line); + fprintf(stderr, "%s: ", msgtype); + } + vfprintf(stderr, fmt, ap); +} + +static void +mtree_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + mtree_print("error", fmt, ap); + va_end(ap); + + errors++; + fputc('\n', stderr); +} + +static void +mtree_warning(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + mtree_print("warning", fmt, ap); + va_end(ap); + + warnings++; + fputc('\n', stderr); +} + +/* mtree_resolve() sets errno to indicate why NULL was returned. */ +static char * +mtree_resolve(const char *spec, int *istemp) +{ + struct sbuf *sb; + char *res, *var; + const char *base, *p, *v; + size_t len; + int c, error, quoted, subst; + + len = strlen(spec); + if (len == 0) { + errno = EINVAL; + return (NULL); + } + + c = (len > 1) ? (spec[0] == spec[len - 1]) ? spec[0] : 0 : 0; + *istemp = (c == '`') ? 1 : 0; + subst = (c == '`' || c == '"') ? 1 : 0; + quoted = (subst || c == '\'') ? 1 : 0; + + if (!subst) { + res = strdup(spec + quoted); + if (res != NULL && quoted) + res[len - 2] = '\0'; + return (res); + } + + sb = sbuf_new_auto(); + if (sb == NULL) { + errno = ENOMEM; + return (NULL); + } + + base = spec + 1; + len -= 2; + error = 0; + while (len > 0) { + p = strchr(base, '$'); + if (p == NULL) { + sbuf_bcat(sb, base, len); + base += len; + len = 0; + continue; + } + /* The following is safe. spec always starts with a quote. */ + if (p[-1] == '\\') + p--; + if (base != p) { + sbuf_bcat(sb, base, p - base); + len -= p - base; + base = p; + } + if (*p == '\\') { + sbuf_putc(sb, '$'); + base += 2; + len -= 2; + continue; + } + /* Skip the '$'. */ + base++; + len--; + /* Handle ${X} vs $X. */ + v = base; + if (*base == '{') { + p = strchr(v, '}'); + if (p == NULL) + p = v; + } else + p = v; + len -= (p + 1) - base; + base = p + 1; + + if (v == p) { + sbuf_putc(sb, *v); + continue; + } + + error = ENOMEM; + var = calloc(p - v, 1); + if (var == NULL) + break; + + memcpy(var, v + 1, p - v - 1); + if (strcmp(var, ".CURDIR") == 0) { + res = getcwd(NULL, 0); + if (res == NULL) + break; + } else if (strcmp(var, ".PROG") == 0) { + res = strdup(getprogname()); + if (res == NULL) + break; + } else { + v = getenv(var); + if (v != NULL) { + res = strdup(v); + if (res == NULL) + break; + } else + res = NULL; + } + error = 0; + + if (res != NULL) { + sbuf_cat(sb, res); + free(res); + } + free(var); + } + + sbuf_finish(sb); + res = (error == 0) ? strdup(sbuf_data(sb)) : NULL; + sbuf_delete(sb); + if (res == NULL) + errno = ENOMEM; + return (res); +} + +static int +skip_over(FILE *fp, const char *cs) +{ + int c; + + c = getc(fp); + while (c != EOF && strchr(cs, c) != NULL) + c = getc(fp); + if (c != EOF) { + ungetc(c, fp); + return (0); + } + return (ferror(fp) ? errno : -1); +} + +static int +skip_to(FILE *fp, const char *cs) +{ + int c; + + c = getc(fp); + while (c != EOF && strchr(cs, c) == NULL) + c = getc(fp); + if (c != EOF) { + ungetc(c, fp); + return (0); + } + return (ferror(fp) ? errno : -1); +} + +static int +read_word(FILE *fp, char *buf, size_t bufsz) +{ + struct mtree_fileinfo *fi; + size_t idx, qidx; + int c, done, error, esc, qlvl; + + if (bufsz == 0) + return (EINVAL); + + done = 0; + esc = 0; + idx = 0; + qidx = -1; + qlvl = 0; + do { + c = getc(fp); + switch (c) { + case EOF: + buf[idx] = '\0'; + error = ferror(fp) ? errno : -1; + if (error == -1) + mtree_error("unexpected end of file"); + return (error); + case '\\': + esc++; + if (esc == 1) + continue; + break; + case '`': + case '\'': + case '"': + if (esc) + break; + if (qlvl == 0) { + qlvl++; + qidx = idx; + } else if (c == buf[qidx]) { + qlvl--; + if (qlvl > 0) { + do { + qidx--; + } while (buf[qidx] != '`' && + buf[qidx] != '\'' && + buf[qidx] != '"'); + } else + qidx = -1; + } else { + qlvl++; + qidx = idx; + } + break; + case ' ': + case '\t': + case '\n': + if (!esc && qlvl == 0) { + ungetc(c, fp); + c = '\0'; + done = 1; + break; + } + if (c == '\n') { + /* + * We going to eat the newline ourselves. + */ + if (qlvl > 0) + mtree_warning("quoted word straddles " + "onto next line."); + fi = SLIST_FIRST(&mtree_fileinfo); + fi->line++; + } + break; + case 'a': + if (esc) + c = '\a'; + break; + case 'b': + if (esc) + c = '\b'; + break; + case 'f': + if (esc) + c = '\f'; + break; + case 'n': + if (esc) + c = '\n'; + break; + case 'r': + if (esc) + c = '\r'; + break; + case 't': + if (esc) + c = '\t'; + break; + case 'v': + if (esc) + c = '\v'; + break; + } + buf[idx++] = c; + esc = 0; + } while (idx < bufsz && !done); + + if (idx >= bufsz) { + mtree_error("word too long to fit buffer (max %zu characters)", + bufsz); + skip_to(fp, " \t\n"); + } + return (0); +} + +static fsnode * +create_node(const char *name, u_int type, fsnode *parent, fsnode *global) +{ + fsnode *n; + + n = calloc(1, sizeof(*n)); + if (n == NULL) + return (NULL); + + n->name = strdup(name); + if (n->name == NULL) { + free(n); + return (NULL); + } + + n->type = (type == 0) ? global->type : type; + n->parent = parent; + + n->inode = calloc(1, sizeof(*n->inode)); + if (n->inode == NULL) { + free(n->name); + free(n); + return (NULL); + } + + /* Assign global options/defaults. */ + bcopy(global->inode, n->inode, sizeof(*n->inode)); + n->inode->st.st_mode = (n->inode->st.st_mode & ~S_IFMT) | n->type; + + if (n->type == S_IFLNK) + n->symlink = global->symlink; + else if (n->type == S_IFREG) + n->contents = global->contents; + + return (n); +} + +static void +destroy_node(fsnode *n) +{ + + assert(n != NULL); + assert(n->name != NULL); + assert(n->inode != NULL); + + free(n->inode); + free(n->name); + free(n); +} + +static int +read_number(const char *tok, u_int base, intmax_t *res, intmax_t min, + intmax_t max) +{ + char *end; + intmax_t val; + + val = strtoimax(tok, &end, base); + if (end == tok || end[0] != '\0') + return (EINVAL); + if (val < min || val > max) + return (EDOM); + *res = val; + return (0); +} + +static int +read_mtree_keywords(FILE *fp, fsnode *node) +{ + char keyword[PATH_MAX]; + char *name, *p, *value; + struct group *grent; + struct passwd *pwent; + struct stat *st, sb; + intmax_t num; + u_long flset, flclr; + int error, istemp, type; + + st = &node->inode->st; + do { + error = skip_over(fp, " \t"); + if (error) + break; + + error = read_word(fp, keyword, sizeof(keyword)); + if (error) + break; + + if (keyword[0] == '\0') + break; + + value = strchr(keyword, '='); + if (value != NULL) + *value++ = '\0'; + + /* + * We use EINVAL, ENOATTR, ENOSYS and ENXIO to signal + * certain conditions: + * EINVAL - Value provided for a keyword that does + * not take a value. The value is ignored. + * ENOATTR - Value missing for a keyword that needs + * a value. The keyword is ignored. + * ENOSYS - Unsupported keyword encountered. The + * keyword is ignored. + * ENXIO - Value provided for a keyword that does + * not take a value. The value is ignored. + */ + switch (keyword[0]) { + case 'c': + if (strcmp(keyword, "contents") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + node->contents = strdup(value); + } else + error = ENOSYS; + break; + case 'f': + if (strcmp(keyword, "flags") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + flset = flclr = 0; + if (!strtofflags(&value, &flset, &flclr)) { + st->st_flags &= ~flclr; + st->st_flags |= flset; + } else + error = errno; + } else + error = ENOSYS; + break; + case 'g': + if (strcmp(keyword, "gid") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, UINT_MAX); + if (!error) + st->st_gid = num; + } else if (strcmp(keyword, "gname") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + grent = getgrnam(value); + if (grent != NULL) + st->st_gid = grent->gr_gid; + else + error = errno; + } else + error = ENOSYS; + break; + case 'l': + if (strcmp(keyword, "link") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + node->symlink = strdup(value); + } else + error = ENOSYS; + break; + case 'm': + if (strcmp(keyword, "mode") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + if (value[0] >= '0' && value[0] <= '9') { + error = read_number(value, 8, &num, + 0, 07777); + if (!error) { + st->st_mode &= S_IFMT; + st->st_mode |= num; + } + } else { + /* Symbolic mode not supported. */ + error = EINVAL; + break; + } + } else + error = ENOSYS; + break; + case 'o': + if (strcmp(keyword, "optional") == 0) { + if (value != NULL) + error = ENXIO; + node->flags |= FSNODE_F_OPTIONAL; + } else + error = ENOSYS; + break; + case 's': + if (strcmp(keyword, "size") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, INTMAX_MAX); + if (!error) + st->st_size = num; + } else + error = ENOSYS; + break; + case 't': + if (strcmp(keyword, "time") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + p = strchr(value, '.'); + if (p != NULL) + *p++ = '\0'; + error = read_number(value, 10, &num, 0, + INTMAX_MAX); + if (error) + break; + st->st_atime = num; + st->st_ctime = num; + st->st_mtime = num; + error = read_number(p, 10, &num, 0, + INTMAX_MAX); + if (error) + break; + if (num != 0) + error = EINVAL; + } else if (strcmp(keyword, "type") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + if (strcmp(value, "dir") == 0) + node->type = S_IFDIR; + else if (strcmp(value, "file") == 0) + node->type = S_IFREG; + else if (strcmp(value, "link") == 0) + node->type = S_IFLNK; + else + error = EINVAL; + } else + error = ENOSYS; + break; + case 'u': + if (strcmp(keyword, "uid") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + error = read_number(value, 10, &num, + 0, UINT_MAX); + if (!error) + st->st_uid = num; + } else if (strcmp(keyword, "uname") == 0) { + if (value == NULL) { + error = ENOATTR; + break; + } + pwent = getpwnam(value); + if (pwent != NULL) + st->st_uid = pwent->pw_uid; + else + error = errno; + } else + error = ENOSYS; + break; + default: + error = ENOSYS; + break; + } + + switch (error) { + case EINVAL: + mtree_error("%s: invalid value '%s'", keyword, value); + break; + case ENOATTR: + mtree_error("%s: keyword needs a value", keyword); + break; + case ENOSYS: + mtree_warning("%s: unsupported keyword", keyword); + break; + case ENXIO: + mtree_error("%s: keyword does not take a value", + keyword); + break; + } + } while (1); + + if (error) + return (error); + + st->st_mode = (st->st_mode & ~S_IFMT) | node->type; + + /* Nothing more to do for the global defaults. */ + if (node->name == NULL) + return (0); + + /* + * Be intelligent about the file type. + */ + if (node->contents != NULL) { + if (node->symlink != NULL) { + mtree_error("%s: both link and contents keywords " + "defined", node->name); + return (0); + } + type = S_IFREG; + } else + type = (node->symlink != NULL) ? S_IFLNK : S_IFDIR; + + if (node->type == 0) + node->type = type; + + if (node->type != type) { + mtree_error("%s: file type and defined keywords to not match", + node->name); + return (0); + } + + st->st_mode = (st->st_mode & ~S_IFMT) | node->type; + + if (node->contents == NULL) + return (0); + + name = mtree_resolve(node->contents, &istemp); + if (name == NULL) + return (errno); + + if (stat(name, &sb) != 0) { + mtree_error("%s: contents file '%s' not found", node->name, + name); + free(name); + return (0); + } + + free(node->contents); + node->contents = name; + st->st_size = sb.st_size; + return (0); +} + +static int +read_mtree_command(FILE *fp) +{ + char cmd[10]; + int error; + + error = read_word(fp, cmd, sizeof(cmd)); + if (error) + goto out; + + error = read_mtree_keywords(fp, &mtree_global); + + out: + skip_to(fp, "\n"); + (void)getc(fp); + return (error); +} + +static int +read_mtree_spec1(FILE *fp, bool def, const char *name) +{ + fsnode *last, *node, *parent; + u_int type; + int error; + + assert(name[0] != '\0'); + + /* + * Treat '..' specially, because it only changes our current + * directory. We don't create a node for it. We simply ignore + * any keywords that may appear on the line as well. + * Going up a directory is a little non-obvious. A directory *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 18:56:42 2011 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 23605106566C; Sun, 19 Jun 2011 18:56:42 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from fsm2.ukr.net (fsm2.ukr.net [195.214.192.121]) by mx1.freebsd.org (Postfix) with ESMTP id BF9CA8FC16; Sun, 19 Jun 2011 18:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:Mime-Version:Message-ID:Subject:To:From:Date; bh=P0MuhD4hFUHIYMMwPRyjc0gk4heMV0em9qrgPgEXHrw=; b=oJXIXUcUyj4ShOOWGX9CJTdt4qAkMUGqPxUZ5fVjLaoXOOGEKTSrDk4BWL9sULHmSbB/aadefDUuFCIHJoFjuU9IdtAJ7Z1eO02LfZQtLPjAxHhYNR9uQ/BdrbRn97ok8UteHgPkLqoiSFbSnLFPS+1439Kn6EaC42UfbNmj6K4=; Received: from [46.185.1.38] (helo=localhost) by fsm2.ukr.net with esmtps ID 1QYMsY-000PPB-UK ; Sun, 19 Jun 2011 21:37:50 +0300 Date: Sun, 19 Jun 2011 21:37:49 +0300 From: Ivan Klymenko To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Doug Barton Message-ID: <20110619213749.0cf6397c@ukr.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWpqak/Pz/i4uIfHx8GBwZwcHAQEBA6o92AAAACHElEQVQ4jWWUTY7bMAyF6QzUPSEoa8PFHEBgqwuM4bVVg7MvZOj+R+ijpMTpjIwgkT7z75EKrdfattpXERG6zqvUOtAr2LCRYfEKcB4l/Q+2cc6XjQH7hv+2YZYreIk5nevZEPvuzUzptizHLzgDMnC5Wpbl7ewJlOEqlQF+DlCjgVLki0WV6FMDMsBxjlJiQulIznwZ+DxHiQyDyIg0wN3Oo6o6ZQ5s5AIfar+W2Wlmz+kCcb8tg6j3voMEwNrBQk69dDBDqw/urpqJH+m+Q6u/4QnoAeYpnUXC/s1iup9rhCd6xMgAqdDyAyFegbKkVAHeLCcOulPLawaoUIDos4M88iLNrVkU7uu5ccTDO6naJzWLum51C6Yb7y4HKKbdArLWir0PBiS8glJRBZHeyHl7J9lENpAC6qT9NlNG4u5hsVYDyJP6mlJJtY3oVju4WSUzHal1sDU17NASoBWSk40J2eBLBJhYrVmzC5gVALGpNIAiQgN6eGstOp9Oa6zFbbLTISYi28BGZDRUJKWeroECkCEkzXjUtbmmaKMfAx2RfbT69/cO+tgHcmx6AfyZOmj3NDIah0F0GB66d4CrdIoplNFFGHSpSheRxbo0W4S8azNItEoMWbw3uXAeJgCrmX5joz7CGXqSg6PcryEhnFr/C1C2ntPxBOYbdwY+8dO3+wZJyFlbMX9s8zNnvp/tLwAv03NB4j3HVpn8Awwm+GrlP6MVAAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r223264 - in head: etc/defaults etc/rc.d 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: Sun, 19 Jun 2011 18:56:42 -0000 Hello! Thanks for commit. I have a question: If a lot of kernel modules, option kld_list = "" supports moving to a new line? For example: kld_list = " ....< moduleN>\ " Maybe specify its example of manual documentation page for rc.conf? Thank you! Sorry for my english. From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 19:13:24 2011 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 75EE51065670; Sun, 19 Jun 2011 19:13:24 +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 666A18FC1A; Sun, 19 Jun 2011 19:13: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 p5JJDOD6006276; Sun, 19 Jun 2011 19:13:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JJDOqJ006272; Sun, 19 Jun 2011 19:13:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106191913.p5JJDOqJ006272@svn.freebsd.org> From: Alan Cox Date: Sun, 19 Jun 2011 19:13: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: r223307 - 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: Sun, 19 Jun 2011 19:13:24 -0000 Author: alc Date: Sun Jun 19 19:13:24 2011 New Revision: 223307 URL: http://svn.freebsd.org/changeset/base/223307 Log: Precisely document the synchronization rules for the page's dirty field. (Saying that the lock on the object that the page belongs to must be held only represents one aspect of the rules.) Eliminate the use of the page queues lock for atomically performing read- modify-write operations on the dirty field when the underlying architecture supports atomic operations on char and short types. Document the fact that 32KB pages aren't really supported. Reviewed by: attilio, kib Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 (r223307) @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, * caller's changes may go unnoticed because they are * performed through an unmanaged mapping or by a DMA * operation. + * + * The object lock is not held here. Therefore, like + * a pmap operation, the page queues lock may be + * required in order to call vm_page_dirty(). See + * vm_page_clear_dirty_mask(). */ +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ + defined(__mips__) + vm_page_dirty(*mp); +#else vm_page_lock_queues(); vm_page_dirty(*mp); vm_page_unlock_queues(); +#endif } } if (pmap_failed) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 (r223307) @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m /* * vm_page_dirty: * - * make page all dirty + * Set all bits in the page's dirty field. + * + * The object containing the specified page must be locked if the call is + * made from the machine-independent layer. If, however, the call is + * made from the pmap layer, then the page queues lock may be required. + * See vm_page_clear_dirty_mask(). */ void vm_page_dirty(vm_page_t m) @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in /* * If the object is locked and the page is neither VPO_BUSY nor * PG_WRITEABLE, then the page's dirty field cannot possibly be - * modified by a concurrent pmap operation. + * set by a concurrent pmap operation. */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) m->dirty &= ~pagebits; else { +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ + defined(__mips__) + /* + * On the aforementioned architectures, the page queues lock + * is not required by the following read-modify-write + * operation. The combination of the object's lock and an + * atomic operation suffice. Moreover, the pmap layer on + * these architectures can call vm_page_dirty() without + * holding the page queues lock. + */ +#if PAGE_SIZE == 4096 + atomic_clear_char(&m->dirty, pagebits); +#elif PAGE_SIZE == 8192 + atomic_clear_short(&m->dirty, pagebits); +#elif PAGE_SIZE == 16384 + atomic_clear_int(&m->dirty, pagebits); +#else +#error "PAGE_SIZE is not supported." +#endif +#else + /* + * Otherwise, the page queues lock is required to ensure that + * a concurrent pmap operation does not set the page's dirty + * field during the following read-modify-write operation. + */ vm_page_lock_queues(); m->dirty &= ~pagebits; vm_page_unlock_queues(); +#endif } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 (r223306) +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 (r223307) @@ -89,10 +89,26 @@ * and offset to which this page belongs (for pageout), * and sundry status bits. * - * Fields in this structure are locked either by the lock on the - * object that the page belongs to (O), its corresponding page lock (P), - * or by the lock on the page queues (Q). - * + * In general, operations on this structure's mutable fields are + * synchronized using either one of or a combination of the lock on the + * object that the page belongs to (O), the pool lock for the page (P), + * or the lock for either the free or paging queues (Q). If a field is + * annotated below with two of these locks, then holding either lock is + * sufficient for read access, but both locks are required for write + * access. + * + * In contrast, the synchronization of accesses to the page's dirty field + * is machine dependent (M). In the machine-independent layer, the lock + * on the object that the page belongs to must be held in order to + * operate on the field. However, the pmap layer is permitted to set + * all bits within the field without holding that lock. Therefore, if + * the underlying architecture does not support atomic read-modify-write + * operations on the field's type, then the machine-independent layer + * must also hold the page queues lock when performing read-modify-write + * operations and the pmap layer must hold the page queues lock when + * setting the field. In the machine-independent layer, the + * implementation of read-modify-write operations on the field is + * encapsulated in vm_page_clear_dirty_mask(). */ TAILQ_HEAD(pglist, vm_page); @@ -120,18 +136,19 @@ struct vm_page { u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ + /* In reality, support for 32KB pages is not fully implemented. */ #if PAGE_SIZE == 4096 u_char valid; /* map of valid DEV_BSIZE chunks (O) */ - u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 8192 u_short valid; /* map of valid DEV_BSIZE chunks (O) */ - u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 16384 u_int valid; /* map of valid DEV_BSIZE chunks (O) */ - u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */ #elif PAGE_SIZE == 32768 u_long valid; /* map of valid DEV_BSIZE chunks (O) */ - u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */ + u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */ #endif }; From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 21:50:38 2011 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 A9EB6106564A; Sun, 19 Jun 2011 21:50:38 +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 817FE8FC13; Sun, 19 Jun 2011 21:50: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 p5JLocBf010904; Sun, 19 Jun 2011 21:50:38 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JLocvT010903; Sun, 19 Jun 2011 21:50:38 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106192150.p5JLocvT010903@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 19 Jun 2011 21:50: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: r223308 - head/contrib/tnftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 21:50:38 -0000 Author: gavin Date: Sun Jun 19 21:50:38 2011 New Revision: 223308 URL: http://svn.freebsd.org/changeset/base/223308 Log: Copy lukemftp to its new home, tnftp. I'm doing this in stages so as to not confuse the CVS exporter. Added: head/contrib/tnftp/ - copied from r223307, head/contrib/lukemftp/ From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 22:08:56 2011 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 12CEA106564A; Sun, 19 Jun 2011 22:08:56 +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 008E78FC0C; Sun, 19 Jun 2011 22:08: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 p5JM8t6x011552; Sun, 19 Jun 2011 22:08:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JM8tXb011541; Sun, 19 Jun 2011 22:08:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106192208.p5JM8tXb011541@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 22:08: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: r223309 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver kgssapi modules modules/kgssapi_krb5 nfsclient nfsserver 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, 19 Jun 2011 22:08:56 -0000 Author: rmacklem Date: Sun Jun 19 22:08:55 2011 New Revision: 223309 URL: http://svn.freebsd.org/changeset/base/223309 Log: Fix the kgssapi so that it can be loaded as a module. Currently the NFS subsystems use five of the rpcsec_gss/kgssapi entry points, but since it was not obvious which others might be useful, all nineteen were included. Basically the nineteen entry points are set in a structure called rpc_gss_entries and inline functions defined in sys/rpc/rpcsec_gss.h check for the entry points being non-NULL and then call them. A default value is returned otherwise. Requested by rwatson. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/kgssapi/gss_impl.c head/sys/modules/Makefile head/sys/modules/kgssapi_krb5/Makefile head/sys/nfsclient/nfs_krpc.c head/sys/nfsserver/nfs_srvkrpc.c head/sys/rpc/rpc_generic.c head/sys/rpc/rpcsec_gss.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -323,9 +323,7 @@ newnfs_disconnect(struct nfssockreq *nrp client = nrp->nr_client; nrp->nr_client = NULL; mtx_unlock(&nrp->nr_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else { @@ -337,21 +335,18 @@ static AUTH * nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal, char *srv_principal, gss_OID mech_oid, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; #ifdef notyet rpc_gss_options_req_t req_options; #endif -#endif switch (secflavour) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!mech_oid) { - if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid)) + if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid)) return (NULL); } if (secflavour == RPCSEC_GSS_KRB5) @@ -367,7 +362,7 @@ nfs_getauth(struct nfssockreq *nrp, int req_options.input_channel_bindings = NULL; req_options.enc_type = nfs_keytab_enctype; - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, clnt_principal, srv_principal, mech_oid, svc, &req_options); #else @@ -377,7 +372,7 @@ nfs_getauth(struct nfssockreq *nrp, int * principals. As such, that case cannot yet be handled. */ if (clnt_principal == NULL) - auth = rpc_gss_secfind(nrp->nr_client, cred, + auth = rpc_gss_secfind_call(nrp->nr_client, cred, srv_principal, mech_oid, svc); else auth = NULL; @@ -385,7 +380,6 @@ nfs_getauth(struct nfssockreq *nrp, int if (auth != NULL) return (auth); /* fallthrough */ -#endif /* KGSSAPI */ case AUTH_SYS: default: return (authunix_create(cred)); Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -215,12 +215,9 @@ nfscbd_addsock(struct file *fp) int nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args != NULL) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -229,7 +226,6 @@ nfscbd_nfsd(struct thread *td, struct nf } else { principal[0] = '\0'; } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -244,20 +240,16 @@ nfscbd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI if (principal[0] != '\0') - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif nfscbd_pool->sp_minthreads = 4; nfscbd_pool->sp_maxthreads = 4; svc_run(nfscbd_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS); -#endif + rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS); NFSD_LOCK(); nfs_numnfscbd--; Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -386,18 +386,14 @@ nfsrvd_addsock(struct file *fp) int nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args) { -#ifdef KGSSAPI char principal[MAXHOSTNAMELEN + 5]; int error; bool_t ret2, ret3, ret4; -#endif -#ifdef KGSSAPI error = copyinstr(args->principal, principal, sizeof (principal), NULL); if (error) return (error); -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -412,38 +408,29 @@ nfsrvd_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI /* An empty string implies AUTH_SYS only. */ if (principal[0] != '\0') { - ret2 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - ret3 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); - ret4 = rpc_gss_set_svc_name(principal, "kerberosv5", - GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); - - if (!ret2 || !ret3 || !ret4) { - NFSD_LOCK(); - newnfs_numnfsd--; - nfsrvd_init(1); - NFSD_UNLOCK(); - return (EAUTH); - } + ret2 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); + ret3 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); + ret4 = rpc_gss_set_svc_name_call(principal, + "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4); + + if (!ret2 || !ret3 || !ret4) + printf("nfsd: can't register svc name\n"); } -#endif nfsrvd_pool->sp_minthreads = args->minthreads; nfsrvd_pool->sp_maxthreads = args->maxthreads; svc_run(nfsrvd_pool); -#ifdef KGSSAPI if (principal[0] != '\0') { - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER4); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4); } -#endif NFSD_LOCK(); newnfs_numnfsd--; Modified: head/sys/kgssapi/gss_impl.c ============================================================================== --- head/sys/kgssapi/gss_impl.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/kgssapi/gss_impl.c Sun Jun 19 22:08:55 2011 (r223309) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "gssd.h" #include "kgss_if.h" @@ -253,8 +254,40 @@ kgss_copy_buffer(const gss_buffer_t from static int kgssapi_modevent(module_t mod, int type, void *data) { + int error = 0; - return (0); + switch (type) { + case MOD_LOAD: + rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind; + rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge; + rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate; + rpc_gss_entries.rpc_gss_set_defaults = rpc_gss_set_defaults; + rpc_gss_entries.rpc_gss_max_data_length = + rpc_gss_max_data_length; + rpc_gss_entries.rpc_gss_get_error = rpc_gss_get_error; + rpc_gss_entries.rpc_gss_mech_to_oid = rpc_gss_mech_to_oid; + rpc_gss_entries.rpc_gss_oid_to_mech = rpc_gss_oid_to_mech; + rpc_gss_entries.rpc_gss_qop_to_num = rpc_gss_qop_to_num; + rpc_gss_entries.rpc_gss_get_mechanisms = rpc_gss_get_mechanisms; + rpc_gss_entries.rpc_gss_get_versions = rpc_gss_get_versions; + rpc_gss_entries.rpc_gss_is_installed = rpc_gss_is_installed; + rpc_gss_entries.rpc_gss_set_svc_name = rpc_gss_set_svc_name; + rpc_gss_entries.rpc_gss_clear_svc_name = rpc_gss_clear_svc_name; + rpc_gss_entries.rpc_gss_getcred = rpc_gss_getcred; + rpc_gss_entries.rpc_gss_set_callback = rpc_gss_set_callback; + rpc_gss_entries.rpc_gss_clear_callback = rpc_gss_clear_callback; + rpc_gss_entries.rpc_gss_get_principal_name = + rpc_gss_get_principal_name; + rpc_gss_entries.rpc_gss_svc_max_data_length = + rpc_gss_svc_max_data_length; + break; + case MOD_UNLOAD: + /* Unloading of the kgssapi module isn't supported. */ + /* FALLTHROUGH */ + default: + error = EOPNOTSUPP; + }; + return (error); } static moduledata_t kgssapi_mod = { "kgssapi", Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/modules/Makefile Sun Jun 19 22:08:55 2011 (r223309) @@ -155,6 +155,8 @@ SUBDIR= ${_3dfx} \ jme \ joy \ kbdmux \ + kgssapi \ + kgssapi_krb5 \ khelp \ krpc \ ksyms \ Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/modules/kgssapi_krb5/Makefile Sun Jun 19 22:08:55 2011 (r223309) @@ -8,7 +8,8 @@ SRCS= krb5_mech.c \ kcrypto_des.c \ kcrypto_des3.c \ kcrypto_aes.c \ - kcrypto_arcfour.c + kcrypto_arcfour.c \ + opt_inet6.h SRCS+= kgss_if.h gssd.h MFILES= kgssapi/kgss_if.m Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/nfsclient/nfs_krpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -306,9 +306,7 @@ nfs_disconnect(struct nfsmount *nmp) client = nmp->nm_client; nmp->nm_client = NULL; mtx_unlock(&nmp->nm_mtx); -#ifdef KGSSAPI - rpc_gss_secpurge(client); -#endif + rpc_gss_secpurge_call(client); CLNT_CLOSE(client); CLNT_RELEASE(client); } else @@ -325,18 +323,15 @@ nfs_safedisconnect(struct nfsmount *nmp) static AUTH * nfs_getauth(struct nfsmount *nmp, struct ucred *cred) { -#ifdef KGSSAPI rpc_gss_service_t svc; AUTH *auth; -#endif switch (nmp->nm_secflavor) { -#ifdef KGSSAPI case RPCSEC_GSS_KRB5: case RPCSEC_GSS_KRB5I: case RPCSEC_GSS_KRB5P: if (!nmp->nm_mech_oid) - if (!rpc_gss_mech_to_oid("kerberosv5", + if (!rpc_gss_mech_to_oid_call("kerberosv5", &nmp->nm_mech_oid)) return (NULL); if (nmp->nm_secflavor == RPCSEC_GSS_KRB5) @@ -345,12 +340,11 @@ nfs_getauth(struct nfsmount *nmp, struct svc = rpc_gss_svc_integrity; else svc = rpc_gss_svc_privacy; - auth = rpc_gss_secfind(nmp->nm_client, cred, + auth = rpc_gss_secfind_call(nmp->nm_client, cred, nmp->nm_principal, nmp->nm_mech_oid, svc); if (auth) return (auth); /* fallthrough */ -#endif case AUTH_SYS: default: return (authunix_create(cred)); Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/nfsserver/nfs_srvkrpc.c Sun Jun 19 22:08:55 2011 (r223309) @@ -418,12 +418,9 @@ nfssvc_addsock(struct file *fp, struct t static int nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args) { -#ifdef KGSSAPI char principal[128]; int error; -#endif -#ifdef KGSSAPI if (args) { error = copyinstr(args->principal, principal, sizeof(principal), NULL); @@ -434,7 +431,6 @@ nfssvc_nfsd(struct thread *td, struct nf getcredhostname(td->td_ucred, principal + 4, sizeof(principal) - 4); } -#endif /* * Only the first nfsd actually does any work. The RPC code @@ -449,12 +445,10 @@ nfssvc_nfsd(struct thread *td, struct nf NFSD_UNLOCK(); -#ifdef KGSSAPI - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2); - rpc_gss_set_svc_name(principal, "kerberosv5", + rpc_gss_set_svc_name_call(principal, "kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3); -#endif if (args) { nfsrv_pool->sp_minthreads = args->minthreads; @@ -466,10 +460,8 @@ nfssvc_nfsd(struct thread *td, struct nf svc_run(nfsrv_pool); -#ifdef KGSSAPI - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2); - rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3); -#endif + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2); + rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3); NFSD_LOCK(); nfsrv_numnfsd--; Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/rpc/rpc_generic.c Sun Jun 19 22:08:55 2011 (r223309) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -69,6 +70,9 @@ extern u_long sb_max_adj; /* not defined #define strrchr rindex #endif +/* Provide an entry point hook for the rpcsec_gss module. */ +struct rpc_gss_entries rpc_gss_entries; + struct handle { NCONF_HANDLE *nhandle; int nflag; /* Whether NETPATH or NETCONFIG */ Modified: head/sys/rpc/rpcsec_gss.h ============================================================================== --- head/sys/rpc/rpcsec_gss.h Sun Jun 19 21:50:38 2011 (r223308) +++ head/sys/rpc/rpcsec_gss.h Sun Jun 19 22:08:55 2011 (r223309) @@ -141,6 +141,271 @@ typedef struct { __BEGIN_DECLS #ifdef _KERNEL +/* + * Set up a structure of entry points for the kgssapi module and inline + * functions named rpc_gss_XXX_call() to use them, so that the kgssapi + * module doesn't need to be loaded for the NFS modules to work using + * AUTH_SYS. The kgssapi modules will be loaded by the gssd(8) daemon + * when it is started up and the entry points will then be filled in. + */ +typedef AUTH *rpc_gss_secfind_ftype(CLIENT *clnt, struct ucred *cred, + const char *principal, gss_OID mech_oid, + rpc_gss_service_t service); +typedef void rpc_gss_secpurge_ftype(CLIENT *clnt); +typedef AUTH *rpc_gss_seccreate_ftype(CLIENT *clnt, struct ucred *cred, + const char *principal, const char *mechanism, + rpc_gss_service_t service, const char *qop, + rpc_gss_options_req_t *options_req, + rpc_gss_options_ret_t *options_ret); +typedef bool_t rpc_gss_set_defaults_ftype(AUTH *auth, + rpc_gss_service_t service, const char *qop); +typedef int rpc_gss_max_data_length_ftype(AUTH *handle, + int max_tp_unit_len); +typedef void rpc_gss_get_error_ftype(rpc_gss_error_t *error); +typedef bool_t rpc_gss_mech_to_oid_ftype(const char *mech, gss_OID *oid_ret); +typedef bool_t rpc_gss_oid_to_mech_ftype(gss_OID oid, const char **mech_ret); +typedef bool_t rpc_gss_qop_to_num_ftype(const char *qop, const char *mech, + u_int *num_ret); +typedef const char **rpc_gss_get_mechanisms_ftype(void); +typedef bool_t rpc_gss_get_versions_ftype(u_int *vers_hi, u_int *vers_lo); +typedef bool_t rpc_gss_is_installed_ftype(const char *mech); +typedef bool_t rpc_gss_set_svc_name_ftype(const char *principal, + const char *mechanism, u_int req_time, u_int program, + u_int version); +typedef void rpc_gss_clear_svc_name_ftype(u_int program, u_int version); +typedef bool_t rpc_gss_getcred_ftype(struct svc_req *req, + rpc_gss_rawcred_t **rcred, + rpc_gss_ucred_t **ucred, void **cookie); +typedef bool_t rpc_gss_set_callback_ftype(rpc_gss_callback_t *cb); +typedef void rpc_gss_clear_callback_ftype(rpc_gss_callback_t *cb); +typedef bool_t rpc_gss_get_principal_name_ftype(rpc_gss_principal_t *principal, + const char *mech, const char *name, const char *node, + const char *domain); +typedef int rpc_gss_svc_max_data_length_ftype(struct svc_req *req, + int max_tp_unit_len); + +struct rpc_gss_entries { + rpc_gss_secfind_ftype *rpc_gss_secfind; + rpc_gss_secpurge_ftype *rpc_gss_secpurge; + rpc_gss_seccreate_ftype *rpc_gss_seccreate; + rpc_gss_set_defaults_ftype *rpc_gss_set_defaults; + rpc_gss_max_data_length_ftype *rpc_gss_max_data_length; + rpc_gss_get_error_ftype *rpc_gss_get_error; + rpc_gss_mech_to_oid_ftype *rpc_gss_mech_to_oid; + rpc_gss_oid_to_mech_ftype *rpc_gss_oid_to_mech; + rpc_gss_qop_to_num_ftype *rpc_gss_qop_to_num; + rpc_gss_get_mechanisms_ftype *rpc_gss_get_mechanisms; + rpc_gss_get_versions_ftype *rpc_gss_get_versions; + rpc_gss_is_installed_ftype *rpc_gss_is_installed; + rpc_gss_set_svc_name_ftype *rpc_gss_set_svc_name; + rpc_gss_clear_svc_name_ftype *rpc_gss_clear_svc_name; + rpc_gss_getcred_ftype *rpc_gss_getcred; + rpc_gss_set_callback_ftype *rpc_gss_set_callback; + rpc_gss_clear_callback_ftype *rpc_gss_clear_callback; + rpc_gss_get_principal_name_ftype *rpc_gss_get_principal_name; + rpc_gss_svc_max_data_length_ftype *rpc_gss_svc_max_data_length; +}; +extern struct rpc_gss_entries rpc_gss_entries; + +/* Functions to access the entry points. */ +static __inline AUTH * +rpc_gss_secfind_call(CLIENT *clnt, struct ucred *cred, const char *principal, + gss_OID mech_oid, rpc_gss_service_t service) +{ + AUTH *ret = NULL; + + if (rpc_gss_entries.rpc_gss_secfind != NULL) + ret = (*rpc_gss_entries.rpc_gss_secfind)(clnt, cred, principal, + mech_oid, service); + return (ret); +} + +static __inline void +rpc_gss_secpurge_call(CLIENT *clnt) +{ + + if (rpc_gss_entries.rpc_gss_secpurge != NULL) + (*rpc_gss_entries.rpc_gss_secpurge)(clnt); +} + +static __inline AUTH * +rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred, const char *principal, + const char *mechanism, rpc_gss_service_t service, const char *qop, + rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret) +{ + AUTH *ret = NULL; + + if (rpc_gss_entries.rpc_gss_seccreate != NULL) + ret = (*rpc_gss_entries.rpc_gss_seccreate)(clnt, cred, + principal, mechanism, service, qop, options_req, + options_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_set_defaults_call(AUTH *auth, rpc_gss_service_t service, + const char *qop) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_defaults != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_defaults)(auth, service, + qop); + return (ret); +} + +static __inline int +rpc_gss_max_data_length_call(AUTH *handle, int max_tp_unit_len) +{ + int ret = 0; + + if (rpc_gss_entries.rpc_gss_max_data_length != NULL) + ret = (*rpc_gss_entries.rpc_gss_max_data_length)(handle, + max_tp_unit_len); + return (ret); +} + +static __inline void +rpc_gss_get_error_call(rpc_gss_error_t *error) +{ + + if (rpc_gss_entries.rpc_gss_get_error != NULL) + (*rpc_gss_entries.rpc_gss_get_error)(error); +} + +static __inline bool_t +rpc_gss_mech_to_oid_call(const char *mech, gss_OID *oid_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_mech_to_oid != NULL) + ret = (*rpc_gss_entries.rpc_gss_mech_to_oid)(mech, oid_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_oid_to_mech_call(gss_OID oid, const char **mech_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_oid_to_mech != NULL) + ret = (*rpc_gss_entries.rpc_gss_oid_to_mech)(oid, mech_ret); + return (ret); +} + +static __inline bool_t +rpc_gss_qop_to_num_call(const char *qop, const char *mech, u_int *num_ret) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_qop_to_num != NULL) + ret = (*rpc_gss_entries.rpc_gss_qop_to_num)(qop, mech, num_ret); + return (ret); +} + +static __inline const char ** +rpc_gss_get_mechanisms_call(void) +{ + const char **ret = NULL; + + if (rpc_gss_entries.rpc_gss_get_mechanisms != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_mechanisms)(); + return (ret); +} + +static __inline bool_t +rpc_gss_get_versions_call(u_int *vers_hi, u_int *vers_lo) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_get_versions != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_versions)(vers_hi, vers_lo); + return (ret); +} + +static __inline bool_t +rpc_gss_is_installed_call(const char *mech) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_is_installed != NULL) + ret = (*rpc_gss_entries.rpc_gss_is_installed)(mech); + return (ret); +} + +static __inline bool_t +rpc_gss_set_svc_name_call(const char *principal, const char *mechanism, + u_int req_time, u_int program, u_int version) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_svc_name != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_svc_name)(principal, + mechanism, req_time, program, version); + return (ret); +} + +static __inline void +rpc_gss_clear_svc_name_call(u_int program, u_int version) +{ + + if (rpc_gss_entries.rpc_gss_clear_svc_name != NULL) + (*rpc_gss_entries.rpc_gss_clear_svc_name)(program, version); +} + +static __inline bool_t +rpc_gss_getcred_call(struct svc_req *req, rpc_gss_rawcred_t **rcred, + rpc_gss_ucred_t **ucred, void **cookie) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_getcred != NULL) + ret = (*rpc_gss_entries.rpc_gss_getcred)(req, rcred, ucred, + cookie); + return (ret); +} + +static __inline bool_t +rpc_gss_set_callback_call(rpc_gss_callback_t *cb) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_set_callback != NULL) + ret = (*rpc_gss_entries.rpc_gss_set_callback)(cb); + return (ret); +} + +static __inline void +rpc_gss_clear_callback_call(rpc_gss_callback_t *cb) +{ + + if (rpc_gss_entries.rpc_gss_clear_callback != NULL) + (*rpc_gss_entries.rpc_gss_clear_callback)(cb); +} + +static __inline bool_t +rpc_gss_get_principal_name_call(rpc_gss_principal_t *principal, + const char *mech, const char *name, const char *node, const char *domain) +{ + bool_t ret = 1; + + if (rpc_gss_entries.rpc_gss_get_principal_name != NULL) + ret = (*rpc_gss_entries.rpc_gss_get_principal_name)(principal, + mech, name, node, domain); + return (ret); +} + +static __inline int +rpc_gss_svc_max_data_length_call(struct svc_req *req, int max_tp_unit_len) +{ + int ret = 0; + + if (rpc_gss_entries.rpc_gss_svc_max_data_length != NULL) + ret = (*rpc_gss_entries.rpc_gss_svc_max_data_length)(req, + max_tp_unit_len); + return (ret); +} + AUTH *rpc_gss_secfind(CLIENT *clnt, struct ucred *cred, const char *principal, gss_OID mech_oid, rpc_gss_service_t service); void rpc_gss_secpurge(CLIENT *clnt); From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 22:12:49 2011 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 9CE4F1065672; Sun, 19 Jun 2011 22:12:49 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 538218FC08; Sun, 19 Jun 2011 22:12:49 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id E74A214E585F; Sun, 19 Jun 2011 23:53:34 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JpFHDhGgKCDN; Sun, 19 Jun 2011 23:53:32 +0200 (CEST) Received: from [193.137.158.216] (unknown [193.137.158.216]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 4C3FA14E57CC; Sun, 19 Jun 2011 23:53:32 +0200 (CEST) Message-ID: <4DFE6FE2.5030407@FreeBSD.org> Date: Sun, 19 Jun 2011 22:53:38 +0100 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-PT; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexander Kabaev References: <201106191335.p5JDZk11095714@svn.freebsd.org> In-Reply-To: <201106191335.p5JDZk11095714@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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: r223296 - head/lib/libc/iconv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2011 22:12:49 -0000 Em 19-06-2011 14:35, Alexander Kabaev escreveu: > Author: kan > Date: Sun Jun 19 13:35:46 2011 > New Revision: 223296 > URL: http://svn.freebsd.org/changeset/base/223296 > > Log: > Put a quick bandaid on internal citrus locking. > > The code is not quite right still, but it programs from deadlocking > on themselves if one enables new citrus code by mistake. Thanks, I still have this on my TODO list, I just haven't had time so far. Gabor From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 22:48:41 2011 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 1227B106564A; Sun, 19 Jun 2011 22:48:41 +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 019AC8FC12; Sun, 19 Jun 2011 22:48: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 p5JMmel5012713; Sun, 19 Jun 2011 22:48:40 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JMmeKN012708; Sun, 19 Jun 2011 22:48:40 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106192248.p5JMmeKN012708@svn.freebsd.org> From: Doug Barton Date: Sun, 19 Jun 2011 22:48: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: r223310 - in head: etc/defaults etc/rc.d 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: Sun, 19 Jun 2011 22:48:41 -0000 Author: dougb Date: Sun Jun 19 22:48:40 2011 New Revision: 223310 URL: http://svn.freebsd.org/changeset/base/223310 Log: Add the netwait rc.d script. It waits for the specified period for the network to become active. PR: conf/151063 Submitted by: Jeremy Chadwick Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/mountcritremote head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/defaults/rc.conf Sun Jun 19 22:48:40 2011 (r223310) @@ -444,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB B #ubthidhci_addr="2" # Check usbconfig list to find the correct # numbers for your system. +### Network link/usability verification options +netwait_enable="NO" # Enable rc.d/netwait (or NO) +#netwait_ip="" # IP addresses to be pinged by netwait. +netwait_timeout="60" # Total number of seconds to perform pings. +#netwait_if="" # Interface name to watch link state on. +netwait_if_timeout="30" # Total number of seconds to monitor link state. + ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/rc.d/Makefile Sun Jun 19 22:48:40 2011 (r223310) @@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions \ + named natd netif netoptions netwait \ newsyslog nfsclient nfscbd nfsd \ nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ Modified: head/etc/rc.d/mountcritremote ============================================================================== --- head/etc/rc.d/mountcritremote Sun Jun 19 22:08:55 2011 (r223309) +++ head/etc/rc.d/mountcritremote Sun Jun 19 22:48:40 2011 (r223310) @@ -4,7 +4,7 @@ # # PROVIDE: mountcritremote -# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec +# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait # KEYWORD: nojail . /etc/rc.subr Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Jun 19 22:08:55 2011 (r223309) +++ head/share/man/man5/rc.conf.5 Sun Jun 19 22:48:40 2011 (r223310) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2011 +.Dd June 19, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -4293,6 +4293,61 @@ Bus address of the USB Bluetooth control Check the output of .Xr usbconfig 8 on your system to find this information. +.It Va netwait_enable +.Pq Vt bool +If set to +.Dq Li YES , +delays the start of network-reliant services until +.Va netwait_if +is up and ICMP packets to a destination defined in +.Va netwait_ip +are flowing. +Link state is examined first, followed by +.Dq Li pinging +an IP address to verify network usability. +If no destination can be reached or timeouts are exceeded, +network services are started anyway with no guarantee that +the network is usable. +Use of this variable requires both +.Va netwait_ip +and +.Va netwait_if +to be set. +.It Va netwait_ip +.Pq Vt str +Empty by default. +This variable contains a space-delimited list of IP addresses to +.Xr ping 8 . +DNS hostnames should not be used as resolution is not guaranteed +to be functional at this point. +If multiple IP addresses are specified, +each will be tried until one is successful or the list is exhausted. +.It Va netwait_timeout +.Pq Vt int +Indicates the total number of seconds to perform a +.Dq Li ping +against each IP address in +.Va netwait_ip , +at a rate of one ping per second. +If any of the pings are successful, +full network connectivity is considered reliable. +The default is 60. +.It Va netwait_if +.Pq Vt str +Empty by default. +Defines the name of the network interface on which watch for link. +.Xr ifconfig 8 +is used to monitor the interface, looking for +.Dq Li status: no carrier . +Once gone, the link is considered up. +This can be a +.Xr vlan 4 +interface if desired. +.It Va netwait_if_timeout +.Pq Vt int +Defines the total number of seconds to wait for link to become usable, +polled at a 1-second interval. +The default is 30. .El .Sh FILES .Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact @@ -4364,6 +4419,7 @@ on your system to find this information. .Xr ntpdate 8 , .Xr pfctl 8 , .Xr pflogd 8 , +.Xr ping 8 , .Xr powerd 8 , .Xr quotacheck 8 , .Xr quotaon 8 , From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 22:59:55 2011 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 29DDD1065672; Sun, 19 Jun 2011 22:59:55 +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 00CBE8FC0A; Sun, 19 Jun 2011 22:59: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 p5JMxsxd013081; Sun, 19 Jun 2011 22:59:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JMxsBS013080; Sun, 19 Jun 2011 22:59:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106192259.p5JMxsBS013080@svn.freebsd.org> From: Doug Barton Date: Sun, 19 Jun 2011 22:59: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: r223311 - head/etc/rc.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: Sun, 19 Jun 2011 22:59:55 -0000 Author: dougb Date: Sun Jun 19 22:59:54 2011 New Revision: 223311 URL: http://svn.freebsd.org/changeset/base/223311 Log: Blah, forgot to svn add the actual script from r223310 Added: head/etc/rc.d/netwait (contents, props changed) Added: head/etc/rc.d/netwait ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/netwait Sun Jun 19 22:59:54 2011 (r223311) @@ -0,0 +1,97 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: netwait +# REQUIRE: NETWORKING +# KEYWORD: nojail +# +# The netwait script is intended to be used by systems which have +# statically-configured IP addresses in rc.conf(5). If your system +# uses DHCP, you should use synchronous_dhclient="YES" in your +# /etc/rc.conf instead of using netwait. + +. /etc/rc.subr + +name="netwait" +rc_var=`set_rcvar` +start_cmd="${name}_start" +stop_cmd=":" + +netwait_start() +{ + local ip rc count output link + + if [ -z "${netwait_ip}" ]; then + err 1 "You must define one or more IP addresses in netwait_ip" + fi + + if [ ${netwait_timeout} -lt 1 ]; then + err 1 "netwait_timeout must be >= 1" + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + if [ -n "${netwait_if}" ]; then + echo -n "Waiting for $netwait_if to have link" + + count=1 + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo '.' + break + fi + else + echo '' + err 1 "ifconfig ${netwait_if} failed" + fi + sleep 1 + count=$((count+1)) + done + if [ -n "${link}" ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '' + warn "Interface still has no link. Continuing with startup, but" + warn "be aware you may not have a fully functional networking" + warn "layer at this point." + return + fi + fi + + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT + + echo '.' + return + fi + count=$((count+1)) + done + echo ': No response from host.' + done + + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." +} + +load_rc_config $name +run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Sun Jun 19 23:54:01 2011 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 AC5FF106566B; Sun, 19 Jun 2011 23:54:01 +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 82B7E8FC0C; Sun, 19 Jun 2011 23:54: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 p5JNs1ss014669; Sun, 19 Jun 2011 23:54:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5JNs13p014667; Sun, 19 Jun 2011 23:54:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106192354.p5JNs13p014667@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jun 2011 23:54: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: r223312 - head/sys/fs/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: Sun, 19 Jun 2011 23:54:01 -0000 Author: rmacklem Date: Sun Jun 19 23:54:01 2011 New Revision: 223312 URL: http://svn.freebsd.org/changeset/base/223312 Log: Fix a number of places where the new NFS server did not lock the mutex when manipulating rc_flag in the DRC cache. This is believed to fix a hung server that was reported to the freebsd-fs@ list on June 9 under the subject heading "New NFS server stress test hang", where all the threads were waiting for the RC_LOCKED flag to clear. Tested by: jwd at slowblink.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Sun Jun 19 22:59:54 2011 (r223311) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Sun Jun 19 23:54:01 2011 (r223312) @@ -405,6 +405,7 @@ nfsrvd_updatecache(struct nfsrv_descript { struct nfsrvcache *rp; struct nfsrvcache *retrp = NULL; + mbuf_t m; rp = nd->nd_rp; if (!rp) @@ -457,9 +458,9 @@ nfsrvd_updatecache(struct nfsrv_descript } if ((nd->nd_flag & ND_NFSV2) && nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) { - NFSUNLOCKCACHE(); rp->rc_status = nd->nd_repstat; rp->rc_flag |= RC_REPSTATUS; + NFSUNLOCKCACHE(); } else { if (!(rp->rc_flag & RC_UDP)) { nfsrc_tcpsavedreplies++; @@ -469,9 +470,11 @@ nfsrvd_updatecache(struct nfsrv_descript nfsrc_tcpsavedreplies; } NFSUNLOCKCACHE(); - rp->rc_reply = m_copym(nd->nd_mreq, 0, M_COPYALL, - M_WAIT); + m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT); + NFSLOCKCACHE(); + rp->rc_reply = m; rp->rc_flag |= RC_REPMBUF; + NFSUNLOCKCACHE(); } if (rp->rc_flag & RC_UDP) { rp->rc_timestamp = NFSD_MONOSEC + @@ -518,6 +521,7 @@ nfsrvd_delcache(struct nfsrvcache *rp) APPLESTATIC void nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err) { + tcp_seq tmp_seq; if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); @@ -526,8 +530,12 @@ nfsrvd_sentcache(struct nfsrvcache *rp, so->so_proto->pr_domain->dom_family != AF_INET6) || so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); - if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) + if (nfsrv_getsockseqnum(so, &tmp_seq)) { + NFSLOCKCACHE(); + rp->rc_tcpseq = tmp_seq; rp->rc_flag |= RC_TCPSEQ; + NFSUNLOCKCACHE(); + } } nfsrc_unlock(rp); } @@ -687,8 +695,11 @@ nfsrc_lock(struct nfsrvcache *rp) static void nfsrc_unlock(struct nfsrvcache *rp) { + + NFSLOCKCACHE(); rp->rc_flag &= ~RC_LOCKED; nfsrc_wanted(rp); + NFSUNLOCKCACHE(); } /* From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 00:17:44 2011 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 7A1A8106564A; Mon, 20 Jun 2011 00:17:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 684C78FC19; Mon, 20 Jun 2011 00:17: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 p5K0HiTf015460; Mon, 20 Jun 2011 00:17:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K0HiVo015455; Mon, 20 Jun 2011 00:17:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200017.p5K0HiVo015455@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 00:17: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: r223313 - in head/sys: conf powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 00:17:44 -0000 Author: nwhitehorn Date: Mon Jun 20 00:17:44 2011 New Revision: 223313 URL: http://svn.freebsd.org/changeset/base/223313 Log: Driver for PS3's internal hard disk. Hopefully this can be CAM-ified in the future, but presents a set of simple block devices for now. With (forthcoming) boot loader support or vfs.root.mountfrom, allows booting PS3s from disk. Submitted by: glevand Added: head/sys/powerpc/ps3/ps3disk.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/ps3/ps3bus.c head/sys/powerpc/ps3/ps3bus.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/conf/files.powerpc Mon Jun 20 00:17:44 2011 (r223313) @@ -208,6 +208,7 @@ powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 powerpc/ps3/ps3ata.c optional ps3 ps3ata powerpc/ps3/ps3bus.c optional ps3 +powerpc/ps3/ps3disk.c optional ps3 powerpc/ps3/ps3pic.c optional ps3 powerpc/ps3/ps3_syscons.c optional ps3 sc powerpc/ps3/ps3-hvcall.S optional ps3 sc Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/powerpc/ps3/ps3bus.c Mon Jun 20 00:17:44 2011 (r223313) @@ -1,5 +1,6 @@ /*- * Copyright (C) 2010 Nathan Whitehorn + * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -73,6 +74,8 @@ struct ps3bus_devinfo { int dev; uint64_t bustype; uint64_t devtype; + int busidx; + int devidx; struct resource_list resources; bus_dma_tag_t dma_tag; @@ -89,6 +92,11 @@ enum ps3bus_irq_type { EHCI_IRQ = 4, }; +enum ps3bus_reg_type { + OHCI_REG = 3, + EHCI_REG = 4, +}; + static device_method_t ps3bus_methods[] = { /* Device interface */ DEVMETHOD(device_identify, ps3bus_identify), @@ -235,6 +243,77 @@ ps3bus_resources_init(struct rman *rm, i } } +static void +ps3bus_resources_init_by_type(struct rman *rm, int bus_index, int dev_index, + uint64_t irq_type, uint64_t reg_type, struct ps3bus_devinfo *dinfo) +{ + uint64_t _irq_type, irq, outlet; + uint64_t _reg_type, paddr, len; + uint64_t ppe, junk; + int i, result; + int thread; + + resource_list_init(&dinfo->resources); + + lv1_get_logical_ppe_id(&ppe); + thread = 32 - fls(mfctrl()); + + /* Scan for interrupts */ + for (i = 0; i < 10; i++) { + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("intr") | i, 0, &_irq_type, &irq); + + if (result != 0) + break; + + if (_irq_type != irq_type) + continue; + + lv1_construct_io_irq_outlet(irq, &outlet); + lv1_connect_irq_plug_ext(ppe, thread, outlet, outlet, + 0); + resource_list_add(&dinfo->resources, SYS_RES_IRQ, i, + outlet, outlet, 1); + } + + /* Scan for registers */ + for (i = 0; i < 10; i++) { + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("reg") | i, + lv1_repository_string("type"), &_reg_type, &junk); + + if (result != 0) + break; + + if (_reg_type != reg_type) + continue; + + result = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("reg") | i, + lv1_repository_string("data"), &paddr, &len); + + result = lv1_map_device_mmio_region(dinfo->bus, dinfo->dev, + paddr, len, 12 /* log_2(4 KB) */, &paddr); + + if (result != 0) { + printf("Mapping registers failed for device " + "%d.%d (%ld.%ld): %d\n", dinfo->bus, dinfo->dev, + dinfo->bustype, dinfo->devtype, result); + break; + } + + rman_manage_region(rm, paddr, paddr + len - 1); + resource_list_add(&dinfo->resources, SYS_RES_MEMORY, i, + paddr, paddr + len, len); + } +} + static int ps3bus_attach(device_t self) { @@ -294,30 +373,93 @@ ps3bus_attach(device_t self) if (result != 0) continue; - dinfo = malloc(sizeof(*dinfo), M_PS3BUS, - M_WAITOK | M_ZERO); - - dinfo->bus = bus; - dinfo->dev = dev; - dinfo->bustype = bustype; - dinfo->devtype = devtype; + switch (devtype) { + case PS3_DEVTYPE_USB: + /* USB device has OHCI and EHCI USB host controllers */ - if (dinfo->bustype == PS3_BUSTYPE_SYSBUS) lv1_open_device(bus, dev, 0); - ps3bus_resources_init(&sc->sc_mem_rman, bus_index, - dev_index, dinfo); + /* OHCI host controller */ - cdev = device_add_child(self, NULL, -1); - if (cdev == NULL) { - device_printf(self, - "device_add_child failed\n"); - free(dinfo, M_PS3BUS); - continue; - } + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index, + dev_index, OHCI_IRQ, OHCI_REG, dinfo); + + cdev = device_add_child(self, "ohci", -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } + + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + + /* EHCI host controller */ + + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index, + dev_index, EHCI_IRQ, EHCI_REG, dinfo); + + cdev = device_add_child(self, "ehci", -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } + + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + break; + default: + dinfo = malloc(sizeof(*dinfo), M_PS3BUS, + M_WAITOK | M_ZERO); + + dinfo->bus = bus; + dinfo->dev = dev; + dinfo->bustype = bustype; + dinfo->devtype = devtype; + dinfo->busidx = bus_index; + dinfo->devidx = dev_index; + + if (dinfo->bustype == PS3_BUSTYPE_SYSBUS || + dinfo->bustype == PS3_BUSTYPE_STORAGE) + lv1_open_device(bus, dev, 0); + + ps3bus_resources_init(&sc->sc_mem_rman, bus_index, + dev_index, dinfo); + + cdev = device_add_child(self, NULL, -1); + if (cdev == NULL) { + device_printf(self, + "device_add_child failed\n"); + free(dinfo, M_PS3BUS); + continue; + } - mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); - device_set_ivars(cdev, dinfo); + mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF); + device_set_ivars(cdev, dinfo); + } } } @@ -361,6 +503,12 @@ ps3bus_read_ivar(device_t bus, device_t case PS3BUS_IVAR_DEVTYPE: *result = dinfo->devtype; break; + case PS3BUS_IVAR_BUSIDX: + *result = dinfo->busidx; + break; + case PS3BUS_IVAR_DEVIDX: + *result = dinfo->devidx; + break; default: return (EINVAL); } @@ -483,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && + dinfo->bustype != PS3_BUSTYPE_STORAGE) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); Modified: head/sys/powerpc/ps3/ps3bus.h ============================================================================== --- head/sys/powerpc/ps3/ps3bus.h Sun Jun 19 23:54:01 2011 (r223312) +++ head/sys/powerpc/ps3/ps3bus.h Mon Jun 20 00:17:44 2011 (r223313) @@ -32,7 +32,9 @@ enum { PS3BUS_IVAR_BUS, PS3BUS_IVAR_DEVICE, PS3BUS_IVAR_BUSTYPE, - PS3BUS_IVAR_DEVTYPE + PS3BUS_IVAR_DEVTYPE, + PS3BUS_IVAR_BUSIDX, + PS3BUS_IVAR_DEVIDX, }; #define PS3BUS_ACCESSOR(A, B, T) \ @@ -42,6 +44,8 @@ PS3BUS_ACCESSOR(bus, BUS, int) PS3BUS_ACCESSOR(device, DEVICE, int) PS3BUS_ACCESSOR(bustype, BUSTYPE, uint64_t) PS3BUS_ACCESSOR(devtype, DEVTYPE, uint64_t) +PS3BUS_ACCESSOR(busidx, BUSIDX, int) +PS3BUS_ACCESSOR(devidx, DEVIDX, int) /* Bus types */ enum { Added: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 00:17:44 2011 (r223313) @@ -0,0 +1,893 @@ +/*- + * Copyright (C) 2011 glevand (geoffrey.levand@mail.ru) + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ps3bus.h" +#include "ps3-hvcall.h" + +#define PS3DISK_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "ps3disk", MTX_DEF) +#define PS3DISK_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define PS3DISK_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define PS3DISK_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define PS3DISK_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define PS3DISK_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +#define LV1_STORAGE_ATA_HDDOUT 0x23 + +SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD, 0, "PS3 Disk driver parameters"); + +#ifdef PS3DISK_DEBUG +static int ps3disk_debug = 0; +SYSCTL_INT(_hw_ps3disk, OID_AUTO, debug, CTLFLAG_RW, &ps3disk_debug, + 0, "control debugging printfs"); +TUNABLE_INT("hw.ps3disk.debug", &ps3disk_debug); +enum { + PS3DISK_DEBUG_INTR = 0x00000001, + PS3DISK_DEBUG_TASK = 0x00000002, + PS3DISK_DEBUG_READ = 0x00000004, + PS3DISK_DEBUG_WRITE = 0x00000008, + PS3DISK_DEBUG_FLUSH = 0x00000010, + PS3DISK_DEBUG_ANY = 0xffffffff +}; +#define DPRINTF(sc, m, fmt, ...) \ +do { \ + if (sc->sc_debug & (m)) \ + printf(fmt, __VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(sc, m, fmt, ...) +#endif + +struct ps3disk_region { + uint64_t r_id; + uint64_t r_start; + uint64_t r_size; + uint64_t r_flags; +}; + +struct ps3disk_softc { + device_t sc_dev; + + struct mtx sc_mtx; + + uint64_t sc_blksize; + uint64_t sc_nblocks; + + uint64_t sc_nregs; + struct ps3disk_region *sc_reg; + + int sc_irqid; + struct resource *sc_irq; + void *sc_irqctx; + + struct disk **sc_disk; + + struct bio_queue_head sc_bioq; + + struct proc *sc_task; + + int sc_bounce_maxblocks; + bus_dma_tag_t sc_bounce_dmatag; + bus_dmamap_t sc_bounce_dmamap; + bus_addr_t sc_bounce_dmaphys; + char *sc_bounce; + uint64_t sc_bounce_lpar; + int sc_bounce_busy; + uint64_t sc_bounce_tag; + uint64_t sc_bounce_status; + + int sc_running; + + int sc_debug; +}; + +static int ps3disk_open(struct disk *dp); +static int ps3disk_close(struct disk *dp); +static void ps3disk_strategy(struct bio *bp); +static void ps3disk_task(void *arg); + +static int ps3disk_intr_filter(void *arg); +static void ps3disk_intr(void *arg); +static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc); +static int ps3disk_enum_regions(struct ps3disk_softc *sc); +static int ps3disk_read(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data); +static int ps3disk_write(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data); +static int ps3disk_flush(struct ps3disk_softc *sc); + +static void ps3disk_sysctlattach(struct ps3disk_softc *sc); + +static MALLOC_DEFINE(M_PS3DISK, "ps3disk", "PS3 Disk"); + +static int +ps3disk_probe(device_t dev) +{ + if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_STORAGE || + ps3bus_get_devtype(dev) != PS3_DEVTYPE_DISK) + return (ENXIO); + + device_set_desc(dev, "Playstation 3 Disk"); + + return (BUS_PROBE_SPECIFIC); +} + +static int +ps3disk_attach(device_t dev) +{ + struct ps3disk_softc *sc; + struct disk *d; + intmax_t mb; + char unit; + int i, err; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + PS3DISK_LOCK_INIT(sc); + + err = ps3disk_get_disk_geometry(sc); + if (err) { + device_printf(dev, "Could not get disk geometry\n"); + err = ENXIO; + goto fail_destroy_lock; + } + + device_printf(dev, "block size %lu total blocks %lu\n", + sc->sc_blksize, sc->sc_nblocks); + + err = ps3disk_enum_regions(sc); + if (err) { + device_printf(dev, "Could not enumerate disk regions\n"); + err = ENXIO; + goto fail_destroy_lock; + } + + device_printf(dev, "Found %lu regions\n", sc->sc_nregs); + + if (!sc->sc_nregs) { + err = ENXIO; + goto fail_destroy_lock; + } + + /* Setup interrupt handler */ + + sc->sc_irqid = 0; + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid, + RF_ACTIVE); + if (!sc->sc_irq) { + device_printf(dev, "Could not allocate IRQ\n"); + err = ENXIO; + goto fail_free_regions; + } + + err = bus_setup_intr(dev, sc->sc_irq, + INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, + ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx); + if (err) { + device_printf(dev, "Could not setup IRQ\n"); + err = ENXIO; + goto fail_release_intr; + } + + /* Setup DMA bounce buffer */ + + sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize; + + err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sc->sc_bounce_maxblocks * sc->sc_blksize, 1, + sc->sc_bounce_maxblocks * sc->sc_blksize, + 0, NULL, NULL, &sc->sc_bounce_dmatag); + if (err) { + device_printf(dev, "Could not create DMA tag for bounce buffer\n"); + err = ENXIO; + goto fail_teardown_intr; + } + + err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->sc_bounce_dmamap); + if (err) { + device_printf(dev, "Could not allocate DMA memory for bounce buffer\n"); + err = ENXIO; + goto fail_destroy_dmatag; + } + + err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, + sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize, + ps3disk_getphys, &sc->sc_bounce_dmaphys, 0); + if (err) { + device_printf(dev, "Could not load DMA map for bounce buffer\n"); + err = ENXIO; + goto fail_free_dmamem; + } + + sc->sc_bounce_lpar = vtophys(sc->sc_bounce); + + if (bootverbose) + device_printf(dev, "bounce buffer lpar address 0x%016lx\n", + sc->sc_bounce_lpar); + + /* Setup disks */ + + sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *), + M_PS3DISK, M_ZERO | M_WAITOK); + if (!sc->sc_disk) { + device_printf(dev, "Could not allocate disk(s)\n"); + err = ENOMEM; + goto fail_unload_dmamem; + } + + for (i = 0; i < sc->sc_nregs; i++) { + d = sc->sc_disk[i] = disk_alloc(); + d->d_open = ps3disk_open; + d->d_close = ps3disk_close; + d->d_strategy = ps3disk_strategy; + d->d_name = "ps3disk"; + d->d_drv1 = sc; + d->d_maxsize = DFLTPHYS; + d->d_sectorsize = sc->sc_blksize; + d->d_unit = i; + d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize; + d->d_flags |= DISKFLAG_CANFLUSHCACHE; + + mb = d->d_mediasize >> 20; + unit = 'M'; + if (mb >= 10240) { + unit = 'G'; + mb /= 1024; + } + + device_printf(dev, "region %d %ju%cB\n", i, mb, unit); + + disk_create(d, DISK_VERSION); + } + + bioq_init(&sc->sc_bioq); + + ps3disk_sysctlattach(sc); + + sc->sc_running = 1; + + kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk"); + + return (0); + +fail_unload_dmamem: + + bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); + +fail_free_dmamem: + + bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); + +fail_destroy_dmatag: + + bus_dma_tag_destroy(sc->sc_bounce_dmatag); + +fail_teardown_intr: + + bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); + +fail_release_intr: + + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); + +fail_free_regions: + + free(sc->sc_reg, M_PS3DISK); + +fail_destroy_lock: + + PS3DISK_LOCK_DESTROY(sc); + + return (err); +} + +static int +ps3disk_detach(device_t dev) +{ + struct ps3disk_softc *sc = device_get_softc(dev); + int i; + + PS3DISK_LOCK(sc); + sc->sc_running = 0; + wakeup(sc); + PS3DISK_UNLOCK(sc); + + PS3DISK_LOCK(sc); + while (sc->sc_running != -1) + msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0); + PS3DISK_UNLOCK(sc); + + for (i = 0; i < sc->sc_nregs; i++) + disk_destroy(sc->sc_disk[i]); + + bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); + bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); + bus_dma_tag_destroy(sc->sc_bounce_dmatag); + + bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); + + free(sc->sc_disk, M_PS3DISK); + + free(sc->sc_reg, M_PS3DISK); + + PS3DISK_LOCK_DESTROY(sc); + + return (0); +} + +static int +ps3disk_open(struct disk *dp) +{ + return (0); +} + +static int +ps3disk_close(struct disk *dp) +{ + return (0); +} + +static void +ps3disk_strategy(struct bio *bp) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1; + + if (!sc) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = EINVAL; + biodone(bp); + return; + } + + PS3DISK_LOCK(sc); + bioq_disksort(&sc->sc_bioq, bp); + if (!sc->sc_bounce_busy) + wakeup(sc); + PS3DISK_UNLOCK(sc); +} + +static void +ps3disk_task(void *arg) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; + struct bio *bp; + daddr_t block, end; + u_long nblocks; + char *data; + int err; + + while (sc->sc_running) { + PS3DISK_LOCK(sc); + do { + bp = bioq_first(&sc->sc_bioq); + if (bp == NULL) + msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); + } while (bp == NULL && sc->sc_running); + if (bp) + bioq_remove(&sc->sc_bioq, bp); + PS3DISK_UNLOCK(sc); + + if (!sc->sc_running) + break; + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", + __func__, bp->bio_cmd); + + if (bp->bio_cmd == BIO_FLUSH) { + err = ps3disk_flush(sc); + + if (err) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_flags |= BIO_DONE; + } + } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize); + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n", + __func__, bp->bio_pblkno, bp->bio_bcount); + + for (block = bp->bio_pblkno; block < end;) { + data = bp->bio_data + + (block - bp->bio_pblkno) * sc->sc_blksize; + + nblocks = end - block; + if (nblocks > sc->sc_bounce_maxblocks) + nblocks = sc->sc_bounce_maxblocks; + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n", + __func__, nblocks); + + if (bp->bio_cmd == BIO_READ) { + err = ps3disk_read(sc, bp->bio_disk->d_unit, + block, nblocks, data); + } else { + err = ps3disk_write(sc, bp->bio_disk->d_unit, + block, nblocks, data); + } + + if (err) + break; + + block += nblocks; + } + + bp->bio_resid = (end - block) * sc->sc_blksize; + if (bp->bio_resid) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_flags |= BIO_DONE; + } + + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n", + __func__, bp->bio_resid); + } else { + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + } + + if (bp->bio_flags & BIO_ERROR) + disk_err(bp, "hard error", -1, 1); + + biodone(bp); + } + + PS3DISK_LOCK(sc); + sc->sc_running = -1; + wakeup(sc); + PS3DISK_UNLOCK(sc); + + kproc_exit(0); +} + +static int +ps3disk_intr_filter(void *arg) +{ + return (FILTER_SCHEDULE_THREAD); +} + +static void +ps3disk_intr(void *arg) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; + device_t dev = sc->sc_dev; + uint64_t devid = ps3bus_get_device(dev); + uint64_t tag, status; + int err; + + PS3DISK_LOCK(sc); + + err = lv1_storage_get_async_status(devid, &tag, &status); + + DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n", + __func__, err, tag, status); + + if (err) + goto out; + + if (!sc->sc_bounce_busy) { + device_printf(dev, "Got interrupt while no request pending\n"); + goto out; + } + + if (tag != sc->sc_bounce_tag) + device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n", + tag, sc->sc_bounce_tag); + + if (status) + device_printf(dev, "Request completed with status 0x%016lx\n", status); + + sc->sc_bounce_status = status; + sc->sc_bounce_busy = 0; + + wakeup(sc); + +out: + + PS3DISK_UNLOCK(sc); +} + +static void +ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + + *(bus_addr_t *) arg = segs[0].ds_addr; +} + +static int +ps3disk_get_disk_geometry(struct ps3disk_softc *sc) +{ + device_t dev = sc->sc_dev; + uint64_t bus_index = ps3bus_get_busidx(dev); + uint64_t dev_index = ps3bus_get_devidx(dev); + uint64_t junk; + int err; + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk); + if (err) { + device_printf(dev, "Could not get block size (0x%08x)\n", err); + err = ENXIO; + goto out; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk); + if (err) { + device_printf(dev, "Could not get total number of blocks (0x%08x)\n", + err); + err = ENXIO; + goto out; + } + + err = 0; + +out: + + return (err); +} + +static int +ps3disk_enum_regions(struct ps3disk_softc *sc) +{ + device_t dev = sc->sc_dev; + uint64_t bus_index = ps3bus_get_busidx(dev); + uint64_t dev_index = ps3bus_get_devidx(dev); + uint64_t junk; + int i, err; + + /* Read number of regions */ + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("n_regs"), 0, &sc->sc_nregs, &junk); + if (err) { + device_printf(dev, "Could not get number of regions (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + if (!sc->sc_nregs) + return 0; + + sc->sc_reg = malloc(sc->sc_nregs * sizeof(struct ps3disk_region), + M_PS3DISK, M_ZERO | M_WAITOK); + if (!sc->sc_reg) { + err = ENOMEM; + goto fail; + } + + /* Setup regions */ + + for (i = 0; i < sc->sc_nregs; i++) { + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("id"), &sc->sc_reg[i].r_id, &junk); + if (err) { + device_printf(dev, "Could not get region id (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk); + if (err) { + device_printf(dev, "Could not get region start (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, + (lv1_repository_string("bus") >> 32) | bus_index, + lv1_repository_string("dev") | dev_index, + lv1_repository_string("region") | i, + lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk); + if (err) { + device_printf(dev, "Could not get region size (0x%08x)\n", + err); + err = ENXIO; + goto fail; + } + + if (i == 0) + /* disables HV access control and grants access to whole disk */ + sc->sc_reg[i].r_flags = 0x2; + else + sc->sc_reg[i].r_flags = 0; + } + + return (0); + +fail: + + sc->sc_nregs = 0; + if (sc->sc_reg) + free(sc->sc_reg, M_PS3DISK); + + return (err); +} + +static int +ps3disk_read(struct ps3disk_softc *sc, int regidx, + uint64_t start_sector, uint64_t sector_count, char *data) +{ + device_t dev = sc->sc_dev; + struct ps3disk_region *rp = &sc->sc_reg[regidx]; + uint64_t devid = ps3bus_get_device(dev); + int err; + + PS3DISK_LOCK(sc); + + if (sc->sc_bounce_busy) { + device_printf(dev, "busy\n"); + PS3DISK_UNLOCK(sc); + return EIO; + } + + sc->sc_bounce_busy = 1; + + err = lv1_storage_read(devid, rp->r_id, + start_sector, sector_count, rp->r_flags, + sc->sc_bounce_lpar, &sc->sc_bounce_tag); + if (err) { + device_printf(dev, "Could not read sectors (0x%08x)\n", err); + err = EIO; + goto out; + } + + DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", + __func__, sc->sc_bounce_tag); + + err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz); + if (err) { + device_printf(dev, "Read request timed out\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 00:46:07 2011 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 6AA8F106566B; Mon, 20 Jun 2011 00:46:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58F8F8FC13; Mon, 20 Jun 2011 00:46: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 p5K0k7AG016282; Mon, 20 Jun 2011 00:46:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K0k7fk016279; Mon, 20 Jun 2011 00:46:07 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200046.p5K0k7fk016279@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 00:46: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: r223314 - in head/sys: conf powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 00:46:07 -0000 Author: nwhitehorn Date: Mon Jun 20 00:46:07 2011 New Revision: 223314 URL: http://svn.freebsd.org/changeset/base/223314 Log: Add an OHCI driver to complement the EHCI one. The infrastructure to attach both to the parent ps3bus was in r223313. This driver itself comes from the ps3 project branch. Added: head/sys/powerpc/ps3/ohci_ps3.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Jun 20 00:17:44 2011 (r223313) +++ head/sys/conf/files.powerpc Mon Jun 20 00:46:07 2011 (r223314) @@ -203,6 +203,7 @@ powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard powerpc/powerpc/uio_machdep.c standard powerpc/ps3/ehci_ps3.c optional ps3 ehci +powerpc/ps3/ohci_ps3.c optional ps3 ohci powerpc/ps3/if_glc.c optional ps3 glc powerpc/ps3/mmu_ps3.c optional ps3 powerpc/ps3/platform_ps3.c optional ps3 Added: head/sys/powerpc/ps3/ohci_ps3.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/ps3/ohci_ps3.c Mon Jun 20 00:46:07 2011 (r223314) @@ -0,0 +1,170 @@ +/*- + * Copyright (C) 2010 Nathan Whitehorn + * 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 TOOLS GMBH 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "ps3bus.h" + +static int +ohci_ps3_probe(device_t dev) +{ + if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_SYSBUS || + ps3bus_get_devtype(dev) != PS3_DEVTYPE_USB) + return (ENXIO); + + device_set_desc(dev, "Playstation 3 USB 2.0 controller"); + return (BUS_PROBE_SPECIFIC); +} + +static int +ohci_ps3_attach(device_t dev) +{ + ohci_softc_t *sc = device_get_softc(dev); + int rid, err; + + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = OHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&sc->sc_bus, + USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc)) + return (ENOMEM); + + rid = 0; + sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + + if (!sc->sc_io_res) { + device_printf(dev, "Could not map memory\n"); + goto error; + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + + if (sc->sc_irq_res == NULL) { + device_printf(dev, "Could not allocate irq\n"); + return (ENXIO); + } + + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!sc->sc_bus.bdev) { + device_printf(dev, "Could not add USB device\n"); + return (ENXIO); + } + + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sprintf(sc->sc_vendor, "Sony"); + + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); + if (err) { + device_printf(dev, "Could not setup error irq, %d\n", err); + goto error; + } + + //sc->sc_flags |= EHCI_SCFLG_BIGEMMIO; + bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, + OHCI_CONTROL, 0); + err = ohci_init(sc); + if (err) { + device_printf(dev, "USB init failed err=%d\n", err); + goto error; + } + + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err == 0) + return (0); + +error: + return (ENXIO); +} + +static device_method_t ohci_ps3_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ohci_ps3_probe), + DEVMETHOD(device_attach, ohci_ps3_attach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + {0, 0} +}; + +static driver_t ohci_ps3_driver = { + "ohci", + ohci_ps3_methods, + sizeof(ohci_softc_t), +}; + +static devclass_t ohci_ps3_devclass; + +DRIVER_MODULE(ohci_ps3, ps3bus, ohci_ps3_driver, ohci_ps3_devclass, 0, 0); +MODULE_DEPEND(ohci_ps3, usb, 1, 1, 1); + From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 00:48:07 2011 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 A75EF1065670; Mon, 20 Jun 2011 00:48:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC0C8FC13; Mon, 20 Jun 2011 00:48:07 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1CF6C46B2C; Sun, 19 Jun 2011 20:48:07 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 87E6E8A027; Sun, 19 Jun 2011 20:48:06 -0400 (EDT) Message-ID: <4DFE98C6.4050102@FreeBSD.org> Date: Sun, 19 Jun 2011 20:48:06 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ivan Klymenko References: <20110619213749.0cf6397c@ukr.net> In-Reply-To: <20110619213749.0cf6397c@ukr.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sun, 19 Jun 2011 20:48:06 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Doug Barton Subject: Re: svn commit: r223264 - in head: etc/defaults etc/rc.d 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: Mon, 20 Jun 2011 00:48:07 -0000 On 6/19/11 2:37 PM, Ivan Klymenko wrote: > Hello! > Thanks for commit. > > I have a question: > If a lot of kernel modules, option kld_list = "" supports moving to a > new line? > For example: > kld_list = " ....< moduleN>\ > " > > Maybe specify its example of manual documentation page for rc.conf? > > Thank you! It's normal shell so you can always do this: kld_list="foo bar baz" kld_list="${kld_list} four five six" -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 00:48:46 2011 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 43C9A106564A; Mon, 20 Jun 2011 00:48:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1C88FC18; Mon, 20 Jun 2011 00:48:46 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id C5BA846B2E; Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 41E048A02A; Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Message-ID: <4DFE98ED.3090102@FreeBSD.org> Date: Sun, 19 Jun 2011 20:48:45 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexander Kabaev References: <201106191335.p5JDZaa3095644@svn.freebsd.org> In-Reply-To: <201106191335.p5JDZaa3095644@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sun, 19 Jun 2011 20:48:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223294 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 00:48:46 -0000 On 6/19/11 9:35 AM, Alexander Kabaev wrote: > Author: kan > Date: Sun Jun 19 13:35:36 2011 > New Revision: 223294 > URL: http://svn.freebsd.org/changeset/base/223294 > > Log: > Do not set thread name to less than informative 'initial thread'. > > Modified: > head/lib/libthr/thread/thr_init.c Thank you! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 01:43:15 2011 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 2F9131065672; Mon, 20 Jun 2011 01:43:15 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5138FC14; Mon, 20 Jun 2011 01: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 p5K1hEPP018080; Mon, 20 Jun 2011 01:43:14 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1hE6V018059; Mon, 20 Jun 2011 01:43:14 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200143.p5K1hE6V018059@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 01:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223315 - in stable/8/contrib/sendmail: . cf/cf cf/feature cf/m4 cf/ostype contrib doc/op include/sm libmilter libmilter/docs libsm makemap 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: Mon, 20 Jun 2011 01:43:15 -0000 Author: gshapiro Date: Mon Jun 20 01:43:14 2011 New Revision: 223315 URL: http://svn.freebsd.org/changeset/base/223315 Log: Merge sendmail 8.14.5 to RELENG_8 Added: stable/8/contrib/sendmail/cf/ostype/solaris11.m4 - copied unchanged from r223067, head/contrib/sendmail/cf/ostype/solaris11.m4 Modified: stable/8/contrib/sendmail/CACerts stable/8/contrib/sendmail/FREEBSD-upgrade stable/8/contrib/sendmail/KNOWNBUGS stable/8/contrib/sendmail/LICENSE stable/8/contrib/sendmail/PGPKEYS stable/8/contrib/sendmail/RELEASE_NOTES stable/8/contrib/sendmail/cf/cf/submit.cf stable/8/contrib/sendmail/cf/feature/ldap_routing.m4 stable/8/contrib/sendmail/cf/m4/cfhead.m4 stable/8/contrib/sendmail/cf/m4/proto.m4 stable/8/contrib/sendmail/cf/m4/version.m4 stable/8/contrib/sendmail/contrib/qtool.pl stable/8/contrib/sendmail/doc/op/op.me stable/8/contrib/sendmail/include/sm/conf.h stable/8/contrib/sendmail/libmilter/docs/overview.html stable/8/contrib/sendmail/libmilter/docs/smfi_stop.html stable/8/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html stable/8/contrib/sendmail/libmilter/engine.c stable/8/contrib/sendmail/libmilter/sm_gethost.c stable/8/contrib/sendmail/libmilter/worker.c stable/8/contrib/sendmail/libsm/ldap.c stable/8/contrib/sendmail/makemap/makemap.c stable/8/contrib/sendmail/src/Makefile.m4 stable/8/contrib/sendmail/src/conf.c stable/8/contrib/sendmail/src/daemon.c stable/8/contrib/sendmail/src/deliver.c stable/8/contrib/sendmail/src/domain.c stable/8/contrib/sendmail/src/envelope.c stable/8/contrib/sendmail/src/err.c stable/8/contrib/sendmail/src/main.c stable/8/contrib/sendmail/src/map.c stable/8/contrib/sendmail/src/mci.c stable/8/contrib/sendmail/src/parseaddr.c stable/8/contrib/sendmail/src/queue.c stable/8/contrib/sendmail/src/readcf.c stable/8/contrib/sendmail/src/sendmail.8 stable/8/contrib/sendmail/src/sendmail.h stable/8/contrib/sendmail/src/sm_resolve.c stable/8/contrib/sendmail/src/srvrsmtp.c stable/8/contrib/sendmail/src/tls.c stable/8/contrib/sendmail/src/udb.c stable/8/contrib/sendmail/src/usersmtp.c stable/8/contrib/sendmail/src/version.c Directory Properties: stable/8/contrib/sendmail/ (props changed) Modified: stable/8/contrib/sendmail/CACerts ============================================================================== --- stable/8/contrib/sendmail/CACerts Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/CACerts Mon Jun 20 01:43:14 2011 (r223315) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.4 2009/06/26 05:46:10 ca Exp $ +# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -9,73 +9,6 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Validity - Not Before: May 12 00:40:50 2000 GMT - Not After : May 20 00:40:50 2010 GMT - Subject: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b1:1b:49:06:ef:3f:44:e0:93:ad:8c:a7:f7:21: - 7c:87:cb:da:35:f6:4b:a2:fd:8a:a0:07:5b:cc:6a: - 9b:89:33:fc:24:f5:b1:24:59:5a:25:50:fd:16:d7: - d4:bc:c7:04:1d:df:90:9b:5e:c3:a8:e9:8b:7d:a3: - 5d:9a:e9:7f:e5:2b:ea:15:a7:ad:ba:58:26:0a:11: - 49:4f:da:9a:67:7f:b0:a6:66:f4:27:b6:61:4e:3c: - c8:3e:a0:2f:6a:b4:0e:15:d6:39:f8:92:60:85:df: - a6:34:f3:fa:a4:a5:e4:47:49:e7:87:a4:a5:5c:8e: - 6a:2f:13:76:5f:29:f3:64:73 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - X509v3 Authority Key Identifier: - keyid:B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - DirName:/C=US/ST=Illinois/L=De Kalb/O=Northern Illinois University/OU=Computer Science/CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 60:69:23:65:97:51:5c:06:a4:42:cb:00:e7:9a:dc:39:70:c3: - d3:5d:bf:0f:e0:04:54:4d:d9:dc:12:57:12:6c:67:fd:5b:b0: - 39:63:ea:c4:12:65:51:bb:3d:f1:f7:25:b4:cd:0b:f6:5b:7a: - 61:25:ad:06:0a:01:55:dc:71:05:29:0d:73:e9:30:51:be:d3: - e1:b2:89:fc:0f:28:f7:06:75:96:1b:34:75:e0:07:e5:3b:b3: - 0b:28:24:e5:79:ea:55:39:e7:d2:ee:ec:63:b4:e4:c6:ee:cb: - 15:d0:c8:eb:3b:4f:36:10:a4:6a:c0:6b:03:e8:29:72:c7:a7: - 10:00 ------BEGIN CERTIFICATE----- -MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjELMAkGA1UEBhMCVVMx -ETAPBgNVBAgTCElsbGlub2lzMRAwDgYDVQQHEwdEZSBLYWxiMSUwIwYDVQQKExxO -b3J0aGVybiBJbGxpbm9pcyBVbml2ZXJzaXR5MRkwFwYDVQQLExBDb21wdXRlciBT -Y2llbmNlMRUwEwYDVQQDEwxOZWlsIFJpY2tlcnQxITAfBgkqhkiG9w0BCQEWEnJp -Y2tlcnRAY3Mubml1LmVkdTAeFw0wMDA1MTIwMDQwNTBaFw0xMDA1MjAwMDQwNTBa -MIGuMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0Rl -IEthbGIxJTAjBgNVBAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAX -BgNVBAsTEENvbXB1dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEh -MB8GCSqGSIb3DQEJARYScmlja2VydEBjcy5uaXUuZWR1MIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCxG0kG7z9E4JOtjKf3IXyHy9o19kui/YqgB1vMapuJM/wk -9bEkWVolUP0W19S8xwQd35CbXsOo6Yt9o12a6X/lK+oVp626WCYKEUlP2ppnf7Cm -ZvQntmFOPMg+oC9qtA4V1jn4kmCF36Y08/qkpeRHSeeHpKVcjmovE3ZfKfNkcwID -AQABo4IBDzCCAQswHQYDVR0OBBYEFLYxeLt+qk2hXf2iJBjGkFotLxlIMIHbBgNV -HSMEgdMwgdCAFLYxeLt+qk2hXf2iJBjGkFotLxlIoYG0pIGxMIGuMQswCQYDVQQG -EwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0RlIEthbGIxJTAjBgNV -BAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAXBgNVBAsTEENvbXB1 -dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEhMB8GCSqGSIb3DQEJ -ARYScmlja2VydEBjcy5uaXUuZWR1ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN -AQEEBQADgYEAYGkjZZdRXAakQssA55rcOXDD012/D+AEVE3Z3BJXEmxn/VuwOWPq -xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH -5TuzCygk5XnqVTnn0u7sY7Tkxu7LFdDI6ztPNhCkasBrA+gpcsenEAA= ------END CERTIFICATE----- - -Certificate: - Data: - Version: 3 (0x2) Serial Number: c2:3c:61:67:3b:0a:cc:5e Signature Algorithm: md5WithRSAEncryption Modified: stable/8/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- stable/8/contrib/sendmail/FREEBSD-upgrade Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/FREEBSD-upgrade Mon Jun 20 01:43:14 2011 (r223315) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.4 +sendmail 8.14.5 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -110,4 +110,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -25-January-2010 +13-June-2011 Modified: stable/8/contrib/sendmail/KNOWNBUGS ============================================================================== --- stable/8/contrib/sendmail/KNOWNBUGS Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/KNOWNBUGS Mon Jun 20 01:43:14 2011 (r223315) @@ -12,6 +12,14 @@ distribution). This list is not guaranteed to be complete. +* Header values which are too long may be truncated. + + If a value of a structured header is longer than 256 (MAXNAME) + characters then it may be truncated during output. For example, + if a single address in the To: header is longer than 256 characters + then it will be truncated which may result in a syntactically + invalid address. + * Delivery to programs that generate too much output may cause problems If e-mail is delivered to a program which generates too much @@ -258,4 +266,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.60 $, Last updated $Date: 2007/12/04 01:16:50 $ +$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $ Modified: stable/8/contrib/sendmail/LICENSE ============================================================================== --- stable/8/contrib/sendmail/LICENSE Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/LICENSE Mon Jun 20 01:43:14 2011 (r223315) @@ -1,8 +1,9 @@ SENDMAIL LICENSE -The following license terms and conditions apply, unless a different -license is obtained from Sendmail, Inc., 6475 Christie Ave, Suite 350, -Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com. +The following license terms and conditions apply, unless a redistribution +agreement or other license is obtained from Sendmail, Inc., 6475 Christie +Ave, Third Floor, Emeryville, CA 94608, USA, or by electronic mail at +license@sendmail.com. License Terms: @@ -22,10 +23,11 @@ each of the following conditions is met: must allow further use, modification, and redistribution of the Source Code under substantially the same terms as this license. For the purposes of redistribution "Source Code" means the complete compilable - and linkable source code of sendmail including all modifications. + and linkable source code of sendmail and associated libraries and + utilities in the sendmail distribution including all modifications. -2. Redistributions of source code must retain the copyright notices as they - appear in each source code file, these license terms, and the +2. Redistributions of Source Code must retain the copyright notices as they + appear in each Source Code file, these license terms, and the disclaimer/limitation of liability set forth as paragraph 6 below. 3. Redistributions in binary form must reproduce the Copyright Notice, @@ -33,16 +35,16 @@ each of the following conditions is met: forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: - "Copyright (c) 1998-2009 Sendmail, Inc. All rights reserved." + "Copyright (c) 1998-2010 Sendmail, Inc. All rights reserved." 4. Neither the name of Sendmail, Inc. nor the University of California nor - the names of their contributors may be used to endorse or promote + names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark of Sendmail, Inc. 5. All redistributions must comply with the conditions imposed by the - University of California on certain embedded code, whose copyright - notice and conditions for redistribution are as follows: + University of California on certain embedded code, which copyright + Notice and conditions for redistribution are as follows: (a) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. @@ -76,4 +78,4 @@ each of the following conditions is met: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision: 8.15 $, Last updated $Date: 2009/03/04 19:58:04 $ +$Revision: 8.17 $, Last updated $Date: 2010/12/03 01:10:00 $, Document 139848.1 Modified: stable/8/contrib/sendmail/PGPKEYS ============================================================================== --- stable/8/contrib/sendmail/PGPKEYS Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/PGPKEYS Mon Jun 20 01:43:14 2011 (r223315) @@ -142,6 +142,223 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 2048 A97884B0 2011-01-04 ------- RSA Sign & Encrypt +fingerprint: 5872 6218 A913 400D E660 3601 39A4 C77D A978 84B0 +uid Sendmail Signing Key/2011 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBE0ios4BCAC0mjr+Fljl/LRvhI3sI29bM146dWJFr+oJVTHuafDuKQS5ICeU +89LewVL6Pjp8RureijfbqZC51Z2v5v6GxAizr/LlD9FohjQXiAaA1vgPChBdzvLg +4TzEVnQOGFuDUnuucQH82I7ysQkK7z1GpFkofKHHgwmcfFpOiRLoUR7YVP7yDpfv +Zx3EPvRoFtR22kWlhms49J7zgRpXUCH9ggrtcl1QCXkPOlZ+VspUPrZaZEZy8RTA +3W5l0yhnGVgnJHBfOo2svFurukQ7LAU4U6yCG5AFogcD3sgEvuFAkmWBJZ2rnOBn +yCL658zfAJlmrni8kLQp6yBuEsUrT6jdRgRBABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTEgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAk0i +os4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA5pMd9qXiEsHIXB/0S +PFGPpoJzQqcEUHZ8w21mJOhoB6eO3GYRXBBLODQbu3x5qMXgTXT2fZgsSO5zkKBD +QCm4lMns+cJCds1+ggAZLywNM1SUvctXJYIaHnSLEnEbxIgRMM+HdULlJn3xgT6w +HUVZhzjamXOLospz5BfIXx9NynvjxvjcZ/NI8Cas1WFPvP+89fT+VCzLw0eC1bAo +puv2CA384i7pqeCvw13taksA0QnpHeN9c2xjWA6LTbLBrDLoTkfxvas0H9WzgNTF +DpzSuIHyDFonrkSvdgyOCIUYWJ0qkzDYnJzaOd7ku+4YjcF1bw5FhbvXAvcBY8OA +Ilr9WaR2TGj7//OylOjNiQEcBBABAgAGBQJNIqNLAAoJEGBN+/KFQQq+gDEH/i7x +aOd7L+QV5rIYyujJdirVoO/9s1+YJkKmFAKltUPcj8vOulQrxjK1E4Wul1qzMclr +TpZnIb9lyoqIKlGFwx345iHFhDHdWeGFxMxeQBopyOmAZcfMIX2C22+EYGNZNUsO +xVxpNV0CzKTdbfPHmBFSbA4lWnkyFxZsTR0GmGXRluwc1kT3i98QJbqNudKzUSU4 +f0+3Uda3xrnLtmChSEc57PRSDV4jHdILxORcuHh3xi50y0J3JJ2Yj0utNZ/W2KWX +guO0WSaNxv7lcKv5ilTWA5WWRt42SZfHlTiBJVpWydRBTZQGJLR6GTWpMoMs5jwP +9BGlbcR9J5+wmOFT9BmInAQQAQIABgUCTSKjbwAKCRASiW6bp38kKRGJBAC+VwW2 +/kXhV70FPyny4RErQDtyovkyS4rqFLdTNWNu80xbgEZJZY9ZcxT8YLjePsPmDZ0R +d4omumo5M35/gAastE5UMC4JCFM4v/iUUZwm5LRQNn0UtSKsSdHf32OqJx0FBr5k +GAe9LAd6gIqkPMw4AaK5H+C3H9VbR4sWHr3AEYicBBABAgAGBQJNIqN3AAoJENiq +8Mr2swcpK94D/A30eBH+qNleOIlwocxV+Fu7g6rvIPdULeYSNLhi/cuXUzo0HREs +FowErSD9gSabBkHbAUUhz8gBIXBATUKDgPfoqUqzYZmWRz15jgbKv2vVF36v6uuj +C/xgVZJsgw5uaZkJM5TI7FCEIs8EfjtPGD3AG1zBYw1+cmls6x+sq6tsiJwEEAEC +AAYFAk0io40ACgkQl0MBGHCTuEEeRwP/eaawZ80/BoQLdlgz6nNsIhomtFZSPhMS +/AFMo+cd4G777R1VJijNiD2ou3/2QbcPfu8OPENFYMLAOcYxYTzCL7XgSWkMxAmF +l2S1/xNUIteUwReoWpp/TZfCaTyro1VrX5pbTf3EYRlkF1qStBwmFfwSIZazhabi +XjlG/rDXL4WInAQQAQIABgUCTSKjlwAKCRAee7PIr5WWJfQsBACcJNvwXwHZVaf3 ++7f2wvqk1HxQk/3x2A/kMBSl1KuWFHV/WGu7Abj8hrjdrBffeCo27TpOhNt5946X +dwBLl4LYNL2Ogi8lH4nR1DsLTcJKICzxveFN1pRafd7+raVqsg/pIVQnagjxbuTa +6ClKEqGnF23kfnjMmlkQgQqupXh6kYicBBABAgAGBQJNIqOfAAoJEHCgJE0e+ZJR +RKYD/17M7wr4tyR+cO1vEJWftFbVCuyKnlUGH4yqjvZhFI0G3NhGnHcjXtl5Tntu +6gUOzObitN1vL/n0BYOPX4ppQ52Ocv6I87geOXC9EDREy5fJU8kX9lGkDRwWJEcg +i88ap0L/8Z3ihtr73hKZp3V6zfBIKdR/RfxxjV3xe5AevuooiJwEEAECAAYFAk0i +o6YACgkQyNXtKZX2F3G35wQApLZxcOkchrNplG4YJMucVcPFyNzeUFL6yhV6PMIQ +Vz8/ktBYF3LK2QQBxIFBEINF8EslKZ7LSfiFTSvsAxb8OiXGV23qHnglfN2zLFrA +CR9wvZ7jtDHHFfhHoDN8d9PA2LQR7M9qJzf1ltTaSETm9bSEZ/wC+VHvw+EVQU2S +OlSInAQQAQIABgUCTSKjrgAKCRAhg+GxOW8HiYOzBACR7nqyHOXspyNy0k2iKkEN +yAaorX32AecPpwyee7G2+QLxbK8jGGcmh5NR/GUx3ZbdKroyMZHK6OrQi42NwC7Q +n9xnzzgUgSdKRwnsA1IyP7DpiBSXMdk0kCc6UJy2L9fanHbamAe0oSZAACt9ePYD +jjq4Jmf25ObWv16Hyv83N4icBBABAgAGBQJNIqPIAAoJEIlpYrhnjAoDa9sD/inn +1dFkBlDPlPtGwHbw3+qCk8y6h3HpZubae7FxdE1pzsh/G00pB7Wy5K/EHL3MKlul +TxtetwQhSrYBmsPD5t3BhDKIyU2MQuec8dbJw/O1/7xGYmG1O4gGwq9vM4C2g+wz +atMl2pQnmi9DhhxFTwxhTgeorQ7nXrTclbuaqyLSiJwEEAECAAYFAk0io9EACgkQ +OCLbR8w3Ty1JCgQAjkZe0O9GZko22lkc7/3eql8zKwBx3Fpugt1NZ9nyOxeS2WpO +FfuiAiruA+p1L7b/dC60BUu+z6pgGIs05vIvPzzqjxnPBhqeYwWeW3ABa4JMVDi1 +RkR4TK6PsEj6IE7ZatzqiPST/GNRrjvpqtNyLsEbybPdY13hZSmxb780d1mInAQQ +AQIABgUCTSKj2gAKCRCcHL3i41xWNXseA/93476LuPukf9rKz9hvf88HrK5O0YPc +jG/CU2nFLhRbo5gkGFyf7540pODGBaCHyqwT46etzVY+WtZ1fETN0ALIJwoXkbwM +QE637pwnCLUO6ZTixa6CwceWXXAIc5/hiuQn0uKL8x4kHUcMUZqggYvqrjG1ZEDG +ZCVuTes1yhalDYicBBABAgAGBQJNIqPnAAoJEG9Sk9ijm6ZVpFYD/1OyjV5+9N/2 +rGbKcfaDXqTM0cvBjs1vBvFJfmDCy3fcOv590SboiCwY6dt5Sd6eRruY4FaTnosI +V4MZZnvMq1W3KfbT6fvcli/hgTKwYfJM7Mj+Tdp3uOGXN1u+cvKEfY3YHwDb4NAc +G3jPSslu1nrZq84bsokhnE+en8du7mKPiJwEEAECAAYFAk0io+8ACgkQ71iWZNQy +4Z1jiQP8CdqzrpIpNuKOs1nVcMsX+T1ZdiNbqbPYbjhQx7isUoaarDk/tQZZGxDE +dEXayRuNobRzQXltAKOhBrXlN2yFP9d9BR1y8B3dVBO9vsThuQ1BtMrtLrAL5In9 +4RyAvpuKcOhWnf9kJLis2MGghhIllJMuXOFeyujE3A4HSHFqGDWInAQQAQIABgUC +TSKj+gAKCRDBnB0lEtNGHaOHA/4+zClhAJappAYqATHLCs8mgzYa0/9RvI+e6iV8 +OD8/BOJl4DnHya0ijX7Kt78VJymcmdXge1ypBnq4D2b/vTo18asDfzysPhAmPoCK +FTlerV9xV/TW/QBZ7EkPW3BwOQW7LYnFd/NnoiX4z+KWh9FwOVWlXPz8xKgBgX3V +yoz3l4icBBABAgAGBQJNIqQhAAoJEMApykAW9MzppmsD/1HonMTzk4X9qvhvaLTU +/OKvOzxIdX6b/62DA0WZxN3Duyh2S8OLZzryI9SASesk5vgb2uSMC3dVCwOcfsiz +QWqStOLG5eyYJh0/iiRZ2K4YM/FrFBo3+AmQ2IeL3qRftBWGyIf11l1ZFS3Uzp8t +uzIxUFcQU2bJpy7GjHcq989qiJwEEAECAAYFAk0ipIwACgkQvdqP1j/qff3gwwP/ +WTAZ3r8UYbMoIN+ES8A9xLvUZRh/aT7TtiFCLxmJXIk3e+XKHw57DO3WUgZEo99d +PYNm/Q3tTqT+fj1rIDH9VdxhiSVw2lq/7qoIoYFb1fyCtuMQ+27jF/AFqbkDQJYx +gcnalClseYEsA9+GYKYfY0UAQePuDuWBMSPMkM+m+e+InAQQAQIABgUCTSKkqgAK +CRB8S2dtoA4VY+t1A/922nF4Apuc162UVBiP+v67PeXLgekdkjqlDACxqqgWWerW +6e41VaznDZjIGx76pQSbguCq7XbQXkiqO3E7bHcbjC8OEZ1Glju13GZG3heaoc23 +4n5pNctLmBWSdrp/4RCaf1BAgZ0UAYPO9fR7ZJyenp3vID8vwKTufoy0nR8/MIic +BBABAgAGBQJNIqS6AAoJENbgof5PvirdRDID/39vOWdqbvu17vX2n3GBI4RYseA2 +1pmvDqvzQcLLDJAXr1auTY7uiotYlXA8qPd4KTy0hCcj2r+7lZMhY1mCumG/0Sp+ +CahRkvUk/rVgWLeK0WGEsCV4IcayKc6ARJVKW+JHUNc1eAScMDAlMOyg0cNtQeDA +huCt6hxL1YGTPpPSiJwEEAECAAYFAk0on/MACgkQzx61AyIyegHYdAP/c4bKqid9 +lK7ciLbuo7RD0ZngCy+mE+xI4EQV+5LEhFVrqT+fMzSlHKLZGbPPJ2yP1ksBJITw +cYh7wGN7Dc1xA5bnB0CtjUWYqGRcQoifbgetdee2AfRs0+RvnEo5FMJIBlJOPc2X +o5eDTxmoSrt7cxnh7PEZnbxZi1gp/wJ+E+iIRgQQEQIABgUCTTHB2wAKCRAJp6JK +0eWCBxuyAJkBu7Qu46EFKyVyC8eUFwLJkghR2gCdHQUS7eF9pXHFr6aN3J2VrGFe +mFiIRgQQEQIABgUCTTUNYgAKCRDCeBwaRrHv4ROhAJ99EeU9KWWDnd2RjCN7uex5 +S6u3rQCeLUshZhe/NCehUnaaC8LJ1kwj/5yIRgQQEQIABgUCTTWM/AAKCRCWnNph +S7Y2S8bjAJ9bOB/fFGyPgTuwQIEakXITRILLgwCgvrjaVZagTRwQW2BM1uH+vk9j +yDuIRgQQEQIABgUCTUMwnwAKCRCiu/skDPlW91hCAJ0eizb5bxByUpXY0qsbcupw +H3kiBwCg1Yc7cur+Yz2dhPuRreaPk4QeVrWIRgQQEQIABgUCTUMxEgAKCRD7VAFa ++haI7RKlAKCGogTWoJdDbetwBdRpRJ72d9qUgACfUehPWCmq2A/mIaMFlPI+F3k3 +Lk25AQ0ETSKizgEIALV2tE8RtEgC1fjw4zHrZVUChXKm1uVEkRkeoaASrAI4IiK+ +qtgbNEzhLEQavQaIZECQLCaQb5qzvKLCEvuo5tClU+2P4/YjnikdBDFXUwHznSmd +N27SsX6gNoeX/ZwaEJUNpMd/v+/Gu9QmMBIFUhtXXZyeBBpCyi6CP5jw66KjjH1g +OXCQvSYJVlutIGtzvHolvQ2I+h6Ztwy9d7pFIVlr7EymFI+x0oI/i4UwF3FZPVWO +C1OZD7suXSre+eLzYXGBYyHkvGldhA/hvKLs3Z6udcirTMtX27xL6C5WKaCsuQPu +ZiYWxJ2A9UgP6zTuBzmAJ4XXKo7QgamAbxHT0sMAEQEAAYkBHwQYAQIACQUCTSKi +zgIbDAAKCRA5pMd9qXiEsI/1CACv83SSDOBt6HZcg7ucOZJ7Wkb5EJG6Mseh/K33 +CFDwWgYa20YeUUzPWD3ZRKY4irNL3ipnB3tJUF4yaasTPpI0owpcdCkOhpDw9S7M +AOnUACuv3JIZ17892ZLjXalNGMY/23qPxbQIaAidNh02ouZ6Md+NUvgh22+oDa+v +kxTkXmKiBGFpqY2myzzPvg84TMTpRBU372CZpmjjHK8duObUr9I0iIbVzshdnWuR +MKGu+n4hSU3SIYl6xLsdBGpiDOQJ3C1YHIduhDrQlyAjDVEgzgw20DUxUzKIpn2b +KH6d5q94eHcPD56A4cYD275DIZzAYqRpwzmB9O845HrHAPmQ +=pDAG +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use +pub 2048 85410ABE 2010-02-19 ------- RSA Sign +fingerprint: B175 9644 5303 5DCE DD7B E919 604D FBF2 8541 0ABE +uid Sendmail Signing Key/2010 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBEt+6goBCAC95sVPzf4AWFmUklHO9yGBq6K135Tlt9JaX3frj6PCBjkLNn97 +J5WDAoLqE9wB7WgiBzs2lu8OPZZcf+6syd97SojEze5bj2uv84DBv2juupbHEBys +9OH52QqYWG+1yuwAHY2gjKLYcvNgaOKLp5hoHZ2rakRc4a2ypLTPazsGFBO9/qBA ++v6qkP70/lOZeN9HX/yipbygAE+Y9elptW6ohvdGW8jbtllFqYFebB+lIaclkQnK +pldnQfktnJDB+XmLOc5m/1BsultlI5IH9HXCeskXxLcxXq+ldg+it1DgzxmHpHTK +dIhgOKY3MvTgxkcXiwIGcHBMnov6ESL1KaU5ABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTAgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAkt+ +6goCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBgTfvyhUEKvi4qB/0T +Em3whttGoUrxdZd1gYKI9SY1/4dHOhD+xJQQgIoQSRpOEA7xQ6TTAYvG8sYdsF5K +9/lWjOTEy5w6wBcu4e9F7aO/TUzue/7p0c2UKJTrEOw4HsRrENfQHx1TAXudQHHn +5+PgBCQCSr36ktuSXnlOo2bGbZ4FUwNCu0ztmoEEca8ZgY6ciEXbva1kRj6Eumul +MkqtVYEAtjzdIga6M3xYuJlus+qi/uEj5kivtf2LUDxXpGE6XFrArum0za/URiW8 +wxt5zBbTbne3tDr2yg6GC046+f1Wr02xWYapGyNRU6yrPciWOu0tpaxJ7CwEIMRq +6HzbSVdZkqOdSoZ3ufqYiJwEEAECAAYFAkt+6lkACgkQEolum6d/JClfWAP/VBVb +VYBQKV+NQyXl6ULJI91iIpEAR/T3nRoemGVPhbB8a7zRRkz1h4ou6VAMJeS4BxSC +fm2iOHCYMAOMSQ03VaEM2F13b8PtsGaKjuAwDf2pHARYbOj4DRCY0dUmwPXze3Tp +7S5ui/fk9t+NhQQa6IZHFkqdnQ+xZ88hhoF5slmInAQQAQIABgUCS37q1AAKCRDv +WJZk1DLhnTPYA/0VhRNooc2csxwvxBG6HiS8wp2k+kbGbbtlQ4JFg59p4EUnT2Ld +P9eUzFtj6fRkU/bZcIKgOn37M4GOXEoNvMT6NfmpTKeofg7hwp+pMdHlq4y9Em55 +TSC+rK2g6rAaSxMvDzasBouQqfxirj3nBI65zVHK98Zaj9vrpWCVCBIoZoicBBAB +AgAGBQJLfurtAAoJEG9Sk9ijm6ZVjcoEAJdB5kzFWHsvf0u/Oe+LWQwowL5SjQ6W +uhKgTDJ5IqFbDlCT/V33mpLEC9us4wNRT6Bff5agInCKfcUXdJijExkEbDB9ErZc +WmZqtquxQJN3xH+fIoIorxjWD0RMPmMvwQRgjn/puXwichQP9PafTgd9YsQ3aWAU +DGvx1U8pkloCiJwEEAECAAYFAkt+6vIACgkQnBy94uNcVjWGswQAhqDOQ8Os3gOo +UAGm/Oju6t6JG4wxLyl7vlMZ2eQHAX8rJ99Q4kyJB9xR4uaZ42BwbPx3s25N67qb +6z/ZAMrtqsXuK90+WlwykxG1uq4FOznHU6QT7cyO48Yeoq2PO1kFgQuRESPCRxXV +8dmDgeoDQ0EDO1Ykm003AKCd0N7+n1CInAQQAQIABgUCS37q9wAKCRA4IttHzDdP +LXmrA/4r9bzS6YnAHE0MFzByA2uZq0HeyrHI/Q6ELzqeMjuu/CwKdki/8gzz6Zt3 +KkXbqd9mPidsi/nqfUwQlqMHCFSRTyqw3FkGzQ/wk9fk4G+AF+5A//xGFIACHd54 +a/1+k0iVM5GNQkrknltYps0TmW8priU1uzmzAHpsCh0e4xFDIYicBBABAgAGBQJL +fur9AAoJEIlpYrhnjAoD9mQD/0s7tHTX+Mzt7iwZzsAZEqoxSQS5dUAKK+j6GR5K +8/cWcdiDJwCABViIn+TT7/GDmTlA4EUKQzIMPDfuagqa1SPxKXgivUnfhmpJVAma +MUmZeGFQyfTBjp4qZ+Agk15Ulnz7arqmOmeAWSvdsJ/vCm44TCEDO1gIjLzgyOIc +ktU5iJwEEAECAAYFAkt+6wQACgkQIYPhsTlvB4lH8wQAyqIKclShWxxaXi6YpS/k +H+susHMVePzBPyEmv93UkSOj2bdMWuhVENPXlBn1UnFt0vKPOL+krF3+zIAjg6N6 +zFlasBUL9p2HqRI35Sq4cn3S3Im4vZIPwWNYgtQY41Hc1Gx2pIxmKtIz+9+sUiTE +DGrTxnzUAohPaTzUVXPtWOuInAQQAQIABgUCS37rCgAKCRDI1e0plfYXcQXaA/9D ++sQJdEc1orgN/aTVGKkKoNyMmJhtNLECYIsfAYcE9lMGtymkkli0BrvrtNN1Co6P +qmR+oaZSmeyq0qNVdV8AnoyFI5Dk3Nir82ISOtvzuNzn8NrosSed0nyVmg88amTa +WoJS7as6s6/lCxuarGwRuHA7vXaxDg92lCYeTw09I4icBBABAgAGBQJLfusSAAoJ +EHCgJE0e+ZJRWiMD/i65FDmbZo0srV01XwSUb8EF/70RF0uOxrGfunMin93cR8VW +mNSzcydfH/mKR1Rf4Snsz9hp9NWryZpjVXrPJx6GOBzzwgyUtzAxH6OElv7rlK2Y +XJ+Xi94djsyB56e6PKHA1uB30g2l5beh0bDUEa9mLfstTidMWGXRdtnVtW5KiJwE +EAECAAYFAkt+6yAACgkQHnuzyK+VliU0OQQApyvdx0YKiDL7EuLf/QkOk64DRAKf +7rxZSlN5jHnNJSQeX7cMRBcklbl/GlZH2oyHdDuahrZ62MT/mCneRIH58lf8c91h +WLFjkpU/j8Md8ahFQDWpCwNSSwz4tqZyhKfeP/w0OaHC4ttAwbjKk6mn0wFpWxpH +sYFc08L5PoUyaQaInAQQAQIABgUCS37rJAAKCRCXQwEYcJO4QR+cA/9EEv5UJCgt +0glLmhIzpvGxlEyzhVqhtfDE8CI06lOSGWhYy4VCcOCho8ig+atxU1+/zPaJGIbI +mvR+kuPZ9kmtd+LtV6fWtp7U6FrAZSXV6paWHc9ZCLJeKSNwmRrcOqaBEjj3MqNA +pwXO3gCiuylHzgIo05+FxRho91AS/mciI4icBBABAgAGBQJLfusoAAoJENiq8Mr2 +swcppz4EALJ3JQOIPsvgptuPdq8XZuxxuFonjcr8RaLB89a9MDduFBM8zw/Q0qcA +asltDtQidMwn+VCDQavkrpEM2QbNxFfhbdnw5c97CvovgmTATPaR2XZ7LaeIwE36 +HLL5e5/k0BThiqymD3tjaFbx7uTK2o3ZTyMvbjtqMOdt0eLqFvHRiJwEEAECAAYF +Akt+6ywACgkQwCnKQBb0zOnn+AP+OdZu4BowBVYzmygmM1O7XyiEMd5TB3MxwkZR +8+rGW8Xcl4JtLY9iiXzfakTHuP3OrINrhXnMQLAY46kAcUc+VcHvLdMth6btsltE +Jjc33aZovPRabCeKVCnDKcEPRYclsXgGStXlFMoacI2KUUENZeGCUr0NJb7RnAk5 +Pfuib+mInAQQAQIABgUCS37rVgAKCRDBnB0lEtNGHcMMA/9mYtgCaK/zihws7d4V +p+uQXKjnfhKZx4XX33BoUFgxC2N5/TB6qd0sBnaUYby/DDGh6W3721dGTw66i9vF +Wn2IJ6JUj4CpLCCFVb9FxPdjrt/F1eKg8N1SOfVQg0D9Nkl48Y81tIf0xcMa9yuV +8qssX8baTDhatDGFIZlYPfGpZIicBBABAgAGBQJLg2FTAAoJEM8etQMiMnoByVwD +/3iim8IBm3ssOFJ58RR9wFPgH7INTiE28vO5yO+f2i0/cEdWwJDwmqOpKhUM7DWy +LeK7LaZWzViuxh83ZI2KlcJJksdFtohuzyJul/phyaQYDPGlgu7AIthNm49pdDnR +0AAQl98ccn0iT69Zp3Fi5fRMHVC4ChBsBir5JjJBh0aliJwEEAECAAYFAkuDdtQA +CgkQvdqP1j/qff0GMwQAqgbWFQsOoEzzwSDo/SEun8gmRRLUH8vWx5Us659x2nQy +BPtp8w2HpqKsyMn2E4TavKjyzUZPINziPVszXhG+dtCFuOQvRFFZzFQccdhAIB8o +KJ7y/LRa7MpvIMRFJOURBnJgQ3asUojRcksd+rgMqujFrwyYN5J+LeXwBXS9eMSI +nAQQAQIABgUCS4N2+gAKCRB8S2dtoA4VY6KoA/91U29DqRR0XRlk+KdRs6Qjo/R0 +lQp7uUtuP55xJkv+UMPVhABbMOR+/sjE8eUJdMpHfaQmdG89M5VZ+Ck2MZrhjveE +acNH/sIWCDvIFV5gheNZycpp+wH2VO7+i9bWmMVl4JKK0grFRYQMqiqT+tHYfXS3 +MVQH8U4EhwnFuwFrgoicBBABAgAGBQJLg3cQAAoJENbgof5PvirdPboD/jUU/UV7 +7jGtnW9+xrsUUDcHeU8Ha/VKXfKts4Z0KifWYnjUOH5jR/OqYzHy7vAOyGpyrziN +eJHLM/I8AuTtmsCY3IpfhaeRg4ZkJYRqx5QkhfUesOpPfKVPYtoF53Uw04iu0dtv +2bFftaX0tX/hKhWmzobllBGM9b5E4G+kHCRZiEYEEBECAAYFAkuEoagACgkQCaei +StHlggfktQCgjyKOB4tlm9WnufcJaYIbchyZVSQAn3thzs5akheaVsVwBHSmpJyk +PDRbiJwEEAECAAYFAkuFS4UACgkQXx7Ib4gMnlUZEQP9HoutmYz6pAB8XEADTKrR +wTWGqu/S4V6zhSJbIYSDIFAY+WeKCTUdVO8eFfrPIrS459z8yQ3PgFKL3QMp1VgX +jMGPcvfHOjWh1jSw5W1aLcJX428T0oybgLZLvPT7QXpIwKcY8TtS/jjVTaepIqIG +9tmQupstoaw/h9b1vHY7R7uIRgQQEQIABgUCS4Uc9QAKCRCWnNphS7Y2SyT5AKCE +1AR60B2GDZ75U2kaNe/SyOQJ3ACfVtndQ22edDOB1INak6SyfYv9ZuSIRgQQEQIA +BgUCS4TumQAKCRCiu/skDPlW9we5AKC6dNVZjpg/yDQiepI2E0XZ222vzACeJ7Ds +41t2z3BT4qGJyZrpGK8G3kKIRgQQEQIABgUCS4TuuQAKCRD7VAFa+haI7WniAKCY +mNr9FG/180EcUY/tgaHNuUDXtwCfX0DYjxL9ExvQ7wB2uXB2M7AwGxSIRgQQEQIA +BgUCS4Ts4wAKCRCgT/sbfcrp09HnAJ0dELKCp7WoOoAPVBHez/sfHAmgAwCdG64t +bjYwj5CamCOhDvuNjfbUpBSIRgQQEQIABgUCS4W+PgAKCRDCeBwaRrHv4S4EAKCV +LKV3q7PiVV5rb9T+s5uyrETBsgCfUVhchd+Ha5nbduvnF25C0Eswouq5AQ0ES37q +CgEIAK8GnjvPPqWqcNCmLyuscuTKPjqTyaA3xVVYNX+8hMD1iK4VAGf3QfKExVnN +QLvLpnknnKK/caaXFME9t4L0BTjCJRYJiDpoWImwu5fTRIyfIIy4vv5vPErqqKen +7dII6gptC2i538ntj7k8qkhewKJuTOVpE1eLHe3RxuP8rsv1AsvjJ+6WGZlFYINZ ++d0pxSOhdPN9WoTCl9JfkTQrnoVPClzG/euOkF5fUThL90gt31iN+RjB5DeWTPB/ +jDrq6t5spA8hTKvQ+UB65chI6TzrCr+k8f5D9AR0Fkf9KPFOL7+U9o6Ap9yur5sn +njDP4fFVhazVyljUwwPvJ5jjS1cAEQEAAYkBHwQYAQIACQUCS37qCgIbDAAKCRBg +TfvyhUEKvpWAB/0YnkJx6/5rIwDh1u5iFdboUCEsX92n9eOilPWw1NWbq/Gdx7+Z +xoRjrGl8e8SxOZJbfyehgPX8NxOrkBfcAOOXmOvXSO1i3HSo2gaQxVh1urXojzID +raUMcltcNeQagdtDfPhYnS25vJnj+H29Dal2FwLJb9wp8QH1DdhUBoqeRQH34REu +fWu0LjF87JjUELhZe0Op4B8HnQV9oGo7W4IYw/3Ek6c5As+WIWSaz0NmHP2Xw+kI +kpC4BVIwG0l2mChAT8Ds+rDLGYA2dxYK39mFSApem2KiXFhAanDBb5XgilmeDepk +A4NAZlDwxoivB/5PTy67pX+AC1JgvPPafUMu +=6Xeh +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use pub 1024 0xA77F2429 2009-01-01 ---------- RSA Sign & Encrypt f16 Fingerprint16 = 33 3A 62 61 2C F3 21 AA 4E 87 47 F2 2F 2C 40 4D uid Sendmail Signing Key/2009 @@ -1865,4 +2082,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.29 $, Last updated $Date: 2009/01/06 05:59:03 $ +$Revision: 8.36 $, Last updated $Date: 2011/01/28 21:17:54 $ Modified: stable/8/contrib/sendmail/RELEASE_NOTES ============================================================================== --- stable/8/contrib/sendmail/RELEASE_NOTES Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/RELEASE_NOTES Mon Jun 20 01:43:14 2011 (r223315) @@ -1,11 +1,75 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.1963 2009/12/23 04:43:46 ca Exp $ + $Id: RELEASE_NOTES,v 8.1991 2011/05/15 04:28:16 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.5/8.14.5 2011/05/17 + Do not cache SMTP extensions across connections as the cache + is based on hostname which may not be a unique identifier + for a server, i.e., different machines may have the + same hostname but provide different SMTP extensions. + Problem noted by Jim Hermann. + Avoid an out-of-bounds access in case a resolver reply for a DNS + map lookup returns a size larger than 1K. Based on a + patch from Dr. Werner Fink of SuSE. + If a job is aborted using the interrupt signal (e.g., control-C from + the keyboard), perform minimal cleanup to avoid invoking + functions that are not signal-safe. Note: in previous + versions the mail might have been queued up already + and would be delivered subsequently, now an interrupt + will always remove the queue files and thus prevent + delivery. + Per RFC 6176, when operating as a TLS client, do not offer SSLv2. + Since TLS session resumption is never used as a client, disable + use of RFC 4507-style session tickets. + Work around gcc4 versions which reverse 25 years of history and + no longer align char buffers on the stack, breaking calls + to resolver functions on strict alignment platforms. + Found by Stuart Henderson of OpenBSD. + Read at most two AUTH lines from a server greeting (up to two + lines are read because servers may use "AUTH mechs" and + "AUTH=mechs"). Otherwise a malicious server may exhaust + the memory of the client. Bug report by Nils of MWR + InfoSecurity. + Avoid triggering an assertion in the OpenLDAP code when the + connection to an LDAP server is lost while making a query. + Problem noted and patch provided by Andy Fiddaman. + If ConnectOnlyTo is set and sendmail is compiled with NETINET6 + it would try to use an IPv6 address if an IPv4 (or + unparseable) address is specified. + If SASLv2 is used, make sure that the macro {auth_authen} is + stored in xtext format to avoid problems with parsing + it. Problem noted by Christophe Wolfhugel. + CONFIG: FEATURE(`ldap_routing') in 8.14.4 tried to add a missing + -T that is required, but failed for some cases + that did not use LDAP. This change has been undone + until a better solution can be implemented. Problem + found by Andy Fiddaman. + CONFIG: Add cf/ostype/solaris11.m4 for Solaris11 support. + Contributed by Casper Dik of Oracle. + CONTRIB: qtool.pl: Deal with H entries that do not have a + letter between the question marks. Patch from + Stefan Christensen. + DOC: Use a better description for the -i option in sendmail. + Patch from Mitchell Berger. + Portability: + Add support for Darwin 10.x (Mac OS X 10.6). + Enable HAVE_NANOSLEEP for FreeBSD 3 and later. Patch + from John Marshall. + Enable HAVE_NANOSLEEP for OpenBSD 4.3 and later. + Use new directory "/system/volatile" for PidFile on + Solaris 11. Patch from Casper Dik of Oracle. + Fix compilation on Solaris 11 (and maybe some other + OSs) when using OpenSSL 1.0. Based on patch from + Jan Pechanec of Oracle. + Set SOCKADDR_LEN_T and SOCKOPT_LEN_T to socklen_t + for Solaris 11. Patch from Roger Faulkner of Oracle. + New Files: + cf/ostype/solaris11.m4 + 8.14.4/8.14.4 2009/12/30 SECURITY: Handle bogus certificates containing NUL characters in CNs by placing a string indicating a bad certificate Modified: stable/8/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- stable/8/contrib/sendmail/cf/cf/submit.cf Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/cf/cf/submit.cf Mon Jun 20 01:43:14 2011 (r223315) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Tue Dec 22 20:49:09 PST 2009 -##### in /extra/home/ca/sm-8.14.4/OpenSource/sendmail-8.14.4/cf/cf +##### built by ca@wiz.smi.sendmail.com on Sat May 14 21:31:14 PDT 2011 +##### in /extra/home/ca/sm-8.14.5/OpenSource/sendmail-8.14.5/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -27,7 +27,7 @@ ###################################################################### ###################################################################### -##### $Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $ ##### +##### $Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $ ##### ##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ ##### ##### $Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $ ##### ##### $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $ ##### @@ -35,7 +35,7 @@ ##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ ##### -##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ ##### +##### $Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.4/Submit +DZ8.14.5/Submit ############### @@ -992,7 +992,6 @@ R< $* > $* $: $2 - ###################################################################### ### check_mail -- check SMTP `MAIL FROM:' command argument ###################################################################### Modified: stable/8/contrib/sendmail/cf/feature/ldap_routing.m4 ============================================================================== --- stable/8/contrib/sendmail/cf/feature/ldap_routing.m4 Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/cf/feature/ldap_routing.m4 Mon Jun 20 01:43:14 2011 (r223315) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1999-2002, 2004, 2007, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1999-2002, 2004, 2007 Sendmail, Inc. and its suppliers. # All rights reserved. # # By using this file, you agree to the terms and conditions set @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: ldap_routing.m4,v 8.17 2009/06/26 21:11:08 ca Exp $') +VERSIONID(`$Id: ldap_routing.m4,v 8.18 2010/01/05 00:57:27 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 @@ -35,40 +35,12 @@ ifelse(len(X`'_ARG6_), `1', `define(`_LD _ARG6_, `tempfail', `define(`_LDAP_ROUTE_MAPTEMP_', `_TEMPFAIL_')', _ARG6_, `queue', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')') -define(`_ATMPF_', `')dnl -dnl check whether arg contains -T`'_ATMPF_ -dnl unless it is a sequence map or just LDAP -dnl note: this does not work if ARG1 begins with space(s), however, as -dnl we issue a warning, hopefully the user will fix it... -ifelse(defn(`_ARG1_'), `', `', - defn(`_ARG1_'), `LDAP', `', - `ifelse(index(_ARG1_, `sequence '), `0', `', - `ifelse(index(_ARG1_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in first argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG1_, ` ')) - define(`_NARG1_', `substr(_ARG1_, 0, _ABP_) -T'_ATMPF_` substr(_ARG1_, _ABP_)') - ') - ') - ') -ifelse(defn(`_ARG2_'), `', `', - defn(`_ARG2_'), `LDAP', `', - `ifelse(index(_ARG2_, `sequence '), `0', `', - `ifelse(index(_ARG2_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in second argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG2_, ` ')) - define(`_NARG2_', `substr(_ARG2_, 0, _ABP_) -T'_ATMPF_` substr(_ARG2_, _ABP_)') - ') - ') - ') - LOCAL_CONFIG # LDAP routing maps Kldapmh ifelse(len(X`'_ARG1_), `1', `ldap -1 -T -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG1_'), `', `_ARG1_', `_NARG1_') + `_ARG1_') Kldapmra ifelse(len(X`'_ARG2_), `1', `ldap -1 -T -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG2_'), `', `_ARG2_', `_NARG2_') + `_ARG2_') Modified: stable/8/contrib/sendmail/cf/m4/cfhead.m4 ============================================================================== --- stable/8/contrib/sendmail/cf/m4/cfhead.m4 Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/cf/m4/cfhead.m4 Mon Jun 20 01:43:14 2011 (r223315) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -189,6 +189,7 @@ SLocal_tls_server') define(`LOCAL_RULE_3', `divert(2)') define(`LOCAL_CONFIG', `divert(6)') define(`MAILER_DEFINITIONS', `divert(7)') +define(`LOCAL_DNSBL', `divert(8)') define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)') define(`CONCAT', `$1$2$3$4$5$6$7') @@ -308,4 +309,4 @@ define(`confMILTER_MACROS_EOM', `{msg_id divert(0)dnl -VERSIONID(`$Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $') +VERSIONID(`$Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $') Modified: stable/8/contrib/sendmail/cf/m4/proto.m4 ============================================================================== --- stable/8/contrib/sendmail/cf/m4/proto.m4 Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/cf/m4/proto.m4 Mon Jun 20 01:43:14 2011 (r223315) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -13,10 +13,10 @@ divert(-1) # divert(0) -VERSIONID(`$Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $') +VERSIONID(`$Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $') # level CF_LEVEL config file format -V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') +V`'CF_LEVEL`'ifdef(`NO_VENDOR',`', `/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')') divert(-1) dnl if MAILER(`local') not defined: do it ourself; be nice @@ -1795,7 +1795,7 @@ ifdef(`_CONN_CONTROL_',`dnl ifdef(`_CONN_CONTROL_IMMEDIATE_',`',`dnl dnl workspace: ignored... R$* $: $>"ConnControl" dummy')', `dnl') -undivert(8) +undivert(8)dnl LOCAL_DNSBL ifdef(`_REQUIRE_RDNS_', `dnl R$* $: $&{client_addr} $| $&{client_resolve} R$=R $* $@ RELAY We relay for these Modified: stable/8/contrib/sendmail/cf/m4/version.m4 ============================================================================== --- stable/8/contrib/sendmail/cf/m4/version.m4 Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/cf/m4/version.m4 Mon Jun 20 01:43:14 2011 (r223315) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Id: version.m4,v 8.205 2009/12/23 04:43:09 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.214 2011/04/26 23:02:36 ca Exp $') # divert(0) # Configuration version number -DZ8.14.4`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.5`'ifdef(`confCF_VERSION', `/confCF_VERSION') Copied: stable/8/contrib/sendmail/cf/ostype/solaris11.m4 (from r223067, head/contrib/sendmail/cf/ostype/solaris11.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/contrib/sendmail/cf/ostype/solaris11.m4 Mon Jun 20 01:43:14 2011 (r223315, copy of r223067, head/contrib/sendmail/cf/ostype/solaris11.m4) @@ -0,0 +1,22 @@ +divert(-1) +# +# Copyright (c) 2011 Sendmail, Inc. and its suppliers. +# All rights reserved. +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the sendmail distribution. +# +# This ostype file is suitable for use on Solaris 11 and later systems, +# make use of /system/volatile, introduced in Solaris 11. +# + +divert(0) +VERSIONID(`$Id: solaris11.m4,v 1.1 2011/01/24 21:22:08 ca Exp $') +divert(-1) + +ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')') +define(`confEBINDIR', `/usr/lib')dnl +define(`confPID_FILE', `/system/volatile/sendmail.pid')dnl +define(`_NETINET6_')dnl +FEATURE(`local_lmtp')dnl Modified: stable/8/contrib/sendmail/contrib/qtool.pl ============================================================================== --- stable/8/contrib/sendmail/contrib/qtool.pl Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/contrib/qtool.pl Mon Jun 20 01:43:14 2011 (r223315) @@ -3,7 +3,7 @@ ## Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. ## All rights reserved. ## -## $Id: qtool.pl,v 8.30 2009/03/04 16:57:30 ca Exp $ +## $Id: qtool.pl,v 8.31 2010/11/10 19:11:54 ca Exp $ ## use strict; use File::Basename; @@ -607,7 +607,7 @@ sub parse_header $first_char = substr($line, 0, 1); if ($first_char eq "?") { - $line = substr($line, 3); + $line = (split(/\?/, $line,3))[2]; } elsif ($first_char eq "\t") { Modified: stable/8/contrib/sendmail/doc/op/op.me ============================================================================== --- stable/8/contrib/sendmail/doc/op/op.me Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/doc/op/op.me Mon Jun 20 01:43:14 2011 (r223315) @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: op.me,v 8.745 2009/12/13 04:12:46 ca Exp $ +.\" $Id: op.me,v 8.747 2010/05/08 04:18:27 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 8.745 $ +.Ve $Revision: 8.747 $ .rm Ve .sp For Sendmail Version 8.14 @@ -1095,6 +1095,9 @@ The number of envelope recipients for th (after aliasing and forwarding). .ip msgid The message id of the message (from the header). +.ip bodytype +The message body type (7BIT or 8BITMIME), +as determined from the envelope. .ip proto The protocol used to receive this message (e.g., ESMTP or UUCP) .ip daemon @@ -5154,7 +5157,8 @@ FAIL cert presented but could not be ver e.g., the signing CA is missing. NONE STARTTLS has not been performed. TEMP temporary error occurred. -PROTOCOL some protocol error occurred. +PROTOCOL some protocol error occurred + at the ESMTP level (not TLS). SOFTWARE STARTTLS handshake failed, which is a fatal error for this session, the e-mail will be queued. @@ -11463,7 +11467,7 @@ replace it with a blank sheet for double .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 8.745 $ +.\"Version $Revision: 8.747 $ .\".ce 0 .bp 3 .ce Modified: stable/8/contrib/sendmail/include/sm/conf.h ============================================================================== --- stable/8/contrib/sendmail/include/sm/conf.h Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/include/sm/conf.h Mon Jun 20 01:43:14 2011 (r223315) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $ + * $Id: conf.h,v 1.144 2011/05/03 16:24:00 ca Exp $ */ /* @@ -381,6 +381,12 @@ typedef int pid_t; # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ +# if SOLARIS >= 21100 +# include +# endif /* SOLARIS >= 21100 */ +# ifndef _PATH_VARRUN +# define _PATH_VARRUN "/var/run/" +# endif /* _PATH_VARRUN */ # define GIDSET_T gid_t # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ @@ -443,7 +449,7 @@ typedef int pid_t; # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ -# define _PATH_SENDMAILPID "/var/run/sendmail.pid" +# define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid" # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/var/adm/sm.bin" # endif /* ! SMRSH_CMDDIR */ @@ -461,6 +467,8 @@ typedef int pid_t; # if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) # define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ # define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */ +# define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */ +# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ # endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ @@ -1014,6 +1022,9 @@ extern unsigned int sleepX __P((unsigned # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ # endif /* __FreeBSD_version >= 222000 */ +# if __FreeBSD_version >= 300000 /* 3.0.0-release and later */ +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* __FreeBSD_version >= 300000 */ # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/usr/libexec/sm.bin" @@ -1055,6 +1066,9 @@ extern unsigned int sleepX __P((unsigned # if OpenBSD >= 200505 # undef NETISO /* iso.h removed in 3.7 */ # endif /* OpenBSD >= 200505 */ +# if OpenBSD >= 200800 +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* OpenBSD >= 200800 */ # endif /* defined(__OpenBSD__) */ # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ @@ -2808,7 +2822,7 @@ struct utsname # if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 /* - ** override Linux wierdness: a FQHN can be 255 chars long + ** override Linux weirdness: a FQHN can be 255 chars long ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host ** name (not including the terminating null) as returned from the ** gethostname() function.") to be at least 255. c.f.: Modified: stable/8/contrib/sendmail/libmilter/docs/overview.html ============================================================================== --- stable/8/contrib/sendmail/libmilter/docs/overview.html Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/libmilter/docs/overview.html Mon Jun 20 01:43:14 2011 (r223315) @@ -4,7 +4,7 @@

Technical Overview

@@ -126,7 +126,7 @@ messages may be sent in a single connect Note also that a message or connection may be aborted by either the remote host or the MTA at any point during the SMTP transaction. -f this occurs during a message (between the MAIL command and the final "."), +If this occurs during a message (between the MAIL command and the final "."), the filter's xxfi_abort routine will be called. xxfi_close is called any time the Modified: stable/8/contrib/sendmail/libmilter/docs/smfi_stop.html ============================================================================== --- stable/8/contrib/sendmail/libmilter/docs/smfi_stop.html Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/libmilter/docs/smfi_stop.html Mon Jun 20 01:43:14 2011 (r223315) @@ -2,7 +2,7 @@ smfi_stop

smfi_stop

@@ -42,7 +42,7 @@ which may then exit or warm-restart. -
ArgumentDescription
voidTakes no arguement. + Takes no argument.
Modified: stable/8/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html ============================================================================== --- stable/8/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Mon Jun 20 01:43:14 2011 (r223315) @@ -2,7 +2,7 @@ xxfi_envrcpt

xxfi_envrcpt

@@ -71,7 +71,8 @@ Handle the envelope RCPT command. SMFIS_ACCEPT - Accept recipient. xxfi_abort will not be called. + Accept this message. + xxfi_abort will not be called. @@ -87,7 +88,7 @@ Handle the envelope RCPT command.
-Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2000, 2003, 2010 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set Modified: stable/8/contrib/sendmail/libmilter/engine.c ============================================================================== --- stable/8/contrib/sendmail/libmilter/engine.c Mon Jun 20 00:46:07 2011 (r223314) +++ stable/8/contrib/sendmail/libmilter/engine.c Mon Jun 20 01:43:14 2011 (r223315) @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: engine.c,v 8.166 2009/11/06 00:57:07 ca Exp $") +SM_RCSID("@(#)$Id: engine.c,v 8.167 2011/03/03 06:09:15 ca Exp $") #include "libmilter.h" @@ -284,7 +284,7 @@ mi_engine(ctx) if (mi_stop() == MILTER_ABRT) { if (ctx->ctx_dbg > 3) - sm_dprintf("[%ld] milter_abort\n", + sm_dprintf("[%lu] milter_abort\n", (long) ctx->ctx_id); ret = MI_FAILURE; break; @@ -315,7 +315,7 @@ mi_engine(ctx) cmd < SMFIC_VALIDCMD) { if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] mi_engine: mi_rd_cmd error (%x)\n", + sm_dprintf("[%lu] mi_engine: mi_rd_cmd error (%x)\n", (long) ctx->ctx_id, (int) cmd); /* @@ -328,7 +328,7 @@ mi_engine(ctx) break; } if (ctx->ctx_dbg > 4) - sm_dprintf("[%ld] got cmd '%c' len %d\n", + sm_dprintf("[%lu] got cmd '%c' len %d\n", (long) ctx->ctx_id, cmd, (int) len); for (i = 0; i < ncmds; i++) { @@ -339,7 +339,7 @@ mi_engine(ctx) { /* unknown command */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' unknown\n", + sm_dprintf("[%lu] cmd '%c' unknown\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -348,7 +348,7 @@ mi_engine(ctx) { /* stop for now */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' not impl\n", + sm_dprintf("[%lu] cmd '%c' not impl\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -357,14 +357,14 @@ mi_engine(ctx) /* is new state ok? */ newstate = cmds[i].cm_next; if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] cur %x new %x nextmask %x\n", + sm_dprintf("[%lu] cur %x new %x nextmask %x\n", (long) ctx->ctx_id, curstate, newstate, next_states[curstate]); if (newstate != ST_NONE && !trans_ok(curstate, newstate)) { if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] abort: cur %d (%x) new %d (%x) next %x\n", + sm_dprintf("[%lu] abort: cur %d (%x) new %d (%x) next %x\n", (long) ctx->ctx_id, curstate, MI_MASK(curstate), newstate, MI_MASK(newstate), @@ -434,7 +434,7 @@ mi_engine(ctx) else if (r == _SMFIS_ABORT) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 01:43:19 2011 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 4CD001065670; Mon, 20 Jun 2011 01:43:19 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C7338FC08; Mon, 20 Jun 2011 01:43: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 p5K1hJtd018119; Mon, 20 Jun 2011 01:43:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1hJ0d018117; Mon, 20 Jun 2011 01:43:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200143.p5K1hJ0d018117@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 01:43: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: r223316 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 01:43:19 -0000 Author: nwhitehorn Date: Mon Jun 20 01:43:18 2011 New Revision: 223316 URL: http://svn.freebsd.org/changeset/base/223316 Log: Make this slightly less yelly about regions that the hypervisor protects from us by not registering them as disks. Modified: head/sys/powerpc/ps3/ps3disk.c Modified: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 01:43:14 2011 (r223315) +++ head/sys/powerpc/ps3/ps3disk.c Mon Jun 20 01:43:18 2011 (r223316) @@ -274,6 +274,8 @@ ps3disk_attach(device_t dev) } for (i = 0; i < sc->sc_nregs; i++) { + struct ps3disk_region *rp = &sc->sc_reg[i]; + d = sc->sc_disk[i] = disk_alloc(); d->d_open = ps3disk_open; d->d_close = ps3disk_close; @@ -293,10 +295,16 @@ ps3disk_attach(device_t dev) mb /= 1024; } - device_printf(dev, "region %d %ju%cB\n", i, mb, unit); + /* Test to see if we can read this region */ + err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit, + 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag); + device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit, + (err == 0) ? "" : " (hypervisor protected)"); - disk_create(d, DISK_VERSION); + if (err == 0) + disk_create(d, DISK_VERSION); } + err = 0; bioq_init(&sc->sc_bioq); From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 01:48:49 2011 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 81A811065670; Mon, 20 Jun 2011 01:48:49 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 708678FC15; Mon, 20 Jun 2011 01: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 p5K1mnEv018417; Mon, 20 Jun 2011 01:48:49 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1mnio018415; Mon, 20 Jun 2011 01:48:49 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200148.p5K1mnio018415@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 01:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223317 - stable/8/etc/sendmail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 01:48:49 -0000 Author: gshapiro Date: Mon Jun 20 01:48:49 2011 New Revision: 223317 URL: http://svn.freebsd.org/changeset/base/223317 Log: MFC: Update DNSBL information (MAPS has been acquired, used a generic example) Modified: stable/8/etc/sendmail/freebsd.mc Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/sendmail/freebsd.mc ============================================================================== --- stable/8/etc/sendmail/freebsd.mc Mon Jun 20 01:43:18 2011 (r223316) +++ stable/8/etc/sendmail/freebsd.mc Mon Jun 20 01:48:49 2011 (r223317) @@ -66,12 +66,10 @@ dnl so this file will not serve as a dat dnl For that, visit dnl http://www.google.com/Top/Computers/Internet/E-mail/Spam/Blacklists/ -dnl Uncomment to activate Realtime Blackhole List -dnl information available at http://www.mail-abuse.com/ -dnl NOTE: This is a subscription service as of July 31, 2001 -dnl FEATURE(dnsbl) +dnl Uncomment to activate your chosen DNS based blacklist +dnl FEATURE(dnsbl, `dnsbl.example.com') dnl Alternatively, you can provide your own server and rejection message: -dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', ``"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}'') +dnl FEATURE(dnsbl, `dnsbl.example.com', ``"550 Mail from " $&{client_addr} " rejected'') dnl Dialup users should uncomment and define this appropriately dnl define(`SMART_HOST', `your.isp.mail.server') From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 01:50:13 2011 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 27C1A106566B; Mon, 20 Jun 2011 01:50:13 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16A558FC12; Mon, 20 Jun 2011 01:50: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 p5K1oCMn018532; Mon, 20 Jun 2011 01:50:12 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1oC4d018530; Mon, 20 Jun 2011 01:50:12 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200150.p5K1oC4d018530@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 01:50: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: r223318 - stable/8/etc/sendmail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 01:50:13 -0000 Author: gshapiro Date: Mon Jun 20 01:50:12 2011 New Revision: 223318 URL: http://svn.freebsd.org/changeset/base/223318 Log: MFC: Minor change to force commit this file so new freebsd*.cf files are built to use the new sendmail-8.14.5/cf tree. Modified: stable/8/etc/sendmail/freebsd.submit.mc Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/sendmail/freebsd.submit.mc ============================================================================== --- stable/8/etc/sendmail/freebsd.submit.mc Mon Jun 20 01:48:49 2011 (r223317) +++ stable/8/etc/sendmail/freebsd.submit.mc Mon Jun 20 01:50:12 2011 (r223318) @@ -25,4 +25,3 @@ define(`confBIND_OPTS', `WorkAroundBroke dnl dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1] FEATURE(`msp', `[127.0.0.1]')dnl - From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 01:56:49 2011 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 7AB32106564A; Mon, 20 Jun 2011 01:56:49 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 697418FC08; Mon, 20 Jun 2011 01:56: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 p5K1unoN018791; Mon, 20 Jun 2011 01:56:49 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K1un8p018789; Mon, 20 Jun 2011 01:56:49 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200156.p5K1un8p018789@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 01:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223319 - stable/8/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: Mon, 20 Jun 2011 01:56:49 -0000 Author: gshapiro Date: Mon Jun 20 01:56:49 2011 New Revision: 223319 URL: http://svn.freebsd.org/changeset/base/223319 Log: sendmail has been updated to 8.14.5 Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 20 01:50:12 2011 (r223318) +++ stable/8/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 20 01:56:49 2011 (r223319) @@ -1209,6 +1209,9 @@ OpenSSL has been updated to version 0.9.8q. + sendmail has been updated to + version 8.14.5. + The timezone database has been updated to the tzdata2010o release. From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 02:04:21 2011 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 74BBD106564A; Mon, 20 Jun 2011 02:04:21 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 608A08FC16; Mon, 20 Jun 2011 02:04: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 p5K24LxO019120; Mon, 20 Jun 2011 02:04:21 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K24Kfv019099; Mon, 20 Jun 2011 02:04:20 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200204.p5K24Kfv019099@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 02:04:20 +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: r223320 - in stable/7/contrib/sendmail: . cf/cf cf/feature cf/m4 cf/ostype contrib doc/op include/sm libmilter libmilter/docs libsm makemap 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: Mon, 20 Jun 2011 02:04:21 -0000 Author: gshapiro Date: Mon Jun 20 02:04:20 2011 New Revision: 223320 URL: http://svn.freebsd.org/changeset/base/223320 Log: Merge sendmail 8.14.5 to RELENG_7 Added: stable/7/contrib/sendmail/cf/ostype/solaris11.m4 - copied unchanged from r223067, head/contrib/sendmail/cf/ostype/solaris11.m4 Modified: stable/7/contrib/sendmail/CACerts stable/7/contrib/sendmail/FREEBSD-upgrade stable/7/contrib/sendmail/KNOWNBUGS stable/7/contrib/sendmail/LICENSE stable/7/contrib/sendmail/PGPKEYS stable/7/contrib/sendmail/RELEASE_NOTES stable/7/contrib/sendmail/cf/cf/submit.cf stable/7/contrib/sendmail/cf/feature/ldap_routing.m4 stable/7/contrib/sendmail/cf/m4/cfhead.m4 stable/7/contrib/sendmail/cf/m4/proto.m4 stable/7/contrib/sendmail/cf/m4/version.m4 stable/7/contrib/sendmail/contrib/qtool.pl stable/7/contrib/sendmail/doc/op/op.me stable/7/contrib/sendmail/include/sm/conf.h stable/7/contrib/sendmail/libmilter/docs/overview.html stable/7/contrib/sendmail/libmilter/docs/smfi_stop.html stable/7/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html stable/7/contrib/sendmail/libmilter/engine.c stable/7/contrib/sendmail/libmilter/sm_gethost.c stable/7/contrib/sendmail/libmilter/worker.c stable/7/contrib/sendmail/libsm/ldap.c stable/7/contrib/sendmail/makemap/makemap.c stable/7/contrib/sendmail/src/Makefile.m4 stable/7/contrib/sendmail/src/conf.c stable/7/contrib/sendmail/src/daemon.c stable/7/contrib/sendmail/src/deliver.c stable/7/contrib/sendmail/src/domain.c stable/7/contrib/sendmail/src/envelope.c stable/7/contrib/sendmail/src/err.c stable/7/contrib/sendmail/src/main.c stable/7/contrib/sendmail/src/map.c stable/7/contrib/sendmail/src/mci.c stable/7/contrib/sendmail/src/parseaddr.c stable/7/contrib/sendmail/src/queue.c stable/7/contrib/sendmail/src/readcf.c stable/7/contrib/sendmail/src/sendmail.8 stable/7/contrib/sendmail/src/sendmail.h stable/7/contrib/sendmail/src/sm_resolve.c stable/7/contrib/sendmail/src/srvrsmtp.c stable/7/contrib/sendmail/src/tls.c stable/7/contrib/sendmail/src/udb.c stable/7/contrib/sendmail/src/usersmtp.c stable/7/contrib/sendmail/src/version.c Directory Properties: stable/7/contrib/sendmail/ (props changed) Modified: stable/7/contrib/sendmail/CACerts ============================================================================== --- stable/7/contrib/sendmail/CACerts Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/CACerts Mon Jun 20 02:04:20 2011 (r223320) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.4 2009/06/26 05:46:10 ca Exp $ +# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -9,73 +9,6 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Validity - Not Before: May 12 00:40:50 2000 GMT - Not After : May 20 00:40:50 2010 GMT - Subject: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b1:1b:49:06:ef:3f:44:e0:93:ad:8c:a7:f7:21: - 7c:87:cb:da:35:f6:4b:a2:fd:8a:a0:07:5b:cc:6a: - 9b:89:33:fc:24:f5:b1:24:59:5a:25:50:fd:16:d7: - d4:bc:c7:04:1d:df:90:9b:5e:c3:a8:e9:8b:7d:a3: - 5d:9a:e9:7f:e5:2b:ea:15:a7:ad:ba:58:26:0a:11: - 49:4f:da:9a:67:7f:b0:a6:66:f4:27:b6:61:4e:3c: - c8:3e:a0:2f:6a:b4:0e:15:d6:39:f8:92:60:85:df: - a6:34:f3:fa:a4:a5:e4:47:49:e7:87:a4:a5:5c:8e: - 6a:2f:13:76:5f:29:f3:64:73 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - X509v3 Authority Key Identifier: - keyid:B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - DirName:/C=US/ST=Illinois/L=De Kalb/O=Northern Illinois University/OU=Computer Science/CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 60:69:23:65:97:51:5c:06:a4:42:cb:00:e7:9a:dc:39:70:c3: - d3:5d:bf:0f:e0:04:54:4d:d9:dc:12:57:12:6c:67:fd:5b:b0: - 39:63:ea:c4:12:65:51:bb:3d:f1:f7:25:b4:cd:0b:f6:5b:7a: - 61:25:ad:06:0a:01:55:dc:71:05:29:0d:73:e9:30:51:be:d3: - e1:b2:89:fc:0f:28:f7:06:75:96:1b:34:75:e0:07:e5:3b:b3: - 0b:28:24:e5:79:ea:55:39:e7:d2:ee:ec:63:b4:e4:c6:ee:cb: - 15:d0:c8:eb:3b:4f:36:10:a4:6a:c0:6b:03:e8:29:72:c7:a7: - 10:00 ------BEGIN CERTIFICATE----- -MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjELMAkGA1UEBhMCVVMx -ETAPBgNVBAgTCElsbGlub2lzMRAwDgYDVQQHEwdEZSBLYWxiMSUwIwYDVQQKExxO -b3J0aGVybiBJbGxpbm9pcyBVbml2ZXJzaXR5MRkwFwYDVQQLExBDb21wdXRlciBT -Y2llbmNlMRUwEwYDVQQDEwxOZWlsIFJpY2tlcnQxITAfBgkqhkiG9w0BCQEWEnJp -Y2tlcnRAY3Mubml1LmVkdTAeFw0wMDA1MTIwMDQwNTBaFw0xMDA1MjAwMDQwNTBa -MIGuMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0Rl -IEthbGIxJTAjBgNVBAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAX -BgNVBAsTEENvbXB1dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEh -MB8GCSqGSIb3DQEJARYScmlja2VydEBjcy5uaXUuZWR1MIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCxG0kG7z9E4JOtjKf3IXyHy9o19kui/YqgB1vMapuJM/wk -9bEkWVolUP0W19S8xwQd35CbXsOo6Yt9o12a6X/lK+oVp626WCYKEUlP2ppnf7Cm -ZvQntmFOPMg+oC9qtA4V1jn4kmCF36Y08/qkpeRHSeeHpKVcjmovE3ZfKfNkcwID -AQABo4IBDzCCAQswHQYDVR0OBBYEFLYxeLt+qk2hXf2iJBjGkFotLxlIMIHbBgNV -HSMEgdMwgdCAFLYxeLt+qk2hXf2iJBjGkFotLxlIoYG0pIGxMIGuMQswCQYDVQQG -EwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0RlIEthbGIxJTAjBgNV -BAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAXBgNVBAsTEENvbXB1 -dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEhMB8GCSqGSIb3DQEJ -ARYScmlja2VydEBjcy5uaXUuZWR1ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN -AQEEBQADgYEAYGkjZZdRXAakQssA55rcOXDD012/D+AEVE3Z3BJXEmxn/VuwOWPq -xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH -5TuzCygk5XnqVTnn0u7sY7Tkxu7LFdDI6ztPNhCkasBrA+gpcsenEAA= ------END CERTIFICATE----- - -Certificate: - Data: - Version: 3 (0x2) Serial Number: c2:3c:61:67:3b:0a:cc:5e Signature Algorithm: md5WithRSAEncryption Modified: stable/7/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- stable/7/contrib/sendmail/FREEBSD-upgrade Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/FREEBSD-upgrade Mon Jun 20 02:04:20 2011 (r223320) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.4 +sendmail 8.14.5 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -110,4 +110,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -25-January-2010 +13-June-2011 Modified: stable/7/contrib/sendmail/KNOWNBUGS ============================================================================== --- stable/7/contrib/sendmail/KNOWNBUGS Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/KNOWNBUGS Mon Jun 20 02:04:20 2011 (r223320) @@ -12,6 +12,14 @@ distribution). This list is not guaranteed to be complete. +* Header values which are too long may be truncated. + + If a value of a structured header is longer than 256 (MAXNAME) + characters then it may be truncated during output. For example, + if a single address in the To: header is longer than 256 characters + then it will be truncated which may result in a syntactically + invalid address. + * Delivery to programs that generate too much output may cause problems If e-mail is delivered to a program which generates too much @@ -258,4 +266,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.60 $, Last updated $Date: 2007/12/04 01:16:50 $ +$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $ Modified: stable/7/contrib/sendmail/LICENSE ============================================================================== --- stable/7/contrib/sendmail/LICENSE Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/LICENSE Mon Jun 20 02:04:20 2011 (r223320) @@ -1,8 +1,9 @@ SENDMAIL LICENSE -The following license terms and conditions apply, unless a different -license is obtained from Sendmail, Inc., 6475 Christie Ave, Suite 350, -Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com. +The following license terms and conditions apply, unless a redistribution +agreement or other license is obtained from Sendmail, Inc., 6475 Christie +Ave, Third Floor, Emeryville, CA 94608, USA, or by electronic mail at +license@sendmail.com. License Terms: @@ -22,10 +23,11 @@ each of the following conditions is met: must allow further use, modification, and redistribution of the Source Code under substantially the same terms as this license. For the purposes of redistribution "Source Code" means the complete compilable - and linkable source code of sendmail including all modifications. + and linkable source code of sendmail and associated libraries and + utilities in the sendmail distribution including all modifications. -2. Redistributions of source code must retain the copyright notices as they - appear in each source code file, these license terms, and the +2. Redistributions of Source Code must retain the copyright notices as they + appear in each Source Code file, these license terms, and the disclaimer/limitation of liability set forth as paragraph 6 below. 3. Redistributions in binary form must reproduce the Copyright Notice, @@ -33,16 +35,16 @@ each of the following conditions is met: forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: - "Copyright (c) 1998-2009 Sendmail, Inc. All rights reserved." + "Copyright (c) 1998-2010 Sendmail, Inc. All rights reserved." 4. Neither the name of Sendmail, Inc. nor the University of California nor - the names of their contributors may be used to endorse or promote + names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark of Sendmail, Inc. 5. All redistributions must comply with the conditions imposed by the - University of California on certain embedded code, whose copyright - notice and conditions for redistribution are as follows: + University of California on certain embedded code, which copyright + Notice and conditions for redistribution are as follows: (a) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. @@ -76,4 +78,4 @@ each of the following conditions is met: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision: 8.15 $, Last updated $Date: 2009/03/04 19:58:04 $ +$Revision: 8.17 $, Last updated $Date: 2010/12/03 01:10:00 $, Document 139848.1 Modified: stable/7/contrib/sendmail/PGPKEYS ============================================================================== --- stable/7/contrib/sendmail/PGPKEYS Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/PGPKEYS Mon Jun 20 02:04:20 2011 (r223320) @@ -142,6 +142,223 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 2048 A97884B0 2011-01-04 ------- RSA Sign & Encrypt +fingerprint: 5872 6218 A913 400D E660 3601 39A4 C77D A978 84B0 +uid Sendmail Signing Key/2011 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBE0ios4BCAC0mjr+Fljl/LRvhI3sI29bM146dWJFr+oJVTHuafDuKQS5ICeU +89LewVL6Pjp8RureijfbqZC51Z2v5v6GxAizr/LlD9FohjQXiAaA1vgPChBdzvLg +4TzEVnQOGFuDUnuucQH82I7ysQkK7z1GpFkofKHHgwmcfFpOiRLoUR7YVP7yDpfv +Zx3EPvRoFtR22kWlhms49J7zgRpXUCH9ggrtcl1QCXkPOlZ+VspUPrZaZEZy8RTA +3W5l0yhnGVgnJHBfOo2svFurukQ7LAU4U6yCG5AFogcD3sgEvuFAkmWBJZ2rnOBn +yCL658zfAJlmrni8kLQp6yBuEsUrT6jdRgRBABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTEgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAk0i +os4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA5pMd9qXiEsHIXB/0S +PFGPpoJzQqcEUHZ8w21mJOhoB6eO3GYRXBBLODQbu3x5qMXgTXT2fZgsSO5zkKBD +QCm4lMns+cJCds1+ggAZLywNM1SUvctXJYIaHnSLEnEbxIgRMM+HdULlJn3xgT6w +HUVZhzjamXOLospz5BfIXx9NynvjxvjcZ/NI8Cas1WFPvP+89fT+VCzLw0eC1bAo +puv2CA384i7pqeCvw13taksA0QnpHeN9c2xjWA6LTbLBrDLoTkfxvas0H9WzgNTF +DpzSuIHyDFonrkSvdgyOCIUYWJ0qkzDYnJzaOd7ku+4YjcF1bw5FhbvXAvcBY8OA +Ilr9WaR2TGj7//OylOjNiQEcBBABAgAGBQJNIqNLAAoJEGBN+/KFQQq+gDEH/i7x +aOd7L+QV5rIYyujJdirVoO/9s1+YJkKmFAKltUPcj8vOulQrxjK1E4Wul1qzMclr +TpZnIb9lyoqIKlGFwx345iHFhDHdWeGFxMxeQBopyOmAZcfMIX2C22+EYGNZNUsO +xVxpNV0CzKTdbfPHmBFSbA4lWnkyFxZsTR0GmGXRluwc1kT3i98QJbqNudKzUSU4 +f0+3Uda3xrnLtmChSEc57PRSDV4jHdILxORcuHh3xi50y0J3JJ2Yj0utNZ/W2KWX +guO0WSaNxv7lcKv5ilTWA5WWRt42SZfHlTiBJVpWydRBTZQGJLR6GTWpMoMs5jwP +9BGlbcR9J5+wmOFT9BmInAQQAQIABgUCTSKjbwAKCRASiW6bp38kKRGJBAC+VwW2 +/kXhV70FPyny4RErQDtyovkyS4rqFLdTNWNu80xbgEZJZY9ZcxT8YLjePsPmDZ0R +d4omumo5M35/gAastE5UMC4JCFM4v/iUUZwm5LRQNn0UtSKsSdHf32OqJx0FBr5k +GAe9LAd6gIqkPMw4AaK5H+C3H9VbR4sWHr3AEYicBBABAgAGBQJNIqN3AAoJENiq +8Mr2swcpK94D/A30eBH+qNleOIlwocxV+Fu7g6rvIPdULeYSNLhi/cuXUzo0HREs +FowErSD9gSabBkHbAUUhz8gBIXBATUKDgPfoqUqzYZmWRz15jgbKv2vVF36v6uuj +C/xgVZJsgw5uaZkJM5TI7FCEIs8EfjtPGD3AG1zBYw1+cmls6x+sq6tsiJwEEAEC +AAYFAk0io40ACgkQl0MBGHCTuEEeRwP/eaawZ80/BoQLdlgz6nNsIhomtFZSPhMS +/AFMo+cd4G777R1VJijNiD2ou3/2QbcPfu8OPENFYMLAOcYxYTzCL7XgSWkMxAmF +l2S1/xNUIteUwReoWpp/TZfCaTyro1VrX5pbTf3EYRlkF1qStBwmFfwSIZazhabi +XjlG/rDXL4WInAQQAQIABgUCTSKjlwAKCRAee7PIr5WWJfQsBACcJNvwXwHZVaf3 ++7f2wvqk1HxQk/3x2A/kMBSl1KuWFHV/WGu7Abj8hrjdrBffeCo27TpOhNt5946X +dwBLl4LYNL2Ogi8lH4nR1DsLTcJKICzxveFN1pRafd7+raVqsg/pIVQnagjxbuTa +6ClKEqGnF23kfnjMmlkQgQqupXh6kYicBBABAgAGBQJNIqOfAAoJEHCgJE0e+ZJR +RKYD/17M7wr4tyR+cO1vEJWftFbVCuyKnlUGH4yqjvZhFI0G3NhGnHcjXtl5Tntu +6gUOzObitN1vL/n0BYOPX4ppQ52Ocv6I87geOXC9EDREy5fJU8kX9lGkDRwWJEcg +i88ap0L/8Z3ihtr73hKZp3V6zfBIKdR/RfxxjV3xe5AevuooiJwEEAECAAYFAk0i +o6YACgkQyNXtKZX2F3G35wQApLZxcOkchrNplG4YJMucVcPFyNzeUFL6yhV6PMIQ +Vz8/ktBYF3LK2QQBxIFBEINF8EslKZ7LSfiFTSvsAxb8OiXGV23qHnglfN2zLFrA +CR9wvZ7jtDHHFfhHoDN8d9PA2LQR7M9qJzf1ltTaSETm9bSEZ/wC+VHvw+EVQU2S +OlSInAQQAQIABgUCTSKjrgAKCRAhg+GxOW8HiYOzBACR7nqyHOXspyNy0k2iKkEN +yAaorX32AecPpwyee7G2+QLxbK8jGGcmh5NR/GUx3ZbdKroyMZHK6OrQi42NwC7Q +n9xnzzgUgSdKRwnsA1IyP7DpiBSXMdk0kCc6UJy2L9fanHbamAe0oSZAACt9ePYD +jjq4Jmf25ObWv16Hyv83N4icBBABAgAGBQJNIqPIAAoJEIlpYrhnjAoDa9sD/inn +1dFkBlDPlPtGwHbw3+qCk8y6h3HpZubae7FxdE1pzsh/G00pB7Wy5K/EHL3MKlul +TxtetwQhSrYBmsPD5t3BhDKIyU2MQuec8dbJw/O1/7xGYmG1O4gGwq9vM4C2g+wz +atMl2pQnmi9DhhxFTwxhTgeorQ7nXrTclbuaqyLSiJwEEAECAAYFAk0io9EACgkQ +OCLbR8w3Ty1JCgQAjkZe0O9GZko22lkc7/3eql8zKwBx3Fpugt1NZ9nyOxeS2WpO +FfuiAiruA+p1L7b/dC60BUu+z6pgGIs05vIvPzzqjxnPBhqeYwWeW3ABa4JMVDi1 +RkR4TK6PsEj6IE7ZatzqiPST/GNRrjvpqtNyLsEbybPdY13hZSmxb780d1mInAQQ +AQIABgUCTSKj2gAKCRCcHL3i41xWNXseA/93476LuPukf9rKz9hvf88HrK5O0YPc +jG/CU2nFLhRbo5gkGFyf7540pODGBaCHyqwT46etzVY+WtZ1fETN0ALIJwoXkbwM +QE637pwnCLUO6ZTixa6CwceWXXAIc5/hiuQn0uKL8x4kHUcMUZqggYvqrjG1ZEDG +ZCVuTes1yhalDYicBBABAgAGBQJNIqPnAAoJEG9Sk9ijm6ZVpFYD/1OyjV5+9N/2 +rGbKcfaDXqTM0cvBjs1vBvFJfmDCy3fcOv590SboiCwY6dt5Sd6eRruY4FaTnosI +V4MZZnvMq1W3KfbT6fvcli/hgTKwYfJM7Mj+Tdp3uOGXN1u+cvKEfY3YHwDb4NAc +G3jPSslu1nrZq84bsokhnE+en8du7mKPiJwEEAECAAYFAk0io+8ACgkQ71iWZNQy +4Z1jiQP8CdqzrpIpNuKOs1nVcMsX+T1ZdiNbqbPYbjhQx7isUoaarDk/tQZZGxDE +dEXayRuNobRzQXltAKOhBrXlN2yFP9d9BR1y8B3dVBO9vsThuQ1BtMrtLrAL5In9 +4RyAvpuKcOhWnf9kJLis2MGghhIllJMuXOFeyujE3A4HSHFqGDWInAQQAQIABgUC +TSKj+gAKCRDBnB0lEtNGHaOHA/4+zClhAJappAYqATHLCs8mgzYa0/9RvI+e6iV8 +OD8/BOJl4DnHya0ijX7Kt78VJymcmdXge1ypBnq4D2b/vTo18asDfzysPhAmPoCK +FTlerV9xV/TW/QBZ7EkPW3BwOQW7LYnFd/NnoiX4z+KWh9FwOVWlXPz8xKgBgX3V +yoz3l4icBBABAgAGBQJNIqQhAAoJEMApykAW9MzppmsD/1HonMTzk4X9qvhvaLTU +/OKvOzxIdX6b/62DA0WZxN3Duyh2S8OLZzryI9SASesk5vgb2uSMC3dVCwOcfsiz +QWqStOLG5eyYJh0/iiRZ2K4YM/FrFBo3+AmQ2IeL3qRftBWGyIf11l1ZFS3Uzp8t +uzIxUFcQU2bJpy7GjHcq989qiJwEEAECAAYFAk0ipIwACgkQvdqP1j/qff3gwwP/ +WTAZ3r8UYbMoIN+ES8A9xLvUZRh/aT7TtiFCLxmJXIk3e+XKHw57DO3WUgZEo99d +PYNm/Q3tTqT+fj1rIDH9VdxhiSVw2lq/7qoIoYFb1fyCtuMQ+27jF/AFqbkDQJYx +gcnalClseYEsA9+GYKYfY0UAQePuDuWBMSPMkM+m+e+InAQQAQIABgUCTSKkqgAK +CRB8S2dtoA4VY+t1A/922nF4Apuc162UVBiP+v67PeXLgekdkjqlDACxqqgWWerW +6e41VaznDZjIGx76pQSbguCq7XbQXkiqO3E7bHcbjC8OEZ1Glju13GZG3heaoc23 +4n5pNctLmBWSdrp/4RCaf1BAgZ0UAYPO9fR7ZJyenp3vID8vwKTufoy0nR8/MIic +BBABAgAGBQJNIqS6AAoJENbgof5PvirdRDID/39vOWdqbvu17vX2n3GBI4RYseA2 +1pmvDqvzQcLLDJAXr1auTY7uiotYlXA8qPd4KTy0hCcj2r+7lZMhY1mCumG/0Sp+ +CahRkvUk/rVgWLeK0WGEsCV4IcayKc6ARJVKW+JHUNc1eAScMDAlMOyg0cNtQeDA +huCt6hxL1YGTPpPSiJwEEAECAAYFAk0on/MACgkQzx61AyIyegHYdAP/c4bKqid9 +lK7ciLbuo7RD0ZngCy+mE+xI4EQV+5LEhFVrqT+fMzSlHKLZGbPPJ2yP1ksBJITw +cYh7wGN7Dc1xA5bnB0CtjUWYqGRcQoifbgetdee2AfRs0+RvnEo5FMJIBlJOPc2X +o5eDTxmoSrt7cxnh7PEZnbxZi1gp/wJ+E+iIRgQQEQIABgUCTTHB2wAKCRAJp6JK +0eWCBxuyAJkBu7Qu46EFKyVyC8eUFwLJkghR2gCdHQUS7eF9pXHFr6aN3J2VrGFe +mFiIRgQQEQIABgUCTTUNYgAKCRDCeBwaRrHv4ROhAJ99EeU9KWWDnd2RjCN7uex5 +S6u3rQCeLUshZhe/NCehUnaaC8LJ1kwj/5yIRgQQEQIABgUCTTWM/AAKCRCWnNph +S7Y2S8bjAJ9bOB/fFGyPgTuwQIEakXITRILLgwCgvrjaVZagTRwQW2BM1uH+vk9j +yDuIRgQQEQIABgUCTUMwnwAKCRCiu/skDPlW91hCAJ0eizb5bxByUpXY0qsbcupw +H3kiBwCg1Yc7cur+Yz2dhPuRreaPk4QeVrWIRgQQEQIABgUCTUMxEgAKCRD7VAFa ++haI7RKlAKCGogTWoJdDbetwBdRpRJ72d9qUgACfUehPWCmq2A/mIaMFlPI+F3k3 +Lk25AQ0ETSKizgEIALV2tE8RtEgC1fjw4zHrZVUChXKm1uVEkRkeoaASrAI4IiK+ +qtgbNEzhLEQavQaIZECQLCaQb5qzvKLCEvuo5tClU+2P4/YjnikdBDFXUwHznSmd +N27SsX6gNoeX/ZwaEJUNpMd/v+/Gu9QmMBIFUhtXXZyeBBpCyi6CP5jw66KjjH1g +OXCQvSYJVlutIGtzvHolvQ2I+h6Ztwy9d7pFIVlr7EymFI+x0oI/i4UwF3FZPVWO +C1OZD7suXSre+eLzYXGBYyHkvGldhA/hvKLs3Z6udcirTMtX27xL6C5WKaCsuQPu +ZiYWxJ2A9UgP6zTuBzmAJ4XXKo7QgamAbxHT0sMAEQEAAYkBHwQYAQIACQUCTSKi +zgIbDAAKCRA5pMd9qXiEsI/1CACv83SSDOBt6HZcg7ucOZJ7Wkb5EJG6Mseh/K33 +CFDwWgYa20YeUUzPWD3ZRKY4irNL3ipnB3tJUF4yaasTPpI0owpcdCkOhpDw9S7M +AOnUACuv3JIZ17892ZLjXalNGMY/23qPxbQIaAidNh02ouZ6Md+NUvgh22+oDa+v +kxTkXmKiBGFpqY2myzzPvg84TMTpRBU372CZpmjjHK8duObUr9I0iIbVzshdnWuR +MKGu+n4hSU3SIYl6xLsdBGpiDOQJ3C1YHIduhDrQlyAjDVEgzgw20DUxUzKIpn2b +KH6d5q94eHcPD56A4cYD275DIZzAYqRpwzmB9O845HrHAPmQ +=pDAG +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use +pub 2048 85410ABE 2010-02-19 ------- RSA Sign +fingerprint: B175 9644 5303 5DCE DD7B E919 604D FBF2 8541 0ABE +uid Sendmail Signing Key/2010 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBEt+6goBCAC95sVPzf4AWFmUklHO9yGBq6K135Tlt9JaX3frj6PCBjkLNn97 +J5WDAoLqE9wB7WgiBzs2lu8OPZZcf+6syd97SojEze5bj2uv84DBv2juupbHEBys +9OH52QqYWG+1yuwAHY2gjKLYcvNgaOKLp5hoHZ2rakRc4a2ypLTPazsGFBO9/qBA ++v6qkP70/lOZeN9HX/yipbygAE+Y9elptW6ohvdGW8jbtllFqYFebB+lIaclkQnK +pldnQfktnJDB+XmLOc5m/1BsultlI5IH9HXCeskXxLcxXq+ldg+it1DgzxmHpHTK +dIhgOKY3MvTgxkcXiwIGcHBMnov6ESL1KaU5ABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTAgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAkt+ +6goCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBgTfvyhUEKvi4qB/0T +Em3whttGoUrxdZd1gYKI9SY1/4dHOhD+xJQQgIoQSRpOEA7xQ6TTAYvG8sYdsF5K +9/lWjOTEy5w6wBcu4e9F7aO/TUzue/7p0c2UKJTrEOw4HsRrENfQHx1TAXudQHHn +5+PgBCQCSr36ktuSXnlOo2bGbZ4FUwNCu0ztmoEEca8ZgY6ciEXbva1kRj6Eumul +MkqtVYEAtjzdIga6M3xYuJlus+qi/uEj5kivtf2LUDxXpGE6XFrArum0za/URiW8 +wxt5zBbTbne3tDr2yg6GC046+f1Wr02xWYapGyNRU6yrPciWOu0tpaxJ7CwEIMRq +6HzbSVdZkqOdSoZ3ufqYiJwEEAECAAYFAkt+6lkACgkQEolum6d/JClfWAP/VBVb +VYBQKV+NQyXl6ULJI91iIpEAR/T3nRoemGVPhbB8a7zRRkz1h4ou6VAMJeS4BxSC +fm2iOHCYMAOMSQ03VaEM2F13b8PtsGaKjuAwDf2pHARYbOj4DRCY0dUmwPXze3Tp +7S5ui/fk9t+NhQQa6IZHFkqdnQ+xZ88hhoF5slmInAQQAQIABgUCS37q1AAKCRDv +WJZk1DLhnTPYA/0VhRNooc2csxwvxBG6HiS8wp2k+kbGbbtlQ4JFg59p4EUnT2Ld +P9eUzFtj6fRkU/bZcIKgOn37M4GOXEoNvMT6NfmpTKeofg7hwp+pMdHlq4y9Em55 +TSC+rK2g6rAaSxMvDzasBouQqfxirj3nBI65zVHK98Zaj9vrpWCVCBIoZoicBBAB +AgAGBQJLfurtAAoJEG9Sk9ijm6ZVjcoEAJdB5kzFWHsvf0u/Oe+LWQwowL5SjQ6W +uhKgTDJ5IqFbDlCT/V33mpLEC9us4wNRT6Bff5agInCKfcUXdJijExkEbDB9ErZc +WmZqtquxQJN3xH+fIoIorxjWD0RMPmMvwQRgjn/puXwichQP9PafTgd9YsQ3aWAU +DGvx1U8pkloCiJwEEAECAAYFAkt+6vIACgkQnBy94uNcVjWGswQAhqDOQ8Os3gOo +UAGm/Oju6t6JG4wxLyl7vlMZ2eQHAX8rJ99Q4kyJB9xR4uaZ42BwbPx3s25N67qb +6z/ZAMrtqsXuK90+WlwykxG1uq4FOznHU6QT7cyO48Yeoq2PO1kFgQuRESPCRxXV +8dmDgeoDQ0EDO1Ykm003AKCd0N7+n1CInAQQAQIABgUCS37q9wAKCRA4IttHzDdP +LXmrA/4r9bzS6YnAHE0MFzByA2uZq0HeyrHI/Q6ELzqeMjuu/CwKdki/8gzz6Zt3 +KkXbqd9mPidsi/nqfUwQlqMHCFSRTyqw3FkGzQ/wk9fk4G+AF+5A//xGFIACHd54 +a/1+k0iVM5GNQkrknltYps0TmW8priU1uzmzAHpsCh0e4xFDIYicBBABAgAGBQJL +fur9AAoJEIlpYrhnjAoD9mQD/0s7tHTX+Mzt7iwZzsAZEqoxSQS5dUAKK+j6GR5K +8/cWcdiDJwCABViIn+TT7/GDmTlA4EUKQzIMPDfuagqa1SPxKXgivUnfhmpJVAma +MUmZeGFQyfTBjp4qZ+Agk15Ulnz7arqmOmeAWSvdsJ/vCm44TCEDO1gIjLzgyOIc +ktU5iJwEEAECAAYFAkt+6wQACgkQIYPhsTlvB4lH8wQAyqIKclShWxxaXi6YpS/k +H+susHMVePzBPyEmv93UkSOj2bdMWuhVENPXlBn1UnFt0vKPOL+krF3+zIAjg6N6 +zFlasBUL9p2HqRI35Sq4cn3S3Im4vZIPwWNYgtQY41Hc1Gx2pIxmKtIz+9+sUiTE +DGrTxnzUAohPaTzUVXPtWOuInAQQAQIABgUCS37rCgAKCRDI1e0plfYXcQXaA/9D ++sQJdEc1orgN/aTVGKkKoNyMmJhtNLECYIsfAYcE9lMGtymkkli0BrvrtNN1Co6P +qmR+oaZSmeyq0qNVdV8AnoyFI5Dk3Nir82ISOtvzuNzn8NrosSed0nyVmg88amTa +WoJS7as6s6/lCxuarGwRuHA7vXaxDg92lCYeTw09I4icBBABAgAGBQJLfusSAAoJ +EHCgJE0e+ZJRWiMD/i65FDmbZo0srV01XwSUb8EF/70RF0uOxrGfunMin93cR8VW +mNSzcydfH/mKR1Rf4Snsz9hp9NWryZpjVXrPJx6GOBzzwgyUtzAxH6OElv7rlK2Y +XJ+Xi94djsyB56e6PKHA1uB30g2l5beh0bDUEa9mLfstTidMWGXRdtnVtW5KiJwE +EAECAAYFAkt+6yAACgkQHnuzyK+VliU0OQQApyvdx0YKiDL7EuLf/QkOk64DRAKf +7rxZSlN5jHnNJSQeX7cMRBcklbl/GlZH2oyHdDuahrZ62MT/mCneRIH58lf8c91h +WLFjkpU/j8Md8ahFQDWpCwNSSwz4tqZyhKfeP/w0OaHC4ttAwbjKk6mn0wFpWxpH +sYFc08L5PoUyaQaInAQQAQIABgUCS37rJAAKCRCXQwEYcJO4QR+cA/9EEv5UJCgt +0glLmhIzpvGxlEyzhVqhtfDE8CI06lOSGWhYy4VCcOCho8ig+atxU1+/zPaJGIbI +mvR+kuPZ9kmtd+LtV6fWtp7U6FrAZSXV6paWHc9ZCLJeKSNwmRrcOqaBEjj3MqNA +pwXO3gCiuylHzgIo05+FxRho91AS/mciI4icBBABAgAGBQJLfusoAAoJENiq8Mr2 +swcppz4EALJ3JQOIPsvgptuPdq8XZuxxuFonjcr8RaLB89a9MDduFBM8zw/Q0qcA +asltDtQidMwn+VCDQavkrpEM2QbNxFfhbdnw5c97CvovgmTATPaR2XZ7LaeIwE36 +HLL5e5/k0BThiqymD3tjaFbx7uTK2o3ZTyMvbjtqMOdt0eLqFvHRiJwEEAECAAYF +Akt+6ywACgkQwCnKQBb0zOnn+AP+OdZu4BowBVYzmygmM1O7XyiEMd5TB3MxwkZR +8+rGW8Xcl4JtLY9iiXzfakTHuP3OrINrhXnMQLAY46kAcUc+VcHvLdMth6btsltE +Jjc33aZovPRabCeKVCnDKcEPRYclsXgGStXlFMoacI2KUUENZeGCUr0NJb7RnAk5 +Pfuib+mInAQQAQIABgUCS37rVgAKCRDBnB0lEtNGHcMMA/9mYtgCaK/zihws7d4V +p+uQXKjnfhKZx4XX33BoUFgxC2N5/TB6qd0sBnaUYby/DDGh6W3721dGTw66i9vF +Wn2IJ6JUj4CpLCCFVb9FxPdjrt/F1eKg8N1SOfVQg0D9Nkl48Y81tIf0xcMa9yuV +8qssX8baTDhatDGFIZlYPfGpZIicBBABAgAGBQJLg2FTAAoJEM8etQMiMnoByVwD +/3iim8IBm3ssOFJ58RR9wFPgH7INTiE28vO5yO+f2i0/cEdWwJDwmqOpKhUM7DWy +LeK7LaZWzViuxh83ZI2KlcJJksdFtohuzyJul/phyaQYDPGlgu7AIthNm49pdDnR +0AAQl98ccn0iT69Zp3Fi5fRMHVC4ChBsBir5JjJBh0aliJwEEAECAAYFAkuDdtQA +CgkQvdqP1j/qff0GMwQAqgbWFQsOoEzzwSDo/SEun8gmRRLUH8vWx5Us659x2nQy +BPtp8w2HpqKsyMn2E4TavKjyzUZPINziPVszXhG+dtCFuOQvRFFZzFQccdhAIB8o +KJ7y/LRa7MpvIMRFJOURBnJgQ3asUojRcksd+rgMqujFrwyYN5J+LeXwBXS9eMSI +nAQQAQIABgUCS4N2+gAKCRB8S2dtoA4VY6KoA/91U29DqRR0XRlk+KdRs6Qjo/R0 +lQp7uUtuP55xJkv+UMPVhABbMOR+/sjE8eUJdMpHfaQmdG89M5VZ+Ck2MZrhjveE +acNH/sIWCDvIFV5gheNZycpp+wH2VO7+i9bWmMVl4JKK0grFRYQMqiqT+tHYfXS3 +MVQH8U4EhwnFuwFrgoicBBABAgAGBQJLg3cQAAoJENbgof5PvirdPboD/jUU/UV7 +7jGtnW9+xrsUUDcHeU8Ha/VKXfKts4Z0KifWYnjUOH5jR/OqYzHy7vAOyGpyrziN +eJHLM/I8AuTtmsCY3IpfhaeRg4ZkJYRqx5QkhfUesOpPfKVPYtoF53Uw04iu0dtv +2bFftaX0tX/hKhWmzobllBGM9b5E4G+kHCRZiEYEEBECAAYFAkuEoagACgkQCaei +StHlggfktQCgjyKOB4tlm9WnufcJaYIbchyZVSQAn3thzs5akheaVsVwBHSmpJyk +PDRbiJwEEAECAAYFAkuFS4UACgkQXx7Ib4gMnlUZEQP9HoutmYz6pAB8XEADTKrR +wTWGqu/S4V6zhSJbIYSDIFAY+WeKCTUdVO8eFfrPIrS459z8yQ3PgFKL3QMp1VgX +jMGPcvfHOjWh1jSw5W1aLcJX428T0oybgLZLvPT7QXpIwKcY8TtS/jjVTaepIqIG +9tmQupstoaw/h9b1vHY7R7uIRgQQEQIABgUCS4Uc9QAKCRCWnNphS7Y2SyT5AKCE +1AR60B2GDZ75U2kaNe/SyOQJ3ACfVtndQ22edDOB1INak6SyfYv9ZuSIRgQQEQIA +BgUCS4TumQAKCRCiu/skDPlW9we5AKC6dNVZjpg/yDQiepI2E0XZ222vzACeJ7Ds +41t2z3BT4qGJyZrpGK8G3kKIRgQQEQIABgUCS4TuuQAKCRD7VAFa+haI7WniAKCY +mNr9FG/180EcUY/tgaHNuUDXtwCfX0DYjxL9ExvQ7wB2uXB2M7AwGxSIRgQQEQIA +BgUCS4Ts4wAKCRCgT/sbfcrp09HnAJ0dELKCp7WoOoAPVBHez/sfHAmgAwCdG64t +bjYwj5CamCOhDvuNjfbUpBSIRgQQEQIABgUCS4W+PgAKCRDCeBwaRrHv4S4EAKCV +LKV3q7PiVV5rb9T+s5uyrETBsgCfUVhchd+Ha5nbduvnF25C0Eswouq5AQ0ES37q +CgEIAK8GnjvPPqWqcNCmLyuscuTKPjqTyaA3xVVYNX+8hMD1iK4VAGf3QfKExVnN +QLvLpnknnKK/caaXFME9t4L0BTjCJRYJiDpoWImwu5fTRIyfIIy4vv5vPErqqKen +7dII6gptC2i538ntj7k8qkhewKJuTOVpE1eLHe3RxuP8rsv1AsvjJ+6WGZlFYINZ ++d0pxSOhdPN9WoTCl9JfkTQrnoVPClzG/euOkF5fUThL90gt31iN+RjB5DeWTPB/ +jDrq6t5spA8hTKvQ+UB65chI6TzrCr+k8f5D9AR0Fkf9KPFOL7+U9o6Ap9yur5sn +njDP4fFVhazVyljUwwPvJ5jjS1cAEQEAAYkBHwQYAQIACQUCS37qCgIbDAAKCRBg +TfvyhUEKvpWAB/0YnkJx6/5rIwDh1u5iFdboUCEsX92n9eOilPWw1NWbq/Gdx7+Z +xoRjrGl8e8SxOZJbfyehgPX8NxOrkBfcAOOXmOvXSO1i3HSo2gaQxVh1urXojzID +raUMcltcNeQagdtDfPhYnS25vJnj+H29Dal2FwLJb9wp8QH1DdhUBoqeRQH34REu +fWu0LjF87JjUELhZe0Op4B8HnQV9oGo7W4IYw/3Ek6c5As+WIWSaz0NmHP2Xw+kI +kpC4BVIwG0l2mChAT8Ds+rDLGYA2dxYK39mFSApem2KiXFhAanDBb5XgilmeDepk +A4NAZlDwxoivB/5PTy67pX+AC1JgvPPafUMu +=6Xeh +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use pub 1024 0xA77F2429 2009-01-01 ---------- RSA Sign & Encrypt f16 Fingerprint16 = 33 3A 62 61 2C F3 21 AA 4E 87 47 F2 2F 2C 40 4D uid Sendmail Signing Key/2009 @@ -1865,4 +2082,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.29 $, Last updated $Date: 2009/01/06 05:59:03 $ +$Revision: 8.36 $, Last updated $Date: 2011/01/28 21:17:54 $ Modified: stable/7/contrib/sendmail/RELEASE_NOTES ============================================================================== --- stable/7/contrib/sendmail/RELEASE_NOTES Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/RELEASE_NOTES Mon Jun 20 02:04:20 2011 (r223320) @@ -1,11 +1,75 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.1963 2009/12/23 04:43:46 ca Exp $ + $Id: RELEASE_NOTES,v 8.1991 2011/05/15 04:28:16 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.5/8.14.5 2011/05/17 + Do not cache SMTP extensions across connections as the cache + is based on hostname which may not be a unique identifier + for a server, i.e., different machines may have the + same hostname but provide different SMTP extensions. + Problem noted by Jim Hermann. + Avoid an out-of-bounds access in case a resolver reply for a DNS + map lookup returns a size larger than 1K. Based on a + patch from Dr. Werner Fink of SuSE. + If a job is aborted using the interrupt signal (e.g., control-C from + the keyboard), perform minimal cleanup to avoid invoking + functions that are not signal-safe. Note: in previous + versions the mail might have been queued up already + and would be delivered subsequently, now an interrupt + will always remove the queue files and thus prevent + delivery. + Per RFC 6176, when operating as a TLS client, do not offer SSLv2. + Since TLS session resumption is never used as a client, disable + use of RFC 4507-style session tickets. + Work around gcc4 versions which reverse 25 years of history and + no longer align char buffers on the stack, breaking calls + to resolver functions on strict alignment platforms. + Found by Stuart Henderson of OpenBSD. + Read at most two AUTH lines from a server greeting (up to two + lines are read because servers may use "AUTH mechs" and + "AUTH=mechs"). Otherwise a malicious server may exhaust + the memory of the client. Bug report by Nils of MWR + InfoSecurity. + Avoid triggering an assertion in the OpenLDAP code when the + connection to an LDAP server is lost while making a query. + Problem noted and patch provided by Andy Fiddaman. + If ConnectOnlyTo is set and sendmail is compiled with NETINET6 + it would try to use an IPv6 address if an IPv4 (or + unparseable) address is specified. + If SASLv2 is used, make sure that the macro {auth_authen} is + stored in xtext format to avoid problems with parsing + it. Problem noted by Christophe Wolfhugel. + CONFIG: FEATURE(`ldap_routing') in 8.14.4 tried to add a missing + -T that is required, but failed for some cases + that did not use LDAP. This change has been undone + until a better solution can be implemented. Problem + found by Andy Fiddaman. + CONFIG: Add cf/ostype/solaris11.m4 for Solaris11 support. + Contributed by Casper Dik of Oracle. + CONTRIB: qtool.pl: Deal with H entries that do not have a + letter between the question marks. Patch from + Stefan Christensen. + DOC: Use a better description for the -i option in sendmail. + Patch from Mitchell Berger. + Portability: + Add support for Darwin 10.x (Mac OS X 10.6). + Enable HAVE_NANOSLEEP for FreeBSD 3 and later. Patch + from John Marshall. + Enable HAVE_NANOSLEEP for OpenBSD 4.3 and later. + Use new directory "/system/volatile" for PidFile on + Solaris 11. Patch from Casper Dik of Oracle. + Fix compilation on Solaris 11 (and maybe some other + OSs) when using OpenSSL 1.0. Based on patch from + Jan Pechanec of Oracle. + Set SOCKADDR_LEN_T and SOCKOPT_LEN_T to socklen_t + for Solaris 11. Patch from Roger Faulkner of Oracle. + New Files: + cf/ostype/solaris11.m4 + 8.14.4/8.14.4 2009/12/30 SECURITY: Handle bogus certificates containing NUL characters in CNs by placing a string indicating a bad certificate Modified: stable/7/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- stable/7/contrib/sendmail/cf/cf/submit.cf Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/cf/cf/submit.cf Mon Jun 20 02:04:20 2011 (r223320) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Tue Dec 22 20:49:09 PST 2009 -##### in /extra/home/ca/sm-8.14.4/OpenSource/sendmail-8.14.4/cf/cf +##### built by ca@wiz.smi.sendmail.com on Sat May 14 21:31:14 PDT 2011 +##### in /extra/home/ca/sm-8.14.5/OpenSource/sendmail-8.14.5/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -27,7 +27,7 @@ ###################################################################### ###################################################################### -##### $Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $ ##### +##### $Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $ ##### ##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ ##### ##### $Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $ ##### ##### $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $ ##### @@ -35,7 +35,7 @@ ##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ ##### -##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ ##### +##### $Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.4/Submit +DZ8.14.5/Submit ############### @@ -992,7 +992,6 @@ R< $* > $* $: $2 - ###################################################################### ### check_mail -- check SMTP `MAIL FROM:' command argument ###################################################################### Modified: stable/7/contrib/sendmail/cf/feature/ldap_routing.m4 ============================================================================== --- stable/7/contrib/sendmail/cf/feature/ldap_routing.m4 Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/cf/feature/ldap_routing.m4 Mon Jun 20 02:04:20 2011 (r223320) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1999-2002, 2004, 2007, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1999-2002, 2004, 2007 Sendmail, Inc. and its suppliers. # All rights reserved. # # By using this file, you agree to the terms and conditions set @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: ldap_routing.m4,v 8.17 2009/06/26 21:11:08 ca Exp $') +VERSIONID(`$Id: ldap_routing.m4,v 8.18 2010/01/05 00:57:27 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 @@ -35,40 +35,12 @@ ifelse(len(X`'_ARG6_), `1', `define(`_LD _ARG6_, `tempfail', `define(`_LDAP_ROUTE_MAPTEMP_', `_TEMPFAIL_')', _ARG6_, `queue', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')') -define(`_ATMPF_', `')dnl -dnl check whether arg contains -T`'_ATMPF_ -dnl unless it is a sequence map or just LDAP -dnl note: this does not work if ARG1 begins with space(s), however, as -dnl we issue a warning, hopefully the user will fix it... -ifelse(defn(`_ARG1_'), `', `', - defn(`_ARG1_'), `LDAP', `', - `ifelse(index(_ARG1_, `sequence '), `0', `', - `ifelse(index(_ARG1_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in first argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG1_, ` ')) - define(`_NARG1_', `substr(_ARG1_, 0, _ABP_) -T'_ATMPF_` substr(_ARG1_, _ABP_)') - ') - ') - ') -ifelse(defn(`_ARG2_'), `', `', - defn(`_ARG2_'), `LDAP', `', - `ifelse(index(_ARG2_, `sequence '), `0', `', - `ifelse(index(_ARG2_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in second argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG2_, ` ')) - define(`_NARG2_', `substr(_ARG2_, 0, _ABP_) -T'_ATMPF_` substr(_ARG2_, _ABP_)') - ') - ') - ') - LOCAL_CONFIG # LDAP routing maps Kldapmh ifelse(len(X`'_ARG1_), `1', `ldap -1 -T -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG1_'), `', `_ARG1_', `_NARG1_') + `_ARG1_') Kldapmra ifelse(len(X`'_ARG2_), `1', `ldap -1 -T -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG2_'), `', `_ARG2_', `_NARG2_') + `_ARG2_') Modified: stable/7/contrib/sendmail/cf/m4/cfhead.m4 ============================================================================== --- stable/7/contrib/sendmail/cf/m4/cfhead.m4 Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/cf/m4/cfhead.m4 Mon Jun 20 02:04:20 2011 (r223320) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -189,6 +189,7 @@ SLocal_tls_server') define(`LOCAL_RULE_3', `divert(2)') define(`LOCAL_CONFIG', `divert(6)') define(`MAILER_DEFINITIONS', `divert(7)') +define(`LOCAL_DNSBL', `divert(8)') define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)') define(`CONCAT', `$1$2$3$4$5$6$7') @@ -308,4 +309,4 @@ define(`confMILTER_MACROS_EOM', `{msg_id divert(0)dnl -VERSIONID(`$Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $') +VERSIONID(`$Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $') Modified: stable/7/contrib/sendmail/cf/m4/proto.m4 ============================================================================== --- stable/7/contrib/sendmail/cf/m4/proto.m4 Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/cf/m4/proto.m4 Mon Jun 20 02:04:20 2011 (r223320) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -13,10 +13,10 @@ divert(-1) # divert(0) -VERSIONID(`$Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $') +VERSIONID(`$Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $') # level CF_LEVEL config file format -V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') +V`'CF_LEVEL`'ifdef(`NO_VENDOR',`', `/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')') divert(-1) dnl if MAILER(`local') not defined: do it ourself; be nice @@ -1795,7 +1795,7 @@ ifdef(`_CONN_CONTROL_',`dnl ifdef(`_CONN_CONTROL_IMMEDIATE_',`',`dnl dnl workspace: ignored... R$* $: $>"ConnControl" dummy')', `dnl') -undivert(8) +undivert(8)dnl LOCAL_DNSBL ifdef(`_REQUIRE_RDNS_', `dnl R$* $: $&{client_addr} $| $&{client_resolve} R$=R $* $@ RELAY We relay for these Modified: stable/7/contrib/sendmail/cf/m4/version.m4 ============================================================================== --- stable/7/contrib/sendmail/cf/m4/version.m4 Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/cf/m4/version.m4 Mon Jun 20 02:04:20 2011 (r223320) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Id: version.m4,v 8.205 2009/12/23 04:43:09 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.214 2011/04/26 23:02:36 ca Exp $') # divert(0) # Configuration version number -DZ8.14.4`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.5`'ifdef(`confCF_VERSION', `/confCF_VERSION') Copied: stable/7/contrib/sendmail/cf/ostype/solaris11.m4 (from r223067, head/contrib/sendmail/cf/ostype/solaris11.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/contrib/sendmail/cf/ostype/solaris11.m4 Mon Jun 20 02:04:20 2011 (r223320, copy of r223067, head/contrib/sendmail/cf/ostype/solaris11.m4) @@ -0,0 +1,22 @@ +divert(-1) +# +# Copyright (c) 2011 Sendmail, Inc. and its suppliers. +# All rights reserved. +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the sendmail distribution. +# +# This ostype file is suitable for use on Solaris 11 and later systems, +# make use of /system/volatile, introduced in Solaris 11. +# + +divert(0) +VERSIONID(`$Id: solaris11.m4,v 1.1 2011/01/24 21:22:08 ca Exp $') +divert(-1) + +ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')') +define(`confEBINDIR', `/usr/lib')dnl +define(`confPID_FILE', `/system/volatile/sendmail.pid')dnl +define(`_NETINET6_')dnl +FEATURE(`local_lmtp')dnl Modified: stable/7/contrib/sendmail/contrib/qtool.pl ============================================================================== --- stable/7/contrib/sendmail/contrib/qtool.pl Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/contrib/qtool.pl Mon Jun 20 02:04:20 2011 (r223320) @@ -3,7 +3,7 @@ ## Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. ## All rights reserved. ## -## $Id: qtool.pl,v 8.30 2009/03/04 16:57:30 ca Exp $ +## $Id: qtool.pl,v 8.31 2010/11/10 19:11:54 ca Exp $ ## use strict; use File::Basename; @@ -607,7 +607,7 @@ sub parse_header $first_char = substr($line, 0, 1); if ($first_char eq "?") { - $line = substr($line, 3); + $line = (split(/\?/, $line,3))[2]; } elsif ($first_char eq "\t") { Modified: stable/7/contrib/sendmail/doc/op/op.me ============================================================================== --- stable/7/contrib/sendmail/doc/op/op.me Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/doc/op/op.me Mon Jun 20 02:04:20 2011 (r223320) @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: op.me,v 8.745 2009/12/13 04:12:46 ca Exp $ +.\" $Id: op.me,v 8.747 2010/05/08 04:18:27 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 8.745 $ +.Ve $Revision: 8.747 $ .rm Ve .sp For Sendmail Version 8.14 @@ -1095,6 +1095,9 @@ The number of envelope recipients for th (after aliasing and forwarding). .ip msgid The message id of the message (from the header). +.ip bodytype +The message body type (7BIT or 8BITMIME), +as determined from the envelope. .ip proto The protocol used to receive this message (e.g., ESMTP or UUCP) .ip daemon @@ -5154,7 +5157,8 @@ FAIL cert presented but could not be ver e.g., the signing CA is missing. NONE STARTTLS has not been performed. TEMP temporary error occurred. -PROTOCOL some protocol error occurred. +PROTOCOL some protocol error occurred + at the ESMTP level (not TLS). SOFTWARE STARTTLS handshake failed, which is a fatal error for this session, the e-mail will be queued. @@ -11463,7 +11467,7 @@ replace it with a blank sheet for double .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 8.745 $ +.\"Version $Revision: 8.747 $ .\".ce 0 .bp 3 .ce Modified: stable/7/contrib/sendmail/include/sm/conf.h ============================================================================== --- stable/7/contrib/sendmail/include/sm/conf.h Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/include/sm/conf.h Mon Jun 20 02:04:20 2011 (r223320) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $ + * $Id: conf.h,v 1.144 2011/05/03 16:24:00 ca Exp $ */ /* @@ -381,6 +381,12 @@ typedef int pid_t; # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ +# if SOLARIS >= 21100 +# include +# endif /* SOLARIS >= 21100 */ +# ifndef _PATH_VARRUN +# define _PATH_VARRUN "/var/run/" +# endif /* _PATH_VARRUN */ # define GIDSET_T gid_t # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ @@ -443,7 +449,7 @@ typedef int pid_t; # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ -# define _PATH_SENDMAILPID "/var/run/sendmail.pid" +# define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid" # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/var/adm/sm.bin" # endif /* ! SMRSH_CMDDIR */ @@ -461,6 +467,8 @@ typedef int pid_t; # if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) # define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ # define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */ +# define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */ +# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ # endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ @@ -1014,6 +1022,9 @@ extern unsigned int sleepX __P((unsigned # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ # endif /* __FreeBSD_version >= 222000 */ +# if __FreeBSD_version >= 300000 /* 3.0.0-release and later */ +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* __FreeBSD_version >= 300000 */ # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/usr/libexec/sm.bin" @@ -1055,6 +1066,9 @@ extern unsigned int sleepX __P((unsigned # if OpenBSD >= 200505 # undef NETISO /* iso.h removed in 3.7 */ # endif /* OpenBSD >= 200505 */ +# if OpenBSD >= 200800 +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* OpenBSD >= 200800 */ # endif /* defined(__OpenBSD__) */ # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ @@ -2808,7 +2822,7 @@ struct utsname # if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 /* - ** override Linux wierdness: a FQHN can be 255 chars long + ** override Linux weirdness: a FQHN can be 255 chars long ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host ** name (not including the terminating null) as returned from the ** gethostname() function.") to be at least 255. c.f.: Modified: stable/7/contrib/sendmail/libmilter/docs/overview.html ============================================================================== --- stable/7/contrib/sendmail/libmilter/docs/overview.html Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/libmilter/docs/overview.html Mon Jun 20 02:04:20 2011 (r223320) @@ -4,7 +4,7 @@

Technical Overview

@@ -126,7 +126,7 @@ messages may be sent in a single connect Note also that a message or connection may be aborted by either the remote host or the MTA at any point during the SMTP transaction. -f this occurs during a message (between the MAIL command and the final "."), +If this occurs during a message (between the MAIL command and the final "."), the filter's xxfi_abort routine will be called. xxfi_close is called any time the Modified: stable/7/contrib/sendmail/libmilter/docs/smfi_stop.html ============================================================================== --- stable/7/contrib/sendmail/libmilter/docs/smfi_stop.html Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/libmilter/docs/smfi_stop.html Mon Jun 20 02:04:20 2011 (r223320) @@ -2,7 +2,7 @@ smfi_stop

smfi_stop

@@ -42,7 +42,7 @@ which may then exit or warm-restart. -
ArgumentDescription
voidTakes no arguement. + Takes no argument.
Modified: stable/7/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html ============================================================================== --- stable/7/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Mon Jun 20 02:04:20 2011 (r223320) @@ -2,7 +2,7 @@ xxfi_envrcpt

xxfi_envrcpt

@@ -71,7 +71,8 @@ Handle the envelope RCPT command. SMFIS_ACCEPT - Accept recipient. xxfi_abort will not be called. + Accept this message. + xxfi_abort will not be called. @@ -87,7 +88,7 @@ Handle the envelope RCPT command.
-Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2000, 2003, 2010 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set Modified: stable/7/contrib/sendmail/libmilter/engine.c ============================================================================== --- stable/7/contrib/sendmail/libmilter/engine.c Mon Jun 20 01:56:49 2011 (r223319) +++ stable/7/contrib/sendmail/libmilter/engine.c Mon Jun 20 02:04:20 2011 (r223320) @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: engine.c,v 8.166 2009/11/06 00:57:07 ca Exp $") +SM_RCSID("@(#)$Id: engine.c,v 8.167 2011/03/03 06:09:15 ca Exp $") #include "libmilter.h" @@ -284,7 +284,7 @@ mi_engine(ctx) if (mi_stop() == MILTER_ABRT) { if (ctx->ctx_dbg > 3) - sm_dprintf("[%ld] milter_abort\n", + sm_dprintf("[%lu] milter_abort\n", (long) ctx->ctx_id); ret = MI_FAILURE; break; @@ -315,7 +315,7 @@ mi_engine(ctx) cmd < SMFIC_VALIDCMD) { if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] mi_engine: mi_rd_cmd error (%x)\n", + sm_dprintf("[%lu] mi_engine: mi_rd_cmd error (%x)\n", (long) ctx->ctx_id, (int) cmd); /* @@ -328,7 +328,7 @@ mi_engine(ctx) break; } if (ctx->ctx_dbg > 4) - sm_dprintf("[%ld] got cmd '%c' len %d\n", + sm_dprintf("[%lu] got cmd '%c' len %d\n", (long) ctx->ctx_id, cmd, (int) len); for (i = 0; i < ncmds; i++) { @@ -339,7 +339,7 @@ mi_engine(ctx) { /* unknown command */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' unknown\n", + sm_dprintf("[%lu] cmd '%c' unknown\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -348,7 +348,7 @@ mi_engine(ctx) { /* stop for now */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' not impl\n", + sm_dprintf("[%lu] cmd '%c' not impl\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -357,14 +357,14 @@ mi_engine(ctx) /* is new state ok? */ newstate = cmds[i].cm_next; if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] cur %x new %x nextmask %x\n", + sm_dprintf("[%lu] cur %x new %x nextmask %x\n", (long) ctx->ctx_id, curstate, newstate, next_states[curstate]); if (newstate != ST_NONE && !trans_ok(curstate, newstate)) { if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] abort: cur %d (%x) new %d (%x) next %x\n", + sm_dprintf("[%lu] abort: cur %d (%x) new %d (%x) next %x\n", (long) ctx->ctx_id, curstate, MI_MASK(curstate), newstate, MI_MASK(newstate), @@ -434,7 +434,7 @@ mi_engine(ctx) else if (r == _SMFIS_ABORT) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 02:05:56 2011 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 7D6F2106566B; Mon, 20 Jun 2011 02:05:56 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8238FC18; Mon, 20 Jun 2011 02:05: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 p5K25uUb019221; Mon, 20 Jun 2011 02:05:56 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K25uiU019219; Mon, 20 Jun 2011 02:05:56 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200205.p5K25uiU019219@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 02:05:56 +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: r223321 - stable/7/etc/sendmail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 02:05:56 -0000 Author: gshapiro Date: Mon Jun 20 02:05:56 2011 New Revision: 223321 URL: http://svn.freebsd.org/changeset/base/223321 Log: MFC: Update DNSBL information (MAPS has been acquired, used a generic example) Modified: stable/7/etc/sendmail/freebsd.mc Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/sendmail/freebsd.mc ============================================================================== --- stable/7/etc/sendmail/freebsd.mc Mon Jun 20 02:04:20 2011 (r223320) +++ stable/7/etc/sendmail/freebsd.mc Mon Jun 20 02:05:56 2011 (r223321) @@ -66,12 +66,10 @@ dnl so this file will not serve as a dat dnl For that, visit dnl http://www.google.com/Top/Computers/Internet/E-mail/Spam/Blacklists/ -dnl Uncomment to activate Realtime Blackhole List -dnl information available at http://www.mail-abuse.com/ -dnl NOTE: This is a subscription service as of July 31, 2001 -dnl FEATURE(dnsbl) +dnl Uncomment to activate your chosen DNS based blacklist +dnl FEATURE(dnsbl, `dnsbl.example.com') dnl Alternatively, you can provide your own server and rejection message: -dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', ``"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}'') +dnl FEATURE(dnsbl, `dnsbl.example.com', ``"550 Mail from " $&{client_addr} " rejected'') dnl Dialup users should uncomment and define this appropriately dnl define(`SMART_HOST', `your.isp.mail.server') From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 02:06:46 2011 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 0F5C0106564A; Mon, 20 Jun 2011 02:06:46 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2A818FC0A; Mon, 20 Jun 2011 02:06: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 p5K26j3O019300; Mon, 20 Jun 2011 02:06:45 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K26jb3019299; Mon, 20 Jun 2011 02:06:45 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200206.p5K26jb3019299@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 02:06:45 +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: r223322 - stable/7/etc/sendmail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 02:06:46 -0000 Author: gshapiro Date: Mon Jun 20 02:06:45 2011 New Revision: 223322 URL: http://svn.freebsd.org/changeset/base/223322 Log: MFC: Minor change to force commit this file so new freebsd*.cf files are built to use the new sendmail-8.14.5/cf tree. Modified: stable/7/etc/sendmail/freebsd.submit.mc Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/sendmail/freebsd.submit.mc ============================================================================== --- stable/7/etc/sendmail/freebsd.submit.mc Mon Jun 20 02:05:56 2011 (r223321) +++ stable/7/etc/sendmail/freebsd.submit.mc Mon Jun 20 02:06:45 2011 (r223322) @@ -25,4 +25,3 @@ define(`confBIND_OPTS', `WorkAroundBroke dnl dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1] FEATURE(`msp', `[127.0.0.1]')dnl - From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 02:09:15 2011 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 B65F4106564A; Mon, 20 Jun 2011 02:09:15 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4EDE8FC16; Mon, 20 Jun 2011 02:09: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 p5K29Fra019407; Mon, 20 Jun 2011 02:09:15 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K29FgN019405; Mon, 20 Jun 2011 02:09:15 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106200209.p5K29FgN019405@svn.freebsd.org> From: Gregory Neil Shapiro Date: Mon, 20 Jun 2011 02:09:15 +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: r223323 - stable/7/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: Mon, 20 Jun 2011 02:09:15 -0000 Author: gshapiro Date: Mon Jun 20 02:09:15 2011 New Revision: 223323 URL: http://svn.freebsd.org/changeset/base/223323 Log: sendmail has been updated to 8.14.5 Modified: stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 20 02:06:45 2011 (r223322) +++ stable/7/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jun 20 02:09:15 2011 (r223323) @@ -660,6 +660,9 @@ OpenSSL has been updated to version 0.9.8q. + sendmail has been updated to + version 8.14.5. + The &man.tcsh.1; program has been updated to version 6.17.00. From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 02:17:34 2011 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 867B1106567B; Mon, 20 Jun 2011 02:17:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CC98FC15; Mon, 20 Jun 2011 02:17: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 p5K2HYwG019741; Mon, 20 Jun 2011 02:17:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K2HYqo019739; Mon, 20 Jun 2011 02:17:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106200217.p5K2HYqo019739@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 20 Jun 2011 02:17: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: r223324 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 02:17:34 -0000 Author: nwhitehorn Date: Mon Jun 20 02:17:34 2011 New Revision: 223324 URL: http://svn.freebsd.org/changeset/base/223324 Log: Work/hack around some race conditions present in the hardware/HV interface. Partially inspired by a patch from glevand (geoffrey.levand@mail.ru). Modified: head/sys/powerpc/ps3/if_glc.c Modified: head/sys/powerpc/ps3/if_glc.c ============================================================================== --- head/sys/powerpc/ps3/if_glc.c Mon Jun 20 02:09:15 2011 (r223323) +++ head/sys/powerpc/ps3/if_glc.c Mon Jun 20 02:17:34 2011 (r223324) @@ -135,6 +135,7 @@ glc_attach(device_t dev) callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); sc->next_txdma_slot = 0; sc->bsy_txdma_slots = 0; + sc->sc_next_rxdma_slot = 0; sc->first_used_txdma_slot = -1; /* @@ -375,6 +376,14 @@ glc_tick(void *xsc) mtx_assert(&sc->sc_mtx, MA_OWNED); + /* + * XXX: Sometimes the RX queue gets stuck. Poke it periodically until + * we figure out why. This will fail harmlessly if the RX queue is + * already running. + */ + lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, + sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0); + if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) { callout_reset(&sc->sc_tick_ch, hz, glc_tick, sc); return; @@ -707,12 +716,19 @@ glc_rxintr(struct glc_softc *sc) struct ifnet *ifp = sc->sc_ifp; bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_POSTREAD); restart_rxdma = 0; while ((sc->sc_rxdmadesc[sc->sc_next_rxdma_slot].cmd_stat & GELIC_DESCR_OWNED) == 0) { i = sc->sc_next_rxdma_slot; + sc->sc_next_rxdma_slot++; + if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS) + sc->sc_next_rxdma_slot = 0; + + if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END) + restart_rxdma = 1; + if (sc->sc_rxdmadesc[i].rxerror & GELIC_RXERRORS) { ifp->if_ierrors++; goto requeue; @@ -738,9 +754,6 @@ glc_rxintr(struct glc_softc *sc) m->m_pkthdr.rcvif = ifp; m->m_len = sc->sc_rxdmadesc[i].valid_size; m->m_pkthdr.len = m->m_len; - sc->sc_next_rxdma_slot++; - if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS) - sc->sc_next_rxdma_slot = 0; if (sc->sc_rx_vlan >= 0) m_adj(m, 2); @@ -750,16 +763,18 @@ glc_rxintr(struct glc_softc *sc) mtx_lock(&sc->sc_mtx); requeue: - if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END) - restart_rxdma = 1; glc_add_rxbuf_dma(sc, i); - if (restart_rxdma) { - error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, - sc->sc_rxsoft[i].rxs_desc, 0); - if (error != 0) - device_printf(sc->sc_self, - "lv1_net_start_rx_dma error: %d\n", error); - } + } + + bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map, + BUS_DMASYNC_PREWRITE); + + if (restart_rxdma) { + error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev, + sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0); + if (error != 0) + device_printf(sc->sc_self, + "lv1_net_start_rx_dma error: %d\n", error); } } @@ -770,6 +785,9 @@ glc_txintr(struct glc_softc *sc) struct glc_txsoft *txs; int progress = 0, kickstart = 0, error; + bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_txdmadesc_map, + BUS_DMASYNC_POSTREAD); + while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) { if (sc->sc_txdmadesc[txs->txs_lastdesc].cmd_stat & GELIC_DESCR_OWNED) @@ -805,7 +823,8 @@ glc_txintr(struct glc_softc *sc) else sc->first_used_txdma_slot = -1; - if (kickstart && txs != NULL) { + if (kickstart || txs != NULL) { + /* Speculatively (or necessarily) start the TX queue again */ error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev, sc->sc_txdmadesc_phys + txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0); From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 03:25:09 2011 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 D9E8C1065670; Mon, 20 Jun 2011 03:25:09 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8E3B8FC08; Mon, 20 Jun 2011 03:25: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 p5K3P9vI021962; Mon, 20 Jun 2011 03:25:09 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K3P9ZA021958; Mon, 20 Jun 2011 03:25:09 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201106200325.p5K3P9ZA021958@svn.freebsd.org> From: Jeff Roberson Date: Mon, 20 Jun 2011 03:25: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: r223325 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 03:25:09 -0000 Author: jeff Date: Mon Jun 20 03:25:09 2011 New Revision: 223325 URL: http://svn.freebsd.org/changeset/base/223325 Log: - Fix directory count rollbacks by passing the mode to the journal dep earlier. - Add rollback/forward code for frag and cluster accounting. - Handle the FREEDEP case in softdep_sync_buf(). (submitted by pho) Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jun 20 03:25:09 2011 (r223325) @@ -1829,7 +1829,7 @@ gotit: } UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref); + softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref, mode); bdwrite(bp); if (ibp != NULL) bawrite(ibp); Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_extern.h Mon Jun 20 03:25:09 2011 (r223325) @@ -130,7 +130,7 @@ void softdep_freefile(struct vnode *, in int softdep_request_cleanup(struct fs *, struct vnode *, struct ucred *, int); void softdep_setup_freeblocks(struct inode *, off_t, int); -void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t); +void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int); void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t, int, int); void softdep_setup_allocdirect(struct inode *, ufs_lbn_t, ufs2_daddr_t, Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Jun 20 02:17:34 2011 (r223324) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Jun 20 03:25:09 2011 (r223325) @@ -142,10 +142,11 @@ softdep_setup_sbupdate(ump, fs, bp) } void -softdep_setup_inomapdep(bp, ip, newinum) +softdep_setup_inomapdep(bp, ip, newinum, mode) struct buf *bp; struct inode *ip; ino_t newinum; + int mode; { panic("softdep_setup_inomapdep called"); @@ -789,6 +790,8 @@ static void diradd_inode_written(struct static int handle_written_indirdep(struct indirdep *, struct buf *, struct buf**); static int handle_written_inodeblock(struct inodedep *, struct buf *); +static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *, + uint8_t *); static int handle_written_bmsafemap(struct bmsafemap *, struct buf *); static void handle_written_jaddref(struct jaddref *); static void handle_written_jremref(struct jremref *); @@ -820,6 +823,8 @@ static void handle_allocindir_partdone(s static void initiate_write_filepage(struct pagedep *, struct buf *); static void initiate_write_indirdep(struct indirdep*, struct buf *); static void handle_written_mkdir(struct mkdir *, int); +static int jnewblk_rollback(struct jnewblk *, struct fs *, struct cg *, + uint8_t *); static void initiate_write_bmsafemap(struct bmsafemap *, struct buf *); static void initiate_write_inodeblock_ufs1(struct inodedep *, struct buf *); static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *); @@ -935,6 +940,7 @@ static void wake_worklist(struct worklis static void wait_worklist(struct worklist *, char *); static void remove_from_worklist(struct worklist *); static void softdep_flush(void); +static void softdep_flushjournal(struct mount *); static int softdep_speedup(void); static void worklist_speedup(void); static int journal_mount(struct mount *, struct fs *, struct ucred *); @@ -3046,6 +3052,25 @@ jfsync_write(jfsync, jseg, data) rec->jt_extsize = jfsync->jfs_extsize; } +static void +softdep_flushjournal(mp) + struct mount *mp; +{ + struct jblocks *jblocks; + struct ufsmount *ump; + + if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) + return; + ump = VFSTOUFS(mp); + jblocks = ump->softdep_jblocks; + ACQUIRE_LOCK(&lk); + while (ump->softdep_on_journal) { + jblocks->jb_needseg = 1; + softdep_process_journal(mp, NULL, MNT_WAIT); + } + FREE_LOCK(&lk); +} + /* * Flush some journal records to disk. */ @@ -4310,7 +4335,6 @@ softdep_setup_create(dp, ip) inoreflst); KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number, ("softdep_setup_create: No addref structure present.")); - jaddref->ja_mode = ip->i_mode; } softdep_prelink(dvp, NULL); FREE_LOCK(&lk); @@ -4417,7 +4441,6 @@ softdep_setup_mkdir(dp, ip) KASSERT(jaddref->ja_parent == dp->i_number, ("softdep_setup_mkdir: bad parent %d", jaddref->ja_parent)); - jaddref->ja_mode = ip->i_mode; TAILQ_INSERT_BEFORE(&jaddref->ja_ref, &dotaddref->ja_ref, if_deps); } @@ -4637,10 +4660,11 @@ softdep_revert_rmdir(dp, ip) * Called just after updating the cylinder group block to allocate an inode. */ void -softdep_setup_inomapdep(bp, ip, newinum) +softdep_setup_inomapdep(bp, ip, newinum, mode) struct buf *bp; /* buffer for cylgroup block with inode map */ struct inode *ip; /* inode related to allocation */ ino_t newinum; /* new inode number being allocated */ + int mode; { struct inodedep *inodedep; struct bmsafemap *bmsafemap; @@ -4657,7 +4681,7 @@ softdep_setup_inomapdep(bp, ip, newinum) * can be dependent on it. */ if (mp->mnt_kern_flag & MNTK_SUJ) { - jaddref = newjaddref(ip, newinum, 0, 0, 0); + jaddref = newjaddref(ip, newinum, 0, 0, mode); jaddref->ja_state |= NEWBLOCK; } @@ -5014,14 +5038,12 @@ jnewblk_merge(new, old, wkhd) if (jnewblk->jn_blkno != njnewblk->jn_blkno) panic("jnewblk_merge: Merging disparate blocks."); /* - * The record may be rolled back in the cg update bits - * appropriately. NEWBLOCK here alerts the cg rollback code - * that the frag bits have changed. + * The record may be rolled back in the cg. */ if (jnewblk->jn_state & UNDONE) { - njnewblk->jn_state |= UNDONE | NEWBLOCK; - njnewblk->jn_state &= ~ATTACHED; jnewblk->jn_state &= ~UNDONE; + njnewblk->jn_state |= UNDONE; + njnewblk->jn_state &= ~ATTACHED; } /* * We modify the newer addref and free the older so that if neither @@ -10233,6 +10255,70 @@ softdep_setup_blkfree(mp, bp, blkno, fra FREE_LOCK(&lk); } +/* + * Revert a block allocation when the journal record that describes it + * is not yet written. + */ +int +jnewblk_rollback(jnewblk, fs, cgp, blksfree) + struct jnewblk *jnewblk; + struct fs *fs; + struct cg *cgp; + uint8_t *blksfree; +{ + ufs1_daddr_t fragno; + long cgbno, bbase; + int frags, blk; + int i; + + frags = 0; + cgbno = dtogd(fs, jnewblk->jn_blkno); + /* + * We have to test which frags need to be rolled back. We may + * be operating on a stale copy when doing background writes. + */ + for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) + if (isclr(blksfree, cgbno + i)) + frags++; + if (frags == 0) + return (0); + /* + * This is mostly ffs_blkfree() sans some validation and + * superblock updates. + */ + if (frags == fs->fs_frag) { + fragno = fragstoblks(fs, cgbno); + ffs_setblock(fs, blksfree, fragno); + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + } else { + cgbno += jnewblk->jn_oldfrags; + bbase = cgbno - fragnum(fs, cgbno); + /* Decrement the old frags. */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, -1); + /* Deallocate the fragment */ + for (i = 0; i < frags; i++) + setbit(blksfree, cgbno + i); + cgp->cg_cs.cs_nffree += frags; + /* Add back in counts associated with the new frags */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, 1); + /* If a complete block has been reassembled, account for it. */ + fragno = fragstoblks(fs, bbase); + if (ffs_isblock(fs, blksfree, fragno)) { + cgp->cg_cs.cs_nffree -= fs->fs_frag; + ffs_clusteracct(fs, cgp, fragno, 1); + cgp->cg_cs.cs_nbfree++; + } + } + stat_jnewblk++; + jnewblk->jn_state &= ~ATTACHED; + jnewblk->jn_state |= UNDONE; + + return (frags); +} + static void initiate_write_bmsafemap(bmsafemap, bp) struct bmsafemap *bmsafemap; @@ -10244,10 +10330,7 @@ initiate_write_bmsafemap(bmsafemap, bp) uint8_t *blksfree; struct cg *cgp; struct fs *fs; - int cleared; ino_t ino; - long bno; - int i; if (bmsafemap->sm_state & IOSTARTED) panic("initiate_write_bmsafemap: Already started\n"); @@ -10286,25 +10369,9 @@ initiate_write_bmsafemap(bmsafemap, bp) fs = VFSTOUFS(bmsafemap->sm_list.wk_mp)->um_fs; blksfree = cg_blksfree(cgp); LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) { - bno = dtogd(fs, jnewblk->jn_blkno); - cleared = 0; - for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; - i++) { - if (isclr(blksfree, bno + i)) { - cleared = 1; - setbit(blksfree, bno + i); - } - } - /* - * We may not clear the block if it's a background - * copy. In that case there is no reason to detach - * it. - */ - if (cleared) { - stat_jnewblk++; - jnewblk->jn_state &= ~ATTACHED; - jnewblk->jn_state |= UNDONE; - } else if ((bp->b_xflags & BX_BKGRDMARKER) == 0) + if (jnewblk_rollback(jnewblk, fs, cgp, blksfree)) + continue; + if ((bp->b_xflags & BX_BKGRDMARKER) == 0) panic("initiate_write_bmsafemap: block %jd " "marked free", jnewblk->jn_blkno); } @@ -10578,6 +10645,9 @@ handle_jwork(wkhd) case D_FREEDEP: free_freedep(WK_FREEDEP(wk)); continue; + case D_FREEFRAG: + rele_jseg(WK_JSEG(WK_FREEFRAG(wk)->ff_jdep)); + WORKITEM_FREE(wk, D_FREEFRAG); case D_FREEWORK: handle_written_freework(WK_FREEWORK(wk)); continue; @@ -11050,6 +11120,58 @@ bmsafemap_rollbacks(bmsafemap) } /* + * Re-apply an allocation when a cg write is complete. + */ +static int +jnewblk_rollforward(jnewblk, fs, cgp, blksfree) + struct jnewblk *jnewblk; + struct fs *fs; + struct cg *cgp; + uint8_t *blksfree; +{ + ufs1_daddr_t fragno; + ufs2_daddr_t blkno; + long cgbno, bbase; + int frags, blk; + int i; + + frags = 0; + cgbno = dtogd(fs, jnewblk->jn_blkno); + for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) { + if (isclr(blksfree, cgbno + i)) + panic("jnewblk_rollforward: re-allocated fragment"); + frags++; + } + if (frags == fs->fs_frag) { + blkno = fragstoblks(fs, cgbno); + ffs_clrblock(fs, blksfree, (long)blkno); + ffs_clusteracct(fs, cgp, blkno, -1); + cgp->cg_cs.cs_nbfree--; + } else { + bbase = cgbno - fragnum(fs, cgbno); + cgbno += jnewblk->jn_oldfrags; + /* If a complete block had been reassembled, account for it. */ + fragno = fragstoblks(fs, bbase); + if (ffs_isblock(fs, blksfree, fragno)) { + cgp->cg_cs.cs_nffree += fs->fs_frag; + ffs_clusteracct(fs, cgp, fragno, -1); + cgp->cg_cs.cs_nbfree--; + } + /* Decrement the old frags. */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, -1); + /* Allocate the fragment */ + for (i = 0; i < frags; i++) + clrbit(blksfree, cgbno + i); + cgp->cg_cs.cs_nffree -= frags; + /* Add back in counts associated with the new frags */ + blk = blkmap(fs, blksfree, bbase); + ffs_fragacct(fs, blk, cgp->cg_frsum, 1); + } + return (frags); +} + +/* * Complete a write to a bmsafemap structure. Roll forward any bitmap * changes if it's not a background write. Set all written dependencies * to DEPCOMPLETE and free the structure if possible. @@ -11069,9 +11191,7 @@ handle_written_bmsafemap(bmsafemap, bp) struct cg *cgp; struct fs *fs; ino_t ino; - long bno; int chgs; - int i; if ((bmsafemap->sm_state & IOSTARTED) == 0) panic("initiate_write_bmsafemap: Not started\n"); @@ -11121,18 +11241,9 @@ handle_written_bmsafemap(bmsafemap, bp) jntmp) { if ((jnewblk->jn_state & UNDONE) == 0) continue; - bno = dtogd(fs, jnewblk->jn_blkno); - for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; - i++) { - if (bp->b_xflags & BX_BKGRDMARKER) - break; - if ((jnewblk->jn_state & NEWBLOCK) == 0 && - isclr(blksfree, bno + i)) - panic("handle_written_bmsafemap: " - "re-allocated fragment"); - clrbit(blksfree, bno + i); + if ((bp->b_xflags & BX_BKGRDMARKER) == 0 && + jnewblk_rollforward(jnewblk, fs, cgp, blksfree)) chgs = 1; - } jnewblk->jn_state &= ~(UNDONE | NEWBLOCK); jnewblk->jn_state |= ATTACHED; free_jnewblk(jnewblk); @@ -11826,6 +11937,11 @@ softdep_sync_metadata(struct vnode *vp) * truncations are started, and inode references are journaled. */ ACQUIRE_LOCK(&lk); + /* + * Write all journal records to prevent rollbacks on devvp. + */ + if (vp->v_type == VCHR) + softdep_flushjournal(vp->v_mount); error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number); /* * Ensure that all truncates are written so we won't find deps on From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 05:45:37 2011 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 34EA4106564A; Mon, 20 Jun 2011 05:45:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AFC7114F17E; Mon, 20 Jun 2011 05:45:34 +0000 (UTC) Message-ID: <4DFEDE7B.9070701@FreeBSD.org> Date: Sun, 19 Jun 2011 22:45:31 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Ivan Klymenko References: <20110619213749.0cf6397c@ukr.net> In-Reply-To: <20110619213749.0cf6397c@ukr.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 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: r223264 - in head: etc/defaults etc/rc.d 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: Mon, 20 Jun 2011 05:45:38 -0000 On 06/19/2011 11:37, Ivan Klymenko wrote: > Hello! > Thanks for commit. > > I have a question: > If a lot of kernel modules, option kld_list = "" supports moving to a > new line? > For example: > kld_list = " ....< moduleN>\ > " Everything in rc.conf is sh-related, so yes. Although, it's not necessary unless you want it to look pretty. > Maybe specify its example of manual documentation page for rc.conf? I'm not sure that level of user education belongs in rc.conf.5. :) hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 06:42:50 2011 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 A0356106566C; Mon, 20 Jun 2011 06:42:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 312548FC1A; Mon, 20 Jun 2011 06:42:50 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 1FB8B25D388C; Mon, 20 Jun 2011 06:42:48 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B51A815A1371; Mon, 20 Jun 2011 06:42:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id taS2IMebzwM1; Mon, 20 Jun 2011 06:42:45 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 30A5215A1364; Mon, 20 Jun 2011 06:42:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106192259.p5JMxsBS013080@svn.freebsd.org> Date: Mon, 20 Jun 2011 06:42:43 +0000 Content-Transfer-Encoding: 7bit Message-Id: <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> References: <201106192259.p5JMxsBS013080@svn.freebsd.org> To: Doug Barton X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223311 - head/etc/rc.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: Mon, 20 Jun 2011 06:42:50 -0000 On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > Author: dougb > Date: Sun Jun 19 22:59:54 2011 > New Revision: 223311 > URL: http://svn.freebsd.org/changeset/base/223311 > > Log: > Blah, forgot to svn add the actual script from r223310 > Now that it is generic, what about IPv6? > ... > + > + for ip in ${netwait_ip}; do > + echo -n "Waiting for ${ip} to respond to ICMP" > + > + count=1 > + while [ ${count} -le ${netwait_timeout} ]; do > + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 > + rc=$? -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 07:05:40 2011 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 0F0CB1065748; Mon, 20 Jun 2011 07:05:40 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id AA643203405; Mon, 20 Jun 2011 07:05:39 +0000 (UTC) Message-ID: <4DFEF142.1080209@FreeBSD.org> Date: Mon, 20 Jun 2011 00:05:38 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201106192259.p5JMxsBS013080@svn.freebsd.org> <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> In-Reply-To: <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 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, Jeremy Chadwick Subject: Re: svn commit: r223311 - head/etc/rc.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: Mon, 20 Jun 2011 07:05:40 -0000 On 06/19/2011 23:42, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > >> Author: dougb >> Date: Sun Jun 19 22:59:54 2011 >> New Revision: 223311 >> URL: http://svn.freebsd.org/changeset/base/223311 >> >> Log: >> Blah, forgot to svn add the actual script from r223310 >> > > Now that it is generic, what about IPv6? I have no intention of holding an exclusive lock on this script. If you and/or Jeremy work something out feel free to commit it. Just let me know so that when I MFC the original I can catch the update too. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 07:07:19 2011 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 D76491065670; Mon, 20 Jun 2011 07:07:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C34378FC12; Mon, 20 Jun 2011 07:07: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 p5K77Iod028440; Mon, 20 Jun 2011 07:07:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K77Isx028438; Mon, 20 Jun 2011 07:07:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106200707.p5K77Isx028438@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 07:07: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: r223326 - 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: Mon, 20 Jun 2011 07:07:20 -0000 Author: bz Date: Mon Jun 20 07:07:18 2011 New Revision: 223326 URL: http://svn.freebsd.org/changeset/base/223326 Log: Fix a KASSERT from r212803 to check the correct length also in case of IPsec being compiled in and used. Improve reporting by adding the length fields to the panic message, so that we would have some immediate debugging hints. Discussed with: jhb Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jun 20 03:25:09 2011 (r223325) +++ head/sys/netinet/tcp_output.c Mon Jun 20 07:07:18 2011 (r223326) @@ -1102,8 +1102,15 @@ send: m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen; } +#ifdef IPSEC + KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u", + __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); +#else KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected", __func__)); + ("%s: mbuf chain shorter than expected: %ld + %u + %u != %u", + __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); +#endif /* * In transmit state, time the transmission and arrange for From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 07:41:14 2011 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 D0ADF1065670 for ; Mon, 20 Jun 2011 07:41:14 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by mx1.freebsd.org (Postfix) with ESMTP id 90EB28FC13 for ; Mon, 20 Jun 2011 07:41:14 +0000 (UTC) Received: from omta19.westchester.pa.mail.comcast.net ([76.96.62.98]) by qmta03.westchester.pa.mail.comcast.net with comcast id y7Tz1g00227AodY537TzVi; Mon, 20 Jun 2011 07:27:59 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta19.westchester.pa.mail.comcast.net with comcast id y7Tx1g0041t3BNj3f7TxRb; Mon, 20 Jun 2011 07:27:59 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 93CB1102C36; Mon, 20 Jun 2011 00:27:55 -0700 (PDT) Date: Mon, 20 Jun 2011 00:27:55 -0700 From: Jeremy Chadwick To: Doug Barton Message-ID: <20110620072755.GA65080@icarus.home.lan> References: <201106192259.p5JMxsBS013080@svn.freebsd.org> <522D7BA6-2B39-4BE7-B398-9357257E84EC@lists.zabbadoz.net> <4DFEF142.1080209@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DFEF142.1080209@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223311 - head/etc/rc.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: Mon, 20 Jun 2011 07:41:14 -0000 On Mon, Jun 20, 2011 at 12:05:38AM -0700, Doug Barton wrote: > On 06/19/2011 23:42, Bjoern A. Zeeb wrote: > >On Jun 19, 2011, at 10:59 PM, Doug Barton wrote: > > > >>Author: dougb > >>Date: Sun Jun 19 22:59:54 2011 > >>New Revision: 223311 > >>URL: http://svn.freebsd.org/changeset/base/223311 > >> > >>Log: > >> Blah, forgot to svn add the actual script from r223310 > >> > > > >Now that it is generic, what about IPv6? > > I have no intention of holding an exclusive lock on this script. If > you and/or Jeremy work something out feel free to commit it. Just > let me know so that when I MFC the original I can catch the update > too. Hmm... Well, my experience with IPv6 at this point is extremely limited (just because I have a bunch of books doesn't mean I've had the time to read them yet. :-) ) I imagine it wouldn't be too hard to add a netwait_ipv6 variable and use /sbin/ping6 instead, but I'm not sure what people would like in the case that someone defined both netwait_ip and netwait_ipv6. Ping them both I guess? It'd be easier for me if I had a good IPv6 environment to test in/with, rather than enhance the script and make guesses at whether or not it would work reliably. Meaning: I'd be happy to spend the time to write what's necessary, but it might be more effective for someone who already has a good IPv6 setup to work on it. Does that make sense? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 08:00:33 2011 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 44FE2106566B; Mon, 20 Jun 2011 08:00: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 32ABE8FC1F; Mon, 20 Jun 2011 08:00: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 p5K80XDb030163; Mon, 20 Jun 2011 08:00:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K80XLp030158; Mon, 20 Jun 2011 08:00:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106200800.p5K80XLp030158@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 20 Jun 2011 08:00: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: r223328 - in head: contrib/lukemftp contrib/tnftp contrib/tnftp/src usr.bin/ftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 08:00:33 -0000 Author: gavin Date: Mon Jun 20 08:00:32 2011 New Revision: 223328 URL: http://svn.freebsd.org/changeset/base/223328 Log: Merge tnftp-20100108 from the vendor branch into head. PR: bin/112288 bin/120256 bin/129014 bin/145528 MFC after: 1 month Added: head/contrib/tnftp/Makefile.am - copied unchanged from r223308, vendor/tnftp/dist/Makefile.am head/contrib/tnftp/src/Makefile.am - copied unchanged from r223308, vendor/tnftp/dist/src/Makefile.am head/contrib/tnftp/tnftp.h - copied unchanged from r223308, vendor/tnftp/dist/tnftp.h head/usr.bin/ftp/tnftp_config.h - copied, changed from r223307, head/usr.bin/ftp/config.h Deleted: head/contrib/lukemftp/ head/contrib/tnftp/FreeBSD-patchset head/contrib/tnftp/acconfig.h head/contrib/tnftp/aclocal.m4 head/contrib/tnftp/config.h.in head/contrib/tnftp/configure head/contrib/tnftp/configure.in head/contrib/tnftp/diffout head/contrib/tnftp/install-sh head/contrib/tnftp/lukemftp.h head/contrib/tnftp/src/Makefile head/usr.bin/ftp/config.h Modified: head/contrib/tnftp/COPYING (contents, props changed) head/contrib/tnftp/ChangeLog (contents, props changed) head/contrib/tnftp/INSTALL (contents, props changed) head/contrib/tnftp/Makefile.in (contents, props changed) head/contrib/tnftp/NEWS (contents, props changed) head/contrib/tnftp/README (contents, props changed) head/contrib/tnftp/THANKS (contents, props changed) head/contrib/tnftp/src/Makefile.in (contents, props changed) head/contrib/tnftp/src/cmds.c (contents, props changed) head/contrib/tnftp/src/cmdtab.c (contents, props changed) head/contrib/tnftp/src/complete.c (contents, props changed) head/contrib/tnftp/src/domacro.c (contents, props changed) head/contrib/tnftp/src/extern.h (contents, props changed) head/contrib/tnftp/src/fetch.c (contents, props changed) head/contrib/tnftp/src/ftp.1 (contents, props changed) head/contrib/tnftp/src/ftp.c (contents, props changed) head/contrib/tnftp/src/ftp_var.h (contents, props changed) head/contrib/tnftp/src/main.c (contents, props changed) head/contrib/tnftp/src/progressbar.c (contents, props changed) head/contrib/tnftp/src/progressbar.h (contents, props changed) head/contrib/tnftp/src/ruserpass.c (contents, props changed) head/contrib/tnftp/src/util.c (contents, props changed) head/contrib/tnftp/src/version.h (contents, props changed) head/contrib/tnftp/todo (contents, props changed) head/usr.bin/ftp/Makefile Directory Properties: head/contrib/tnftp/ (props changed) Modified: head/contrib/tnftp/COPYING ============================================================================== --- head/contrib/tnftp/COPYING Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/COPYING Mon Jun 20 08:00:32 2011 (r223328) @@ -1,4 +1,10 @@ -Copyright 1999, 2000 Luke Mewburn . All rights reserved. +$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $ + +Copyright (c) 2001-2010 The NetBSD Foundation, Inc. +All rights reserved. + +This code is derived from software contributed to The NetBSD Foundation +by Simon Burge, Luke Mewburn, and Christos Zoulas. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -10,20 +16,24 @@ are met: 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 Luke Mewburn. -4. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -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. + This product includes software developed by the NetBSD + Foundation, Inc. and its contributors. +4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + This product also contains software developed by other people, and you are advised to read the various source files to read the full details @@ -32,11 +42,13 @@ acknowledgements: This product includes software developed by the NetBSD Foundation, Inc. and its contributors. Those contributors include: + - Simon Burge - Jaromir Dolecek - Klaus Klein - Luke Mewburn - Jason R. Thorpe of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. + - Christos Zoulas This product includes software developed by the University of California, Berkeley and its contributors. Those contributors include: Modified: head/contrib/tnftp/ChangeLog ============================================================================== --- head/contrib/tnftp/ChangeLog Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/ChangeLog Mon Jun 20 08:00:32 2011 (r223328) @@ -1,3 +1,713 @@ +$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $ + +Tue Jan 12 06:58:15 UTC 2010 lukem + + * Release as "tnftp 20100108" + + * Rename onoff() argument "bool" to "val". + +Tue Jan 5 09:12:01 UTC 2010 lukem + + * If ARG_MAX isn't defined, use the result from sysconf(_SC_ARG_MAX). + Fixes build when using newer glibc. + + * Add libnetbsd.la to the LIBADD for libedit. + Fix provided by Adam Sampson. + +Mon Jan 4 06:28:07 UTC 2010 lukem + + * Distribute various files not shipped by default automake rules, + to use 'make dist' instead of 'cvs export'. + +Wed Dec 30 00:12:47 UTC 2009 lukem + + * Release as "tnftp 20091122" + +Sun Nov 15 10:14:44 UTC 2009 lukem + + * Merge NetBSD ftp from 20090520 to 20090915. Change: + - Rename internal getline() to get_line() to avoid + conflict with libc with former. + - Avoid a NULL dereference in an error message. + +Sat Nov 14 09:21:19 UTC 2009 lukem + + * Convert to automake & libtool. + +Sat Jun 6 07:17:38 UTC 2009 lukem + + * Release as "tnftp 20090606" + +Fri May 22 01:11:15 UTC 2009 lukem + + * configure fixes: + - Add the time.h headers to accheck_includes, for the strptime check. + - Remove the check for el_init in libedit; we're always replacing + the library and the presence of strvis() in some versions + confuses other checks. + +Wed May 20 13:47:43 UTC 2009 lukem + + * Release as "tnftp 20090520" + + * Merge NetBSD ftp from 20070722 to 20090520. Changes: + - Only attempt to el_parse() a command unknown by the default + parser if editing is enabled. + Fixes PR 38589. + - Turn off the alarmtimer before resetting the SIGALRM handler + back to SIG_DFL. + Fixes PR 35630. + - Add epsv6 and epsv to disable extended passive mode for ipv6 or + both ipv4 and ipv6 respectively. This hack is due to our + friends a Juniper Networks who break epsv in ipv6. + Should be fixed in ScreenOS 6.2.X. + - Improve parsing of chunked transfer chunks per RFC2616: + - more stringent chunk-size parsing + - ignore optional trailing ';chunk-ext' stuff, instead of barfing + - detect EOF before final \r\n. + - Use the service name to getaddrinfo() (along with the host + name), so that features such as DNS Service Discovery have a + better chance of working. + Display the service name in various status & error messages. + - Don't getservbyname() the :port component of a URL; RFC 3986 + says it's just an unsigned number, not a service name. + - Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare). + - Fix -Wshadow issues + - Update copyrights + - Remove clause 3 and 4 from TNF licenses + - Rename HAVE_STRUCT_SOCKADDR_SA_LEN to + HAVE_STRUCT_SOCKADDR_IN_SIN_LEN to accurately reflect the + structure member being used. + - Use AF_INET instead of AF_UNSPEC as the default family if + !defined(INET6). + + * configure improvements: + - Style tweaks. + - Use AC_LANG_PROGRAM() instead of AC_LANG_SOURCE() + - Add a check for strptime() requiring separators between + conversions, and use our replacement one if it does. + +Sat Dec 20 15:28:24 UTC 2008 lukem + + * configure improvements: + - Move IPv6 check from tnftp.h to configure.ac (as per tnftpd). + - Rework option descriptions. + - Highlight when tests are for a specific option. + - Move configuration results to the end of the file. + - Display $prefix in configure results. + +Fri Aug 15 03:03:36 UTC 2008 lukem + + * Add a "Configuration results" display at the end of configure. + Cosmetic tweaks. + +Fri Feb 29 09:45:56 UTC 2008 lukem + + * Support @EXEEXT@ for Cygwin (etc). + +Mon Aug 6 04:55:19 UTC 2007 lukem + + * Release as "tnftp 20070806" + + * Add a NEWS file. + + * Reduce differences between NetBSD-ftp and local copy. + + * Merge NetBSD ftp from 20070605 to 20070722. + Changes: + - Document about:ftp and about:version. + + * Add autoconf check for (Dante) SOCKS5. + (Needs run-time testing and more portability testing.) + +Mon Jul 23 11:44:42 UTC 2007 lukem + + * Don't use non-standard: u_char u_short u_int. + Use uint32_t instead of u_int32_t. + + * Consistently use AS_CASE() and AS_IF() in configure.ac. + + * Don't use defined() with HAVE_DECL_xxx. + Use `LL' instead of `L' suffix for fallback + defines of LLONG_MIN and LLONG_MAX. + +Sun Jul 22 12:00:17 UTC 2007 lukem + + * Include if available, and provide fallback #defines. + + * Sync with lib/libc/inet/inet_pton.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Fix some lint + + * Sync with lib/libc/inet/inet_ntop.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Use socklen_t instead of size_t + * Use snprintf() instead of SPRINTF() + * Improve detection of various boundary conditions + + * Sync to NetBSD glob.h 1.21, glob.c 1.16: + * Standards compliance fix + * De-lint + * Don't overflow when DEBUG is defined. + + * Sync fgetln.c to tools/compat/fgetln.c 1.7: + * Clause 3 removal. + + * Sync to config.guess 2007-07-22, config.sub 2007-06-28. + + * Consistency tweaks in configure help strings. + + * Add check for struct sockaddr.sa_len. + Change tests for HAVE_foo to defined(HAVE_foo). + Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN. + + * Remove pretence of supporting SOCKS for now; + no test system is available, and the old + autoconf 2.13 support wasn't upgraded to 2.61. + + * configure.ac style consistency tweaks. + Move autoconf aux files from ./ to build-aux/ + + * Remove duplicate HAVE_STRERROR replacement in tnftp.h. + +Thu Jun 7 04:47:47 UTC 2007 lukem + + * Merge NetBSD ftp from 20070510 to 20070605. Changes: + - Enforce restriction that (http) proxied URL fetchs don't + support being restarted at this time. + Addresses NetBSD Problem Report 28697. + - Display times in RFC2822 form rather than using ctime(3), + since the former is more explicit about the timezone offset. + - main: call tzset() to ensure TZ is setup for other + functions. + - remotemodtime(): use strptime() to parse the reply. + - fetch_url(): ensure struct tm is zeroed before calling + strptime(). + - Modify parse_url() to consistently strip the leading `/' + off ftp URLs. + Fixes NetBSD Problem Report 17617. + - Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be + consistent with the style in the RFC index. + - Refer to RFC3916 instead of 1738 or 2732. + - Expand the list of supported RFCs in ftp(1) to contain the + document name as well. + +Fri May 11 04:39:55 UTC 2007 lukem + + * Update INSTALL and COPYING. + + * Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only + require support for 'long long' in that check rather than + needing sizeof(off_t)>=8, as some systems have a separate + off64_t when Large File Support is enabled. + + * config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*' + +Thu May 10 15:23:33 UTC 2007 lukem + + * Remove checks for util.h and libutil.h, and replacement for + fparseln(), since fparseln() isn't used any more. + + * Merge NetBSD ftp from 20070418 to 20070510. Changes: + - Switch from fparseln() to the internal getline() when + parsing HTTP headers. Makes ftp a bit more portable + (not needing fparseln()) at the expense of not supporting + arbitrary long header lines, which I'm not concerned about + because we don't support header line continuation either... + - Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. + - Fix misplaced const. + - Implement copy_bytes() to copy bytes from one fd to another + via the provided buffer, with optional rate-limiting and + hash-mark printing, using one loop and handle short writes. + Refactor sendrequest() and recvrequest() to use copy_data(). + Addresses NetBSD Problem Report 15943. + +Wed May 9 05:24:55 UTC 2007 lukem + + * Fix typo in poll()-based implementation of usleep() replacement. + +Wed May 9 04:58:50 UTC 2007 lukem + + * Rename configure.in to configure.ac, as the latter is the + preferred name in autoconf 2.61. + + * Convert from autoconf 2.13 to 2.61: + * Use a consistent quoting mechanism. + * Use modern autoconf macros, #define names, etc. + * Search for more header files, and only #include if found. + * Remove old-style config.h.in generation. + This may fix various tests on platforms such as FreeBSD and OS X. + + * Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the + linker supports it. This is needed so we use our libedit + rather than the system one. + + XXX: SOCKS support is currently disabled until I update the + autoconf support. + +Mon Apr 23 06:04:26 UTC 2007 lukem + + * Merge NetBSD ftp from 20050610 to 20070418. Changes: + - Add '-s srcaddr'. + - Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of + 10^n "KB", "MB", ... + - Recognize 307 redirect code. + - Suppress printing non-COMPLETE reply strings when EPSV/EPRT + fails and we fall-back to PASV/PORT. Should fix a problem + with the emacs ftp wrapper. + - Fix display of 'Continue with ' messages. + - Prevent segfaults in .netrc parsing. + - Flush stdout before each command; ftp as slave process on + a pipe should work. + - getpass() can return NULL in some implementations; cope. + - Support '-q quittime' when waiting for server replies. + - Various spelling & grammatical fixes in the manual. + - Plug some memory leaks. + - If a file upload (via -u) fails, return an non-zero exit + value based on the index of the file that caused the + problem (a la auto-fetch retrieval). + - Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610 + - Don't remove trailing character during auth_url() + - Fix progressbar display on narrow terminals (<43 columns) + +Fri Mar 16 06:00:14 UTC 2007 lukem + + * Change the return value of the replacement gai_strerror() + from "char *" to "const char *", to match the current + standards. + Problem noted by Thomas Klausner. + +Thu Oct 26 07:24:22 UTC 2006 lukem + + * Correctly parse "AM" and "PM" in the replacement strptime(). + Problem noted by Kathryn Hogg. + +Sat Jun 25 06:27:00 UTC 2005 lukem + + * Release as "tnftp 20050625" + + * Simplify the detection & replacement of dirname() and fparseln() + and just use AC_REPLACE_FUNCS. + (We don't care if the vendor has a working version in -lgen or -lutil + instead of -lc; they'll get our replacement version in that case). + Fixes build issue on older Darwin where the previous autoconf check + wouldn't find dirname() in the default system libraries. + + * Only provide a prototype for dirname() if we can't find one in + + + * Search for NS_IN6ADDRSZ instead of IN6ADDRSZ, since we use the + former and not the latter and older Darwin has the former. + (This allows INET6 support to be enabled on Darwin 7.9.0) + +Mon Jun 13 09:22:13 UTC 2005 lukem + + * Tweak SOCKS5 support: + acconfig.h: + - fix a comment + - ensure close() is replaced + - list entries in the same order as aclocal.m4 + (and the SOCKS5 FAQ) + aclocal.m4: + - ensure getpeername() is replaced + - don't replace listen() twice + +Fri Jun 10 04:39:33 UTC 2005 lukem + + * Release as "tnftp 20050610" + + * Add dependencies on ${srcdir}/../tnftp.h and ../config.h + + * Merge NetBSD ftp from 20050609 to 20050610. Changes: + - Implement getline() to read a line into a buffer. + - Convert to use getline() instead of fgets() whenever reading + user input to ensure that an overly long input line doesn't + leave excess characters for the next input operation to + accidentally use as input. + - Zero out the password & account after we've finished with it. + - Consistently use getpass(3) (i.e, character echo suppressed) + when reading the account data. For some reason, historically + the "login" code suppressed echo for Account: yet the "user" + command did not! + - Display the hostname in the "getaddrinfo failed" warning. + - Appease some -Wcast-qual warnings. Fixing all of these + requires significant code refactoring. (mmm, legacy code). + +Thu Jun 9 16:49:05 UTC 2005 lukem + + * src, libnetbsd: Excise RCSID block, rather than using + #if 0 ... #endif. The point was to minimise RCSID + conflicts, and the latter isn't helping there. + + * Merge NetBSD ftp from 20050531 to 20050609. Changes: + - Only print the "Trying
..." message if verbose + and there's more than one struct addrinfo in the + getaddrinfo() result. + - Don't use non-standard "u_int". + +Wed Jun 1 15:08:01 UTC 2005 lukem + + * Look for dirname(3), which may be in -lgen on IRIX, and + replace it if not found.. + +Wed Jun 1 11:48:58 UTC 2005 lukem + + * libnetbsd: + - Don't use non-standard: u_char u_short u_int. + - Use uint32_t instead of u_int32_t. + - Don't use register. + + * libedit: Don't use non-standard uint or u_int. + +Tue May 31 02:23:08 UTC 2005 lukem + + * tnftp.h: need for dirname(3) + + * Merge ftp from 20050513 to 20050531. Changes: + - Helps if the definition of xconnect() matches its + declaration.... + - Fix some cast issues highlighted by Scott Reynolds using + gcc 4 on OSX.4 + - Use size_t instead of int where appropriate. + - Make this compile on sparc64 (size_t != int). + - Printf field widths and size_t don't always mix well, so + cast to int. Fixes build problem for alpha. + - Some const cleanups. + - tab cleanup + - Improve method used in fileindir() to determine if `file' + is in or under `dir': realpath(3) on non-NetBSD systems may + fail if the target filename doesn't exist, so instead use + realpath(3) on the parent directory of `file'. + Per discussion with Todd Eigenschink. + - formatbuf(): fix %m and %M to use the hostname, not the + username. + - fetch_ftp(): preserve 'anonftp' across a disconnect() so + that multiple ftp auto-fetches on the same command line + login automatically. + - auto_fetch(): use an initialized volatile int to appease + IRIX cc. + + * Merge libedit from NetBSD 20050105 to 20050531. Changes include: + - Rui Paulo: Incorrect tok_line and tok_str declarations. + - Remove clause 3 from the UCB license. + - Luke Mewburn: Don't abuse unconstify'ing a string + and writing to it, because you'll core dump. Also remove + extra const that gives pain to the irix compiler. + - Make sure we flush after we prepare when we are unbuffered + otherwise the prompt will not appear immediately. + - Terminate the arglist with a NULL instead of 0. + (Shuts up gcc4.x) + +Sat May 28 13:19:38 UTC 2005 lukem + + * libnetbsd/strvis.c: + - Sync to NetBSD's vis.c 1.33: + Use malloc(3) instead of alloca(3). + - Remove extraenous #endif + +Fri May 27 05:46:58 UTC 2005 lukem + + * libnetbsd/strvis.c: Sync to NetBSD's vis.c 1.30: + Use a more standard TNF license. + + * libedit/sig.c: Include "src/progressbar.h" for xsignal_restart() + prototype. + + * Ensure that fallback #define of __attribute__ is available. + Fixes build problem on HP-UX with cc. + +Thu May 26 14:21:08 UTC 2005 lukem + + * Extend xpoll()'s HAVE_SELECT implementation to support POLLRDNORM, + POLLWRNORM, and POLLRDBAND - the latter using exceptfds. + Per discussion with Christos Zoulas. + +Mon May 16 13:33:27 UTC 2005 lukem + + * Pull in or if they exist even if we're + not using poll, as struct pollfd might exist in those. + Fixes build problem on OSX.3. + + * Separate CPPFLAGS from CFLAGS. + + * Sync various files in libnetbsd with the original versions + in NetBSD. Notable changes + - Convert 4 clause UCB license to 3 clause. + - Use strlcpy instead of strcpy. + - Update ISC copyright. + - Use NS_INADDRSZ, NS_IN6ADDRSZ and NS_INT16SZ instead of + equivalents without NS_ prefix. + - Use socklen_t instead of size_t where appropriate. + - Improve bounds checking. + - Don't update the size of allocated storage until + realloc succeeds. + - Fix comment about return value. + - Reverse the order of two loop invariant to make + 'strlcat(0, "foo", 0)' not get a SEGV. + - Use Todd C. Miller's latest copyright notice (more loose). + - Use "long long" instead of "quad" in various + comments & constants. + - Support VIS_HTTPSTYLE. + - Implement svis(), strsvis(), strsvisx(), strunvisx(). + + * Prefer poll over select when implementing replacement usleep(). + +Sat May 14 04:44:35 UTC 2005 lukem + + * Release "tnftp 20050514" + + * Fail if we can't find a library with tgetent (needed for libedit). + NetBSD PR pkg/28925. + * Improve quoting when using various autoconf macros. + + * Merge NetBSD-ftp 20050513: + - Correct the "optlen" argument passed to getsockopt(3) and + setsockopt(3) in various places. Fixes a problem noted by + Allen Briggs. + - Improve warning printed when connect(2) for the data + channel fails. + +Wed May 11 04:19:43 UTC 2005 lukem + + * Release "tnftp 20050511" + +Wed May 11 04:10:01 UTC 2005 lukem + + * Update the THANKS file. + + * Only use poll() to implement xpoll() if it's available, + otherwise attempt to use select() if that's available, + otherwise #error. + + * Detect if struct pollfd is available in or . + Improve consistency in use of autoconf macros. + +Wed May 11 02:42:08 UTC 2005 lukem + + * Merge NetBSD-ftp 20050511: + - Use socklen_t instead of int as the 5th argument to + getsockopt(). Improve invocation of setsockopt() and + associated failure messages. + +Wed May 11 01:46:29 UTC 2005 lukem + + * Clean up RCSID usage in vendor-derived code, restoring original + IDs where possible. + +Wed May 11 00:08:16 UTC 2005 lukem + + * Merge NetBSD-ftp 20050510: + - Prevent an overly-long input line causing a core dump when + editing is enabled. + Issue noted by Ryoji Kanai in FreeBSD Problem Report # 77158. + - Implement a timeout on the accept(2) in dataconn() and the + connect(2) in xconnect() by temporarily setting O_NONBLOCK + on the socket and using xpoll() to wait for the operation + to succeed. The timeout used is the '-q quittime' argument + (defaults to 60s for accept(2), and the system default for + connect(2)). Idea inspired by discussion with Chuck Cranor. + This may (indirectly) fix various problems with timeouts in + active mode through broken firewalls. + - Implement xpoll() as a wrapper around poll(2), to make it + easier to replace on systems without a functional poll(2). + Unconditionally use xpoll() instead of conditionally using + select(2) or poll(2). + - In fetch_url(), don't call freeaddrinfo(res0) too early, as + we use pointers to its contents later in the function. + Problem found by Onno van der Linden. + - Fix ftp url reget when globs are being used. + Provided by Mathieu Arnold . + - Factor out common string processing code eliminating static + buffers, making functions that should be static be static, + and cleaning up const usage. Added a guard against buffer + overflow, but the domap function is a bit too complicated + to tackle right now. + - Clean up whitespace. + - Expand description of http_proxy by suggesting the use of + RFC 1738 '%xx' encoding for "unsafe URL" characters in + usernames and passwords. + +Wed Jan 5 05:53:59 UTC 2005 lukem + + * For now, assume libedit is not up-to-date and use our own version. + + * Merge libedit from NetBSD 20020605 to 20050105. Changes include: + - Improve vi-mode. + - Delete-previous-char and delete-next-char without an + argument are not supposed to modify the yank buffer in + emacs-mode. + - Improve incremental searching. + - Improve memory allocation & usage. + - Move UCB-licensed code from 4-clause to 3-clause. + - Make the tokenization functions publically available. + - Various tty access bug-fixes. + - Improve readline emulation. + +Tue Jan 4 13:33:40 UTC 2005 lukem + + * Unixware 7.1.1 implements RFC 2133 (Basic Socket Interface + Extensions for IPv6) but not the successor RFC 2553. The configure + script detects this and decides that tnftp needs to compile its own + version of getaddrinfo(). This produces the error message + /usr/include/netdb.h:248: `getaddrinfo' previously defined here + because Unixware provides an implementation of getaddrinfo() in + netdb.h instead of a prototype declaration :-/. Since netdb.h + cannot be omitted, we will always get this definition and tnftp's + version of getaddrinfo will always create a conflict. This ugly + preprocessor hack works around the problem. Hints for a better + solution welcome. Fix from pkgsrc/net/tnftp. + + * Workaround poll() being a compatibility function on Darwin 7 + (MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which + is defined in poll.h on some MacOSX 10.3 systems. Not all 10.3 + systems have poll.h, so only do the poll() test if at least one + of the header files is found. Fix from pkgsrc/net/tnftp. + + * Add a utimes() replacement (using utime()) for Interix. + From pkgsrc/net/tnftp. + +Mon Jan 3 10:21:57 UTC 2005 lukem + + * Release "tnftp 20050103" + + * Merge NetBSD-ftp 20050103: + - Forbid filenames returned from mget that aren't in (or below) + the current directory. The previous behaviour (of trusting + the remote server's response when retrieving the list of + files to mget with prompting disabled) has been in ftp + ~forever, and has been a "known issue" for a long time. + Recently an advisory was published by D.J. Bernstein on + behalf of Yosef Klein warning of the problems with the + previous behaviour, so to alleviate concern I've fixed + this with a sledgehammer. + - Remember the local cwd after any operation which may + change it. + - Use "remotecwd" instead of "remotepwd". + - Add (unsigned char) cast to ctype functions + - Ensure that "mname" is set in ls() and mls() so that an + aborted confirm() prints the correct name. + Problem highlighted & suggested fix from PR [bin/17766] + by Steve McClellan. + - If an ftp auto-fetch transfer is interrupted by SIGINT + (usually ^C), exit with 130 instead of 1 (or rarely, 0). + This allows an ftp auto-fetch in a shell loop to correctly + terminate the loop. + Should fix PR [pkg/26351], and possibly others. + - Save approximately 8K by not including http authentication, + extended status messages and help strings when the + appropriate options are set. + - Move UCB-licensed code from 4-clause to 3-clause licence. + Patches provided by Joel Baker in PR 22365, verified by + Alistair Crooks. + - Always decode %xx in a url's user & pass components. + - Only remember {WWW,Proxy}-Authenticate "Basic" challenges; no + point in tracking any others since ftp doesn't support them. + - Improve the parsing of HTTP responses. + - Don't base64 encode the trailing NUL in the HTTP basic auth + response. Problem noted by Eric Haszlakiewicz. + - Improve parsing of HTTP response headers to be more RFC2616 + compliant, and skip LWS (linear white space; CR, LF, space, + tab) and the end of lines and between the field name and + the field value. This still isn't 100% compliant, since we + don't support "multi line" responses at this time. + This should fix PR [bin/22611] from TAMURA Kent (although I + can't easily find a http server to reproduce the problem + against.) + - Fix a minor memory leak when parsing HTTP response headers. + - Don't unnecessarily display a 401/407 error when running + with -V. Fix from PR [bin/18535] by Jeremy Reed. + - Don't warn about "ignored setsockopt" failures unless + debugging is enabled. Suggested by Todd Vierling. + - Allow empty passwords in ftp://user:@host/file auto-fetch + URLs, per RFC 1738. Requested by Simon Poole. + - correct URL syntax in comment + - Note potentially surprising file-saving behaviour in case + of HTTP redirects + - -n is ignored for auto-fetch transfers + - If connect(2) in xconnect() fails with EINTR, call select(2) + on the socket until it's writable or it fails with something + other than EINTR. This matches the behaviour in SUSv3, and + prevents the problem when pressing ^T (SIGINFO, which is + marked as restartable) during connection setup would cause + ftp to fail with EADDRINUSE or EALREADY when the second + connect(2) was attempted on the same socket. Problem found + and solution provided by Maxime Henrion . + - Add -q to usage. From Kouichirou Hiratsuka in PR 26199. + - PR/25566: Anders Magnusson: ftp(1) do not like large TCP + windows. Limit it to 8M. + +Mon Oct 6 01:23:03 UTC 2003 lukem + + * configure.in improvements: + - When testing for IN6ADDRSZ in , pull in + first. From Stoned Elipot + - Whitespace cleanup + +Mon Aug 25 11:45:45 UTC 2003 lukem + + * Release "tnftp 20030825" + + * Add autoconf test for ; Cygwin needs it for ARG_MAX. + Per discussion with Eugene Kotlyarov . + +Thu Jul 31 07:30:00 UTC 2003 lukem + + * release "tnftp 20030731" + + * merge ftp from NetBSD 20030731 to 20030731b: + - Work around broken ftp servers (notably ProFTPd) that can't + even follow RFC 2389, and skip any amount of whitespace + before a FEATure response. The RFC says 'single space' yet + ProFTPd puts two. Noted by DervishD . + - Improve formatting of features[] debug dump. + - Invalidate remote directory completion cache if any command + which may change the remote contents completes successfully, + including: del, mdel, ren, mkdir, rmdir, quote, and all + upload commands. Patch from Yar Tikhiy . + + * merge ftp from NetBSD 20030228 to 20030731: + - $FTPUSERAGENT overrides the HTTP User-Agent header. + Based on patch from Douwe Kiela . + - Add about:tnftp + - Fix URL in about:netbsd + - netbsd.org->NetBSD.org + - strlcpy fix in fetch.c + - Uppercase "URL" + - fix a bogus error message when given a HTTP URL with a + trailing slash + - groff fixes in man page + - tweak progressbar.c copyright; the stuff jason did in util.c + wasn't migrated to this file + - Don't coredump when printing '%n' in the prompt if there's + no username yet. + Fix from Maxim Konovalov + + * Add test for HAVE_IN6ADDRSZ (which older Darwin is lacking), + and only enable INET6 if it exists. + Patch from Amitai Schlair . + + * Improve ipv6 check for older linux systems that don't provide + sin6_scope_id. + Patch from YAMANO Yuji . + +Fri Feb 28 10:57:30 UTC 2003 lukem + + * tagged as "tnftp 2.0 beta1" + +Fri Feb 28 10:07:07 UTC 2003 lukem + + * renamed to `tnftp' (from `lukemftp') + + * renamed `libukem' to `libnetbsd' + + +Mon Jun 17 06:50:13 UTC 2002 lukem + + * #if USE_GLOB_H, use instead of "ftpglob.h". + Requested by Mike Heffner + Mon Jun 10 08:12:35 UTC 2002 lukem * crank FTP_VERSION from 1.6-beta1 to 1.6-beta2 @@ -223,7 +933,7 @@ Tue Oct 3 10:22:36 EST 2000 lukem Mon Sep 25 21:52:12 EST 2000 lukem * crank to version 1.5 beta5 - + Sun Sep 24 13:31:19 EST 2000 lukem * merge ftp from NetBSD-current (20000924) @@ -243,7 +953,7 @@ Sun Sep 24 13:31:19 EST 2000 lukem - in progressmeter() perform the check for foregroundproc() a little earlier - removed unused variable `items' in list_vertical() - + Sat Sep 23 15:43:34 EST 2000 lukem * remove unused sverrno in warnx() and errx() @@ -406,7 +1116,7 @@ Wed Aug 2 23:43:50 EST 2000 lukem * update from NetBSD-current (20000802): - rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL* (unsigned) equivalents. name change suggested by Klaus - Klein + Klein - change defined(BSD4_4) || HAVE_SIN_LEN tests into HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists @@ -451,7 +1161,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - add support for FEAT and OPTS commands with `features' and `opts'. (from RFC 2389). - add support for MLST & MLSD (machine parseble listings) - with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. + with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands. (from draft-ietf-ftpext-mlst-11) - rename remotesyst() to getremoteinfo(), and modify to parse the result from FEAT (if supported), and take into account @@ -473,7 +1183,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem - minor knf (indent goto labels by one space, etc). - simply various command usage handlers by assuming that argv != NULL except for quit() and disconnect(). - - errx?/warnx? audit. do not pass variable alone, use %s. + - errx?/warnx? audit. do not pass variable alone, use %s. * check for issetugid() and don't use in libedit if it doesn't exist. @@ -572,12 +1282,12 @@ Sun Jun 4 18:00:07 EST 2000 lukem - do not pass scoped IPv6 address notation on Host: directive, since scope identifier is local to the originating node. do not allow scoped IPv6 address notation in URL, if it is - via proxy. + via proxy. - fixes from cgd: * sanity check a length (otherwise certain bogus responses can crash ftp) * allow a transfer encoding type of `binary'; certain - firewall vendors return this bogus type... + firewall vendors return this bogus type... - make debugging output unambiguous on IPv6 numeric addrs (don't use host:port) - http://[::1]:8080/ is legal. @@ -705,7 +1415,7 @@ Sun Nov 28 18:20:41 EST 1999 lukem - implement xsl_init() and xsl_add(); error checking forms of sl_{init,add}() - fix bug where the second press of on an empty word (i.e, list - all options) may have resulted in an strncmp() against NULL. + all options) may have resulted in an strncmp() against NULL. (detected by _DIAGASSERT()) - in cleanuppeer(), reset username to NULL after free()ing it. fixes [bin/8870] by Wolfgang Rupprecht @@ -985,7 +1695,7 @@ Mon Oct 4 10:57:41 EST 1999 lukem * Add support for --{en,dis}able-editcomplete (defaults to enabled), which prevents libedit support from being compiled in. - From Chris G. Demetriou + From Chris G. Demetriou Sun Oct 3 16:49:01 EST 1999 lukem Modified: head/contrib/tnftp/INSTALL ============================================================================== --- head/contrib/tnftp/INSTALL Mon Jun 20 07:58:44 2011 (r223327) +++ head/contrib/tnftp/INSTALL Mon Jun 20 08:00:32 2011 (r223328) @@ -1,8 +1,7 @@ INSTALLATION INTRODUCTION ------------------------- -This file describes how to compile and install lukemftp on your -system. +This file describes how to compile and install tnftp on your system. ============================================ = = @@ -11,24 +10,20 @@ system. ============================================ -For most systems, execute the following to compile and install -lukemftp: +For most systems, execute the following to compile and install tnftp: ./configure make make install -A preformatted manual page (src/ftp.cat1) is also installed. If -you wish to install the source (src/ftp.1), ensure that your system -has up-to-date mandoc macros. groff ships with this macro suite, -but it has bugs. Try: - ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/tmac/ -for a more recent version. +A preformatted manual page (src/ftp.cat1) is also installed. +If you wish to install the source (src/ftp.1), ensure that your system +has up-to-date mandoc macros, such as those that are shipped with groff. CONFIGURATION OPTIONS --------------------- -lukemftp is configured using an `autoconf' generated `configure' +tnftp is configured using an `autoconf' generated `configure' script. `configure' supports the following options: * The standard `autoconf configure' options, including: @@ -41,14 +36,11 @@ script. `configure' supports the follow * Specific options: --enable-editcomplete Turn on command line editing and completion. - --disable-editcomplete Turn off command line editing and completion - [default: enabled]. - --enable-ipv6 Enable IPv6 support (if your OS supports it) - --disable-ipv6 Disable IPv6 support (even if your OS supports it.) - [default: enabled]. - --with-socks Compile with SOCKS firewall traversal support. - --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support. - --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support. + (default: enabled) + --enable-ipv6 Enable IPv6 support (if your OS supports it). + (default: enabled) + --disable-largefile omit support for large files + --with-socks enable support for (Dante) SOCKS5 proxy The following environment variables can be set to override various compiler related settings. @@ -66,146 +58,3 @@ This can be achieved with: = = ============================================ - -PLATFORM SPECIFIC NOTES ------------------------ - -The following platforms & compilers have been tested: - -- AIX 4.1.5: -- AIX 4.2.1: -- AIX 4.3.3: - - Compiler: xlc -qlanglvl=ansi - version: xlC 3.1.4.10 -- C for AIX Compiler - version: ibmcxx.cmp 3.6.6.6 -- IBM C and C++ Compilers - - Configure with: - env CC="xlc" CFLAGS="-qlanglvl=ansi" ./configure - -- BSD/OS 4.0.1 (x86) -- BSD/OS 4.1 (x86) -- BSD/OS 4.1 (sparc) -- BSD/OS 4.2 (x86) - - Compiler: /bin/cc - version: gcc 2.7.2.1 - version: gcc version 2.95.2 19991024 - -- Digital UNIX 4.0b -- Digital UNIX 4.0d -- Digital UNIX 4.0f - - Compiler: cc -std - version: DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564) - version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229) - - Configure with - env CC="cc -std" ./configure - - - Compiler: gcc - version: 2.95.1 - -- Digital UNIX 5.0 - - Compiler: cc - version: Compaq C V6.1-011 on Digital UNIX V5.0 (Rev. 910) - -- FreeBSD 3.4 (i386): -- FreeBSD 3.5 (i386): -- FreeBSD 4.1 (i386): - - Compiler: cc - version: gcc version 2.7.2.3 - version: gcc version 2.95.2 19991024 - -- HP/UX 10.20: -- HP/UX 11.00: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.10.32.03 - - Configure with - env CC="cc -Ae" ./configure - - To generate code that will run on old architectures you - may need to add "+DAportable" to CC. - - -- IRIX 6.5.4 -- IRIX 6.5.8 - Compiler: /bin/cc - version: MIPSpro Compilers: Version 7.2.1 - Compiler: - version: gcc version 2.95.2 - -- HP/UX 11.00: -- HP/UX 11.00 64 bit: - - Compiler: /opt/ansic/bin/cc -Ae - version: A.11.01.00 - - Configure with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 08:37:21 2011 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 5DEB01065672; Mon, 20 Jun 2011 08:37:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4498FC15; Mon, 20 Jun 2011 08:37: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 p5K8bLAI031298; Mon, 20 Jun 2011 08:37:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K8bLjC031292; Mon, 20 Jun 2011 08:37:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106200837.p5K8bLjC031292@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 08:37: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: r223329 - stable/8/contrib/pf/pfctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 08:37:21 -0000 Author: bz Date: Mon Jun 20 08:37:20 2011 New Revision: 223329 URL: http://svn.freebsd.org/changeset/base/223329 Log: MFC r223057: Add a new option -P to suppress getservbyport(3) calls when printing rules. This allows one to force consistent printing of numeric port numbers like we do with -n for other tools like netstat (just that -n was already taken) rather than the service names. PR: misc/151015 Submitted by: Matt Koivisto (mkoivisto sandvine.com) Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/pf/pfctl/pfctl.8 stable/8/contrib/pf/pfctl/pfctl.c stable/8/contrib/pf/pfctl/pfctl_optimize.c stable/8/contrib/pf/pfctl/pfctl_parser.c stable/8/contrib/pf/pfctl/pfctl_parser.h Directory Properties: stable/8/contrib/pf/ (props changed) Modified: stable/8/contrib/pf/pfctl/pfctl.8 ============================================================================== --- stable/8/contrib/pf/pfctl/pfctl.8 Mon Jun 20 08:00:32 2011 (r223328) +++ stable/8/contrib/pf/pfctl/pfctl.8 Mon Jun 20 08:37:20 2011 (r223329) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2002 +.Dd June 13, 2011 .Dt PFCTL 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pfctl .Bk -words -.Op Fl AdeghmNnOqRrvz +.Op Fl AdeghmNnOPqRrvz .Op Fl a Ar anchor .Oo Fl D Ar macro Ns = .Ar value Oc @@ -350,6 +350,9 @@ without any options will enable optimizations, and a second .Fl o will enable profiling. +.It Fl P +Do not perform service name lookup for port specific rules, +instead display the ports numerically. .It Fl p Ar device Use the device file .Ar device @@ -670,6 +673,7 @@ Passive operating system fingerprint dat .Xr pf.conf 5 , .Xr pf.os 5 , .Xr rc.conf 5 , +.Xr services 5 , .Xr sysctl.conf 5 , .Xr authpf 8 , .Xr ftp-proxy 8 , Modified: stable/8/contrib/pf/pfctl/pfctl.c ============================================================================== --- stable/8/contrib/pf/pfctl/pfctl.c Mon Jun 20 08:00:32 2011 (r223328) +++ stable/8/contrib/pf/pfctl/pfctl.c Mon Jun 20 08:37:20 2011 (r223329) @@ -235,7 +235,7 @@ usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-AdeghmNnOqRrvz] ", __progname); + fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname); fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n"); fprintf(stderr, "\t[-f file] [-i interface] [-K host | network] "); fprintf(stderr, "[-k host | network ]\n"); @@ -770,6 +770,7 @@ pfctl_show_rules(int dev, char *path, in struct pfioc_rule pr; u_int32_t nr, mnr, header = 0; int rule_numbers = opts & (PF_OPT_VERBOSE2 | PF_OPT_DEBUG); + int numeric = opts & PF_OPT_NUMERIC; int len = strlen(path); int brace; char *p; @@ -834,7 +835,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_RULES: if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL)) labels = 1; - print_rule(&pr.rule, pr.anchor_call, rule_numbers); + print_rule(&pr.rule, pr.anchor_call, rule_numbers, numeric); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); break; @@ -894,7 +895,7 @@ pfctl_show_rules(int dev, char *path, in } else p = &pr.anchor_call[0]; - print_rule(&pr.rule, p, rule_numbers); + print_rule(&pr.rule, p, rule_numbers, numeric); if (brace) printf(" {\n"); else @@ -951,7 +952,7 @@ pfctl_show_nat(int dev, int opts, char * dotitle = 0; } print_rule(&pr.rule, pr.anchor_call, - opts & PF_OPT_VERBOSE2); + opts & PF_OPT_VERBOSE2, opts & PF_OPT_NUMERIC); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); pfctl_clear_pool(&pr.rule.rpool); @@ -1318,7 +1319,8 @@ pfctl_load_rule(struct pfctl *pf, char * if (pf->opts & PF_OPT_VERBOSE) { INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2)); print_rule(r, r->anchor ? r->anchor->name : "", - pf->opts & PF_OPT_VERBOSE2); + pf->opts & PF_OPT_VERBOSE2, + pf->opts & PF_OPT_NUMERIC); } path[len] = '\0'; pfctl_clear_pool(&r->rpool); @@ -1978,7 +1980,7 @@ main(int argc, char *argv[]) usage(); while ((ch = getopt(argc, argv, - "a:AdD:eqf:F:ghi:k:K:mnNOo::p:rRs:t:T:vx:z")) != -1) { + "a:AdD:eqf:F:ghi:k:K:mnNOo::Pp:rRs:t:T:vx:z")) != -1) { switch (ch) { case 'a': anchoropt = optarg; @@ -2080,6 +2082,9 @@ main(int argc, char *argv[]) case 'p': pf_device = optarg; break; + case 'P': + opts |= PF_OPT_NUMERIC; + break; case 's': showopt = pfctl_lookup_option(optarg, showopt_list); if (showopt == NULL) { Modified: stable/8/contrib/pf/pfctl/pfctl_optimize.c ============================================================================== --- stable/8/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 20 08:00:32 2011 (r223328) +++ stable/8/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 20 08:37:20 2011 (r223329) @@ -407,7 +407,7 @@ optimize_superblock(struct pfctl *pf, st TAILQ_FOREACH(por, &block->sb_rules, por_entry) { printf(" "); print_rule(&por->por_rule, por->por_rule.anchor ? - por->por_rule.anchor->name : "", 1); + por->por_rule.anchor->name : "", 1, 0); } #endif /* OPT_DEBUG */ Modified: stable/8/contrib/pf/pfctl/pfctl_parser.c ============================================================================== --- stable/8/contrib/pf/pfctl/pfctl_parser.c Mon Jun 20 08:00:32 2011 (r223328) +++ stable/8/contrib/pf/pfctl/pfctl_parser.c Mon Jun 20 08:37:20 2011 (r223329) @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); #include "pfctl.h" void print_op (u_int8_t, const char *, const char *); -void print_port (u_int8_t, u_int16_t, u_int16_t, const char *); +void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); void print_flags (u_int8_t); void print_fromto(struct pf_rule_addr *, pf_osfp_t, - struct pf_rule_addr *, u_int8_t, u_int8_t, int); + struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); struct node_host *ifa_grouplookup(const char *, int); @@ -320,12 +320,15 @@ print_op(u_int8_t op, const char *a1, co } void -print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto) +print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numeric) { char a1[6], a2[6]; struct servent *s; - s = getservbyport(p1, proto); + if (!numeric) + s = getservbyport(p1, proto); + else + s = NULL; p1 = ntohs(p1); p2 = ntohs(p2); snprintf(a1, sizeof(a1), "%u", p1); @@ -363,7 +366,7 @@ print_flags(u_int8_t f) void print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst, - sa_family_t af, u_int8_t proto, int verbose) + sa_family_t af, u_int8_t proto, int verbose, int numeric) { char buf[PF_OSFP_LEN*3]; if (src->addr.type == PF_ADDR_ADDRMASK && @@ -384,7 +387,8 @@ print_fromto(struct pf_rule_addr *src, p if (src->port_op) print_port(src->port_op, src->port[0], src->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); if (osfp != PF_OSFP_ANY) printf(" os \"%s\"", pfctl_lookup_fingerprint(osfp, buf, sizeof(buf))); @@ -396,7 +400,8 @@ print_fromto(struct pf_rule_addr *src, p if (dst->port_op) print_port(dst->port_op, dst->port[0], dst->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); } } @@ -673,7 +678,7 @@ print_src_node(struct pf_src_node *sn, i } void -print_rule(struct pf_rule *r, const char *anchor_call, int verbose) +print_rule(struct pf_rule *r, const char *anchor_call, int verbose, int numeric) { static const char *actiontypes[] = { "pass", "block", "scrub", "no scrub", "nat", "no nat", "binat", "no binat", "rdr", "no rdr" }; @@ -800,7 +805,7 @@ print_rule(struct pf_rule *r, const char printf(" proto %u", r->proto); } print_fromto(&r->src, r->os_fingerprint, &r->dst, r->af, r->proto, - verbose); + verbose, numeric); if (r->uid.op) print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", UID_MAX); Modified: stable/8/contrib/pf/pfctl/pfctl_parser.h ============================================================================== --- stable/8/contrib/pf/pfctl/pfctl_parser.h Mon Jun 20 08:00:32 2011 (r223328) +++ stable/8/contrib/pf/pfctl/pfctl_parser.h Mon Jun 20 08:37:20 2011 (r223329) @@ -48,6 +48,7 @@ #define PF_OPT_DEBUG 0x0200 #define PF_OPT_SHOWALL 0x0400 #define PF_OPT_OPTIMIZE 0x0800 +#define PF_OPT_NUMERIC 0x1000 #define PF_OPT_MERGE 0x2000 #define PF_OPT_RECURSE 0x4000 @@ -235,7 +236,7 @@ int pfctl_load_anchors(int, struct pfctl void print_pool(struct pf_pool *, u_int16_t, u_int16_t, sa_family_t, int); void print_src_node(struct pf_src_node *, int); -void print_rule(struct pf_rule *, const char *, int); +void print_rule(struct pf_rule *, const char *, int, int); void print_tabledef(const char *, int, int, struct node_tinithead *); void print_status(struct pf_status *, int); From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 08:37:34 2011 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 E080C10656E6; Mon, 20 Jun 2011 08:37:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEA888FC0A; Mon, 20 Jun 2011 08:37: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 p5K8bY7Y031344; Mon, 20 Jun 2011 08:37:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5K8bYR5031338; Mon, 20 Jun 2011 08:37:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106200837.p5K8bYR5031338@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 08:37:34 +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: r223330 - stable/7/contrib/pf/pfctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 08:37:35 -0000 Author: bz Date: Mon Jun 20 08:37:34 2011 New Revision: 223330 URL: http://svn.freebsd.org/changeset/base/223330 Log: MFC r223057: Add a new option -P to suppress getservbyport(3) calls when printing rules. This allows one to force consistent printing of numeric port numbers like we do with -n for other tools like netstat (just that -n was already taken) rather than the service names. PR: misc/151015 Submitted by: Matt Koivisto (mkoivisto sandvine.com) Sponsored by: Sandvine Incorporated Modified: stable/7/contrib/pf/pfctl/pfctl.8 stable/7/contrib/pf/pfctl/pfctl.c stable/7/contrib/pf/pfctl/pfctl_optimize.c stable/7/contrib/pf/pfctl/pfctl_parser.c stable/7/contrib/pf/pfctl/pfctl_parser.h Directory Properties: stable/7/contrib/pf/ (props changed) Modified: stable/7/contrib/pf/pfctl/pfctl.8 ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl.8 Mon Jun 20 08:37:20 2011 (r223329) +++ stable/7/contrib/pf/pfctl/pfctl.8 Mon Jun 20 08:37:34 2011 (r223330) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2002 +.Dd June 13, 2011 .Dt PFCTL 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pfctl .Bk -words -.Op Fl AdeghmNnOqRrvz +.Op Fl AdeghmNnOPqRrvz .Op Fl a Ar anchor .Oo Fl D Ar macro Ns = .Ar value Oc @@ -350,6 +350,9 @@ without any options will enable optimizations, and a second .Fl o will enable profiling. +.It Fl P +Do not perform service name lookup for port specific rules, +instead display the ports numerically. .It Fl p Ar device Use the device file .Ar device @@ -670,6 +673,7 @@ Passive operating system fingerprint dat .Xr pf.conf 5 , .Xr pf.os 5 , .Xr rc.conf 5 , +.Xr services 5 , .Xr sysctl.conf 5 , .Xr authpf 8 , .Xr ftp-proxy 8 , Modified: stable/7/contrib/pf/pfctl/pfctl.c ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl.c Mon Jun 20 08:37:20 2011 (r223329) +++ stable/7/contrib/pf/pfctl/pfctl.c Mon Jun 20 08:37:34 2011 (r223330) @@ -235,7 +235,7 @@ usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-AdeghmNnOqRrvz] ", __progname); + fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname); fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n"); fprintf(stderr, "\t[-f file] [-i interface] [-K host | network] "); fprintf(stderr, "[-k host | network ]\n"); @@ -770,6 +770,7 @@ pfctl_show_rules(int dev, char *path, in struct pfioc_rule pr; u_int32_t nr, mnr, header = 0; int rule_numbers = opts & (PF_OPT_VERBOSE2 | PF_OPT_DEBUG); + int numeric = opts & PF_OPT_NUMERIC; int len = strlen(path); int brace; char *p; @@ -834,7 +835,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_RULES: if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL)) labels = 1; - print_rule(&pr.rule, pr.anchor_call, rule_numbers); + print_rule(&pr.rule, pr.anchor_call, rule_numbers, numeric); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); break; @@ -894,7 +895,7 @@ pfctl_show_rules(int dev, char *path, in } else p = &pr.anchor_call[0]; - print_rule(&pr.rule, p, rule_numbers); + print_rule(&pr.rule, p, rule_numbers, numeric); if (brace) printf(" {\n"); else @@ -951,7 +952,7 @@ pfctl_show_nat(int dev, int opts, char * dotitle = 0; } print_rule(&pr.rule, pr.anchor_call, - opts & PF_OPT_VERBOSE2); + opts & PF_OPT_VERBOSE2, opts & PF_OPT_NUMERIC); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); pfctl_clear_pool(&pr.rule.rpool); @@ -1318,7 +1319,8 @@ pfctl_load_rule(struct pfctl *pf, char * if (pf->opts & PF_OPT_VERBOSE) { INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2)); print_rule(r, r->anchor ? r->anchor->name : "", - pf->opts & PF_OPT_VERBOSE2); + pf->opts & PF_OPT_VERBOSE2, + pf->opts & PF_OPT_NUMERIC); } path[len] = '\0'; pfctl_clear_pool(&r->rpool); @@ -1978,7 +1980,7 @@ main(int argc, char *argv[]) usage(); while ((ch = getopt(argc, argv, - "a:AdD:eqf:F:ghi:k:K:mnNOo::p:rRs:t:T:vx:z")) != -1) { + "a:AdD:eqf:F:ghi:k:K:mnNOo::Pp:rRs:t:T:vx:z")) != -1) { switch (ch) { case 'a': anchoropt = optarg; @@ -2080,6 +2082,9 @@ main(int argc, char *argv[]) case 'p': pf_device = optarg; break; + case 'P': + opts |= PF_OPT_NUMERIC; + break; case 's': showopt = pfctl_lookup_option(optarg, showopt_list); if (showopt == NULL) { Modified: stable/7/contrib/pf/pfctl/pfctl_optimize.c ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 20 08:37:20 2011 (r223329) +++ stable/7/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 20 08:37:34 2011 (r223330) @@ -407,7 +407,7 @@ optimize_superblock(struct pfctl *pf, st TAILQ_FOREACH(por, &block->sb_rules, por_entry) { printf(" "); print_rule(&por->por_rule, por->por_rule.anchor ? - por->por_rule.anchor->name : "", 1); + por->por_rule.anchor->name : "", 1, 0); } #endif /* OPT_DEBUG */ Modified: stable/7/contrib/pf/pfctl/pfctl_parser.c ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl_parser.c Mon Jun 20 08:37:20 2011 (r223329) +++ stable/7/contrib/pf/pfctl/pfctl_parser.c Mon Jun 20 08:37:34 2011 (r223330) @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); #include "pfctl.h" void print_op (u_int8_t, const char *, const char *); -void print_port (u_int8_t, u_int16_t, u_int16_t, const char *); +void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); void print_flags (u_int8_t); void print_fromto(struct pf_rule_addr *, pf_osfp_t, - struct pf_rule_addr *, u_int8_t, u_int8_t, int); + struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); struct node_host *ifa_grouplookup(const char *, int); @@ -320,12 +320,15 @@ print_op(u_int8_t op, const char *a1, co } void -print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto) +print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numeric) { char a1[6], a2[6]; struct servent *s; - s = getservbyport(p1, proto); + if (!numeric) + s = getservbyport(p1, proto); + else + s = NULL; p1 = ntohs(p1); p2 = ntohs(p2); snprintf(a1, sizeof(a1), "%u", p1); @@ -363,7 +366,7 @@ print_flags(u_int8_t f) void print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst, - sa_family_t af, u_int8_t proto, int verbose) + sa_family_t af, u_int8_t proto, int verbose, int numeric) { char buf[PF_OSFP_LEN*3]; if (src->addr.type == PF_ADDR_ADDRMASK && @@ -384,7 +387,8 @@ print_fromto(struct pf_rule_addr *src, p if (src->port_op) print_port(src->port_op, src->port[0], src->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); if (osfp != PF_OSFP_ANY) printf(" os \"%s\"", pfctl_lookup_fingerprint(osfp, buf, sizeof(buf))); @@ -396,7 +400,8 @@ print_fromto(struct pf_rule_addr *src, p if (dst->port_op) print_port(dst->port_op, dst->port[0], dst->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); } } @@ -673,7 +678,7 @@ print_src_node(struct pf_src_node *sn, i } void -print_rule(struct pf_rule *r, const char *anchor_call, int verbose) +print_rule(struct pf_rule *r, const char *anchor_call, int verbose, int numeric) { static const char *actiontypes[] = { "pass", "block", "scrub", "no scrub", "nat", "no nat", "binat", "no binat", "rdr", "no rdr" }; @@ -800,7 +805,7 @@ print_rule(struct pf_rule *r, const char printf(" proto %u", r->proto); } print_fromto(&r->src, r->os_fingerprint, &r->dst, r->af, r->proto, - verbose); + verbose, numeric); if (r->uid.op) print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", UID_MAX); Modified: stable/7/contrib/pf/pfctl/pfctl_parser.h ============================================================================== --- stable/7/contrib/pf/pfctl/pfctl_parser.h Mon Jun 20 08:37:20 2011 (r223329) +++ stable/7/contrib/pf/pfctl/pfctl_parser.h Mon Jun 20 08:37:34 2011 (r223330) @@ -48,6 +48,7 @@ #define PF_OPT_DEBUG 0x0200 #define PF_OPT_SHOWALL 0x0400 #define PF_OPT_OPTIMIZE 0x0800 +#define PF_OPT_NUMERIC 0x1000 #define PF_OPT_MERGE 0x2000 #define PF_OPT_RECURSE 0x4000 @@ -235,7 +236,7 @@ int pfctl_load_anchors(int, struct pfctl void print_pool(struct pf_pool *, u_int16_t, u_int16_t, sa_family_t, int); void print_src_node(struct pf_src_node *, int); -void print_rule(struct pf_rule *, const char *, int); +void print_rule(struct pf_rule *, const char *, int, int); void print_tabledef(const char *, int, int, struct node_tinithead *); void print_status(struct pf_status *, int); From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 09:06:45 2011 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 316DD106564A; Mon, 20 Jun 2011 09:06:45 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au [211.29.133.76]) by mx1.freebsd.org (Postfix) with ESMTP id AC7DE8FC12; Mon, 20 Jun 2011 09:06:44 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5K96ft2030893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 19:06:42 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p5K96f6K065239; Mon, 20 Jun 2011 19:06:41 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p5K96eK4065238; Mon, 20 Jun 2011 19:06:40 +1000 (EST) (envelope-from peter) Date: Mon, 20 Jun 2011 19:06:40 +1000 From: Peter Jeremy To: Bruce Evans Message-ID: <20110620090640.GA64900@server.vk2pj.dyndns.org> References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110609055112.P2870@besplex.bde.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <20110618210815.W889@besplex.bde.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc 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: r222866 - head/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: Mon, 20 Jun 2011 09:06:45 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jun-18 22:05:06 +1000, Bruce Evans wrote: >My clock measurement program (mostly an old program by Wollman) shows >the following histogram of times for a non-invariant TSC timecounter >on a 2GHz UP system: > >% min 273, max 265102, mean 273.998217, std 79.069534 >% 1th: 273 (1727219 observations) >% 2th: 274 (265607 observations) >% 3th: 275 (6984 observations) >% 4th: 280 (11 observations) >% 5th: 290 (8 observations) > >The variance is small, and differences of a single nS can be seen clearly. Unfortunately, Intel broke this in their P-state invariant TSC implementation. Rather than incrementing the TSC by one at the CPU core frequency, they increment by the core multiplier at the FSB frequency. This gives a result like the following on my Atom N270: delta samples 24 49637124 36 50312540 48 44658 60 77 This makes it virtually impossible to measure short periods. Luckily, AMD seem to have gotten this right. --=20 Peter Jeremy --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk3/DaAACgkQ/opHv/APuIdI0wCgij6nEhp+ektNaMC7IsxhSFdI skwAoJPNjU5v015VsBvQx07kGtOnw9dI =Ehiz -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 11:46:03 2011 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 A185A106566B; Mon, 20 Jun 2011 11:46:03 +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 9196B8FC13; Mon, 20 Jun 2011 11:46: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 p5KBk3nS048382; Mon, 20 Jun 2011 11:46:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KBk309048379; Mon, 20 Jun 2011 11:46:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106201146.p5KBk309048379@svn.freebsd.org> From: Adrian Chadd Date: Mon, 20 Jun 2011 11:46: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: r223331 - 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: Mon, 20 Jun 2011 11:46:03 -0000 Author: adrian Date: Mon Jun 20 11:46:03 2011 New Revision: 223331 URL: http://svn.freebsd.org/changeset/base/223331 Log: Add a callback for ADDBA response timeouts. TX for the given TID needs to be paused during ADDBA requests (and unpaused once the session is established.) Since net80211 currently doesn't implement software aggregation, if this pause/unpause is done in the driver (as it is in my development branch) then it will need to be unpaused both on ADDBA response and on ADDBA timeout. This callback allows the driver to unpause TX for the relevant TID. Reviewed by: bschmidt Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Mon Jun 20 08:37:34 2011 (r223330) +++ head/sys/net80211/ieee80211_ht.c Mon Jun 20 11:46:03 2011 (r223331) @@ -217,6 +217,9 @@ static int ieee80211_addba_response(stru int code, int baparamset, int batimeout); static void ieee80211_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap); +static void null_addba_response_timeout(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap); + static void ieee80211_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status); static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap); @@ -234,6 +237,7 @@ ieee80211_ht_attach(struct ieee80211com ic->ic_ampdu_enable = ieee80211_ampdu_enable; ic->ic_addba_request = ieee80211_addba_request; ic->ic_addba_response = ieee80211_addba_response; + ic->ic_addba_response_timeout = null_addba_response_timeout; ic->ic_addba_stop = ieee80211_addba_stop; ic->ic_bar_response = ieee80211_bar_response; ic->ic_ampdu_rx_start = ampdu_rx_start; @@ -1691,14 +1695,23 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK); } +/* + * ADDBA response timeout. + * + * If software aggregation and per-TID queue management was done here, + * that queue would be unpaused after the ADDBA timeout occurs. + */ static void addba_timeout(void *arg) { struct ieee80211_tx_ampdu *tap = arg; + struct ieee80211_node *ni = tap->txa_ni; + struct ieee80211com *ic = ni->ni_ic; /* XXX ? */ tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND; tap->txa_attempts++; + ic->ic_addba_response_timeout(ni, tap); } static void @@ -1721,6 +1734,12 @@ addba_stop_timeout(struct ieee80211_tx_a } } +static void +null_addba_response_timeout(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap) +{ +} + /* * Default method for requesting A-MPDU tx aggregation. * We setup the specified state block and start a timer Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Jun 20 08:37:34 2011 (r223330) +++ head/sys/net80211/ieee80211_var.h Mon Jun 20 11:46:03 2011 (r223331) @@ -307,6 +307,8 @@ struct ieee80211com { int status, int baparamset, int batimeout); void (*ic_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *); + void (*ic_addba_response_timeout)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); /* BAR response received */ void (*ic_bar_response)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int status); From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 12:03:52 2011 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 2B9571065675; Mon, 20 Jun 2011 12:03:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id ADE6D8FC1D; Mon, 20 Jun 2011 12:03:51 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5KC3hvD007146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Jun 2011 22:03:44 +1000 Date: Mon, 20 Jun 2011 22:03:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Peter Jeremy In-Reply-To: <20110620090640.GA64900@server.vk2pj.dyndns.org> Message-ID: <20110620213851.D1479@besplex.bde.org> References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110609055112.P2870@besplex.bde.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> <20110620090640.GA64900@server.vk2pj.dyndns.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, Bruce Evans Subject: Re: svn commit: r222866 - head/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: Mon, 20 Jun 2011 12:03:52 -0000 On Mon, 20 Jun 2011, Peter Jeremy wrote: > On 2011-Jun-18 22:05:06 +1000, Bruce Evans wrote: >> My clock measurement program (mostly an old program by Wollman) shows >> the following histogram of times for a non-invariant TSC timecounter >> on a 2GHz UP system: >> >> % min 273, max 265102, mean 273.998217, std 79.069534 >> % 1th: 273 (1727219 observations) >> % 2th: 274 (265607 observations) >> % 3th: 275 (6984 observations) >> % 4th: 280 (11 observations) >> % 5th: 290 (8 observations) >> >> The variance is small, and differences of a single nS can be seen clearly. > > Unfortunately, Intel broke this in their P-state invariant TSC > implementation. Rather than incrementing the TSC by one at the > CPU core frequency, they increment by the core multiplier at the > FSB frequency. This gives a result like the following on my Atom > N270: > delta samples > 24 49637124 > 36 50312540 > 48 44658 > 60 77 > > This makes it virtually impossible to measure short periods. > > Luckily, AMD seem to have gotten this right. I tested a FreeBSD cluster machine in userland, since it doesn't have a usable TSC timecounter (iterating $(sysctl kern.timcounter...) is too slow. %%% #include #include #include static unsigned buf[17]; static volatile unsigned v; int main(void) { int i; for (i = 0; i < 17; i++) buf[i] = rdtsc(); for (i = 0; i < 16; i++) printf("%u\n", buf[i + 1] - buf[i]); buf[0] = rdtsc(); for (i = 0; i < 1000000; i++) v = rdtsc(); printf("%.1f\n", (v - buf[0]) / 1e6); return (0); } %%% Output: 77 63 63 70 63 63 63 70 63 63 70 63 63 63 70 63 65.2 %%% It seems to always give a multiple of 7, so that might be the multiplier. 63 is also a lot, and limits the resulotion to ~34 nS at 1.86GHz. On an original Athlon64: %%% 34 8 5 8 5 8 5 8 5 8 5 8 5 8 5 8 6.5 %%% Phenom specs say 42 instead of ~6.5 IIRC. Only slightly better than 63. This is execution latencu, but although rdtsc is non-serialzied, there is only 1 of it at least on old CPUs, so it can never deliver results faster than its latency, on average. The 5's in the above seem to be lower than the latency, due to the 8's being delivered late. I normally write tests like the above in asm to get more control over the loop overhead, but the above behaviour is interesting since it is what will happen for normal unsynchronized use of rdtsc. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 12:22:30 2011 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 CA58E1065674; Mon, 20 Jun 2011 12:22:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAAE78FC0A; Mon, 20 Jun 2011 12:22: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 p5KCMUQk049514; Mon, 20 Jun 2011 12:22:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCMUB7049512; Mon, 20 Jun 2011 12:22:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201222.p5KCMUB7049512@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 12:22: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: r223332 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 12:22:30 -0000 Author: ae Date: Mon Jun 20 12:22:30 2011 New Revision: 223332 URL: http://svn.freebsd.org/changeset/base/223332 Log: Change the way how we update bootcode for BSD scheme. Since the only parameter that we check is size of bootcode, then allow only two sizes: size of boot1 and size of /boot/boot. This partially protects users from losing ability to boot if incorrect bootcode is specified. Requested by: ru Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Mon Jun 20 11:46:03 2011 (r223331) +++ head/sys/geom/part/g_part_bsd.c Mon Jun 20 12:22:30 2011 (r223332) @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include "g_part_if.h" +#define BOOT1_SIZE 512 +#define LABEL_SIZE 512 +#define BOOT2_OFF (BOOT1_SIZE + LABEL_SIZE) +#define BOOT2_SIZE (BBSIZE - BOOT2_OFF) + FEATURE(geom_part_bsd, "GEOM partitioning class for BSD disklabels"); struct g_part_bsd_table { @@ -170,22 +175,16 @@ g_part_bsd_bootcode(struct g_part_table { struct g_part_bsd_table *table; const u_char *codeptr; - size_t hdsz, tlsz; - size_t codesz, tlofs; - hdsz = 512; - tlofs = hdsz + 148 + basetable->gpt_entries * 16; - tlsz = BBSIZE - tlofs; + if (gpp->gpp_codesize != BOOT1_SIZE && gpp->gpp_codesize != BBSIZE) + return (ENODEV); + table = (struct g_part_bsd_table *)basetable; - bzero(table->bbarea, hdsz); - bzero(table->bbarea + tlofs, tlsz); codeptr = gpp->gpp_codeptr; - codesz = MIN(hdsz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(codeptr, table->bbarea, codesz); - codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); - if (codesz > 0) - bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + bcopy(codeptr, table->bbarea, BOOT1_SIZE); + if (gpp->gpp_codesize == BBSIZE) + bcopy(codeptr + BOOT2_OFF, table->bbarea + BOOT2_OFF, + BOOT2_SIZE); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 12:32:59 2011 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 6520F106566C; Mon, 20 Jun 2011 12:32:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54CD38FC15; Mon, 20 Jun 2011 12:32: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 p5KCWxgM049854; Mon, 20 Jun 2011 12:32:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCWxV3049852; Mon, 20 Jun 2011 12:32:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201232.p5KCWxV3049852@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 12:32: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: r223333 - stable/8/sys/netinet/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: Mon, 20 Jun 2011 12:32:59 -0000 Author: ae Date: Mon Jun 20 12:32:59 2011 New Revision: 223333 URL: http://svn.freebsd.org/changeset/base/223333 Log: MFC r222742: Do not return EINVAL when user does `ipfw set N flush` on an empty set. Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Mon Jun 20 12:22:30 2011 (r223332) +++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Mon Jun 20 12:32:59 2011 (r223333) @@ -349,12 +349,13 @@ del_entry(struct ip_fw_chain *chain, uin } if (n == 0) { - /* A flush request (arg == 0) on empty ruleset - * returns with no error. On the contrary, + /* A flush request (arg == 0 or cmd == 1) on empty + * ruleset returns with no error. On the contrary, * if there is no match on a specific request, * we return EINVAL. */ - error = (arg == 0) ? 0 : EINVAL; + if (arg != 0 && cmd != 1) + error = EINVAL; break; } From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 12:35:12 2011 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 97516106564A; Mon, 20 Jun 2011 12:35:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87DCF8FC12; Mon, 20 Jun 2011 12:35: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 p5KCZCqk049993; Mon, 20 Jun 2011 12:35:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KCZCMb049991; Mon, 20 Jun 2011 12:35:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106201235.p5KCZCMb049991@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 12:35:12 +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: r223334 - 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: Mon, 20 Jun 2011 12:35:12 -0000 Author: bz Date: Mon Jun 20 12:35:12 2011 New Revision: 223334 URL: http://svn.freebsd.org/changeset/base/223334 Log: Leave an extra comment about flowtable and IPv6 support rectifying a previous comment. MFC after: 1 week Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Jun 20 12:32:59 2011 (r223333) +++ head/sys/net/route.c Mon Jun 20 12:35:12 2011 (r223334) @@ -1189,6 +1189,7 @@ rtrequest1_fib(int req, struct rt_addrin rt0 = NULL; /* XXX * "flow-table" only support IPv4 at the moment. + * XXX-BZ as of r205066 it would support IPv6. */ #ifdef INET if (dst->sa_family == AF_INET) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 13:46:39 2011 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 557CA1065670; Mon, 20 Jun 2011 13:46:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44F0A8FC18; Mon, 20 Jun 2011 13:46: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 p5KDkddt052246; Mon, 20 Jun 2011 13:46:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KDkdrv052244; Mon, 20 Jun 2011 13:46:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201346.p5KDkdrv052244@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 13:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223336 - stable/8/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: Mon, 20 Jun 2011 13:46:39 -0000 Author: ae Date: Mon Jun 20 13:46:38 2011 New Revision: 223336 URL: http://svn.freebsd.org/changeset/base/223336 Log: MFC r222744: Increase buffer size for the command line. PR: bin/125370 Modified: stable/8/sbin/ipfw/main.c Directory Properties: stable/8/sbin/ipfw/ (props changed) Modified: stable/8/sbin/ipfw/main.c ============================================================================== --- stable/8/sbin/ipfw/main.c Mon Jun 20 12:40:21 2011 (r223335) +++ stable/8/sbin/ipfw/main.c Mon Jun 20 13:46:38 2011 (r223336) @@ -444,7 +444,7 @@ static void ipfw_readfile(int ac, char *av[]) { #define MAX_ARGS 32 - char buf[BUFSIZ]; + char buf[4096]; char *progname = av[0]; /* original program name */ const char *cmd = NULL; /* preprocessor name, if any */ const char *filename = av[ac-1]; /* file to read */ @@ -552,7 +552,7 @@ ipfw_readfile(int ac, char *av[]) } } - while (fgets(buf, BUFSIZ, f)) { /* read commands */ + while (fgets(buf, sizeof(buf), f)) { /* read commands */ char linename[20]; char *args[2]; From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 13:46:57 2011 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 AAFED1065672; Mon, 20 Jun 2011 13:46:57 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6FD8FC21; Mon, 20 Jun 2011 13:46: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 p5KDkvjb052290; Mon, 20 Jun 2011 13:46:57 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KDkvOZ052288; Mon, 20 Jun 2011 13:46:57 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201346.p5KDkvOZ052288@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 13:46:57 +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: r223337 - stable/7/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: Mon, 20 Jun 2011 13:46:57 -0000 Author: ae Date: Mon Jun 20 13:46:57 2011 New Revision: 223337 URL: http://svn.freebsd.org/changeset/base/223337 Log: MFC r222744: Increase buffer size for the command line. PR: bin/125370 Modified: stable/7/sbin/ipfw/main.c Directory Properties: stable/7/sbin/ipfw/ (props changed) Modified: stable/7/sbin/ipfw/main.c ============================================================================== --- stable/7/sbin/ipfw/main.c Mon Jun 20 13:46:38 2011 (r223336) +++ stable/7/sbin/ipfw/main.c Mon Jun 20 13:46:57 2011 (r223337) @@ -382,7 +382,7 @@ static void ipfw_readfile(int ac, char *av[]) { #define MAX_ARGS 32 - char buf[BUFSIZ]; + char buf[4096]; char *progname = av[0]; /* original program name */ const char *cmd = NULL; /* preprocessor name, if any */ const char *filename = av[ac-1]; /* file to read */ @@ -490,7 +490,7 @@ ipfw_readfile(int ac, char *av[]) } } - while (fgets(buf, BUFSIZ, f)) { /* read commands */ + while (fgets(buf, sizeof(buf), f)) { /* read commands */ char linename[20]; char *args[2]; From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 13:51:54 2011 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 0F02C1065673; Mon, 20 Jun 2011 13:51:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2B7A8FC21; Mon, 20 Jun 2011 13:51: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 p5KDprCo052501; Mon, 20 Jun 2011 13:51:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KDprJV052499; Mon, 20 Jun 2011 13:51:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201351.p5KDprJV052499@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 13:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223338 - stable/8/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: Mon, 20 Jun 2011 13:51:54 -0000 Author: ae Date: Mon Jun 20 13:51:53 2011 New Revision: 223338 URL: http://svn.freebsd.org/changeset/base/223338 Log: MFC r222745: Initialize co.use_set variable before parsing each new rule. PR: bin/134975 Modified: stable/8/sbin/ipfw/main.c Directory Properties: stable/8/sbin/ipfw/ (props changed) Modified: stable/8/sbin/ipfw/main.c ============================================================================== --- stable/8/sbin/ipfw/main.c Mon Jun 20 13:46:57 2011 (r223337) +++ stable/8/sbin/ipfw/main.c Mon Jun 20 13:51:53 2011 (r223338) @@ -356,6 +356,7 @@ ipfw_main(int oldac, char **oldav) */ co.do_nat = 0; co.do_pipe = 0; + co.use_set = 0; if (!strncmp(*av, "nat", strlen(*av))) co.do_nat = 1; else if (!strncmp(*av, "pipe", strlen(*av))) From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 13:52:14 2011 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 BB6621065689; Mon, 20 Jun 2011 13:52:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8B168FC20; Mon, 20 Jun 2011 13:52: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 p5KDqEdZ052552; Mon, 20 Jun 2011 13:52:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KDqEVe052550; Mon, 20 Jun 2011 13:52:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106201352.p5KDqEVe052550@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 20 Jun 2011 13:52:14 +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: r223339 - stable/7/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: Mon, 20 Jun 2011 13:52:16 -0000 Author: ae Date: Mon Jun 20 13:52:14 2011 New Revision: 223339 URL: http://svn.freebsd.org/changeset/base/223339 Log: MFC r222745: Initialize co.use_set variable before parsing each new rule. PR: bin/134975 Modified: stable/7/sbin/ipfw/main.c Directory Properties: stable/7/sbin/ipfw/ (props changed) Modified: stable/7/sbin/ipfw/main.c ============================================================================== --- stable/7/sbin/ipfw/main.c Mon Jun 20 13:51:53 2011 (r223338) +++ stable/7/sbin/ipfw/main.c Mon Jun 20 13:52:14 2011 (r223339) @@ -298,6 +298,7 @@ ipfw_main(int oldac, char **oldav) */ co.do_nat = 0; co.do_pipe = 0; + co.use_set = 0; if (!strncmp(*av, "nat", strlen(*av))) co.do_nat = 1; else if (!strncmp(*av, "pipe", strlen(*av))) From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 15:22:47 2011 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 852ED106564A; Mon, 20 Jun 2011 15:22:47 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 754768FC14; Mon, 20 Jun 2011 15:22: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 p5KFMleV055317; Mon, 20 Jun 2011 15:22:47 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KFMl0F055315; Mon, 20 Jun 2011 15:22:47 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <201106201522.p5KFMl0F055315@svn.freebsd.org> From: Jun Kuriyama Date: Mon, 20 Jun 2011 15:22: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: r223340 - head/usr.sbin/ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 15:22:47 -0000 Author: kuriyama Date: Mon Jun 20 15:22:47 2011 New Revision: 223340 URL: http://svn.freebsd.org/changeset/base/223340 Log: Add missing argument for -h in usage. Modified: head/usr.sbin/ypserv/yp_main.c Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Mon Jun 20 13:52:14 2011 (r223339) +++ head/usr.sbin/ypserv/yp_main.c Mon Jun 20 15:22:47 2011 (r223340) @@ -216,7 +216,7 @@ reaper(int sig) static void usage(void) { - fprintf(stderr, "usage: ypserv [-h] [-d] [-n] [-p path] [-P port]\n"); + fprintf(stderr, "usage: ypserv [-h addr] [-d] [-n] [-p path] [-P port]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 16:42:20 2011 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 A2F011065673; Mon, 20 Jun 2011 16:42:20 +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 92FE28FC0A; Mon, 20 Jun 2011 16:42: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 p5KGgKgV057618; Mon, 20 Jun 2011 16:42:20 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KGgKww057616; Mon, 20 Jun 2011 16:42:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106201642.p5KGgKww057616@svn.freebsd.org> From: Xin LI Date: Mon, 20 Jun 2011 16:42: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: r223341 - head/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 16:42:20 -0000 Author: delphij Date: Mon Jun 20 16:42:20 2011 New Revision: 223341 URL: http://svn.freebsd.org/changeset/base/223341 Log: Correct a typo. Submitted by: Fabian Keil MFC after: 3 days Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Jun 20 15:22:47 2011 (r223340) +++ head/sys/dev/atkbdc/atkbd.c Mon Jun 20 16:42:20 2011 (r223341) @@ -1100,7 +1100,7 @@ get_typematic(keyboard_t *kbd) /* * Traditional entry points of int 0x15 and 0x16 are fixed * and later BIOSes follow them. (U)EFI CSM specification - * also mandate these fixed entry points. + * also mandates these fixed entry points. * * Validate the entry points here before we proceed further. * It's known that some recent laptops does not have the From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 16:48:00 2011 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 BF624106564A; Mon, 20 Jun 2011 16:48:00 +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 AF3E88FC1A; Mon, 20 Jun 2011 16:48: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 p5KGm0Zh057856; Mon, 20 Jun 2011 16:48:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KGm0fp057853; Mon, 20 Jun 2011 16:48:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106201648.p5KGm0fp057853@svn.freebsd.org> From: Xin LI Date: Mon, 20 Jun 2011 16:48: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: r223342 - head/contrib/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 16:48:00 -0000 Author: delphij Date: Mon Jun 20 16:48:00 2011 New Revision: 223342 URL: http://svn.freebsd.org/changeset/base/223342 Log: Revert r214857 pursudant to 9.0-RELEASE cycle. Requested by: jh Modified: head/contrib/top/display.c head/contrib/top/top.h Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Mon Jun 20 16:42:20 2011 (r223341) +++ head/contrib/top/display.c Mon Jun 20 16:48:00 2011 (r223342) @@ -698,7 +698,7 @@ char *text; int width; s = NULL; - width = screen_width; + width = display_width; header_length = strlen(text); if (header_length >= width) { s = malloc((width + 1) * sizeof(char)); @@ -706,14 +706,6 @@ char *text; return (NULL); strncpy(s, text, width); s[width] = '\0'; - } else { - s = malloc((width + 1) * sizeof(char)); - if (s == NULL) - return (NULL); - strncpy(s, text, width); - while (screen_width > header_length) - s[header_length++] = ' '; - s[width] = '\0'; } return (s); } @@ -738,7 +730,7 @@ char *text; if (header_status == ON) { putchar('\n'); - standout(text, stdout); + fputs(text, stdout); lastline++; } else if (header_status == ERASE) Modified: head/contrib/top/top.h ============================================================================== --- head/contrib/top/top.h Mon Jun 20 16:42:20 2011 (r223341) +++ head/contrib/top/top.h Mon Jun 20 16:48:00 2011 (r223342) @@ -14,7 +14,7 @@ extern int Header_lines; /* 7 */ /* Maximum number of columns allowed for display */ -#define MAX_COLS 512 +#define MAX_COLS 128 /* Log base 2 of 1024 is 10 (2^10 == 1024) */ #define LOG1024 10 From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 18:08:35 2011 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 254011065670; Mon, 20 Jun 2011 18:08:35 +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 13FF58FC08; Mon, 20 Jun 2011 18:08: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 p5KI8Y5u060352; Mon, 20 Jun 2011 18:08:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KI8Yej060347; Mon, 20 Jun 2011 18:08:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106201808.p5KI8Yej060347@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Jun 2011 18:08: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: r223343 - stable/8/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: Mon, 20 Jun 2011 18:08:35 -0000 Author: jhb Date: Mon Jun 20 18:08:34 2011 New Revision: 223343 URL: http://svn.freebsd.org/changeset/base/223343 Log: MFC 221346,223049: Handle a rare edge case with nearly full TCP receive buffers. If a TCP buffer fills up causing the remote sender to enter into persist mode, but there is still room available in the receive buffer when a window probe arrives (either due to window scaling, or due to the local application very slowing draining data from the receive buffer), then the single byte of data in the window probe is accepted. However, this can cause rcv_nxt to be greater than rcv_adv. This condition will only last until the next ACK packet is pushed out via tcp_output(), and since the previous ACK advertised a zero window, the ACK should be pushed out while the TCP pcb is write-locked. To guarantee this, advance the advertised window (rcv_adv) even if we advertise a zero window. During the window while rcv_nxt is greather than rcv_adv, a few places would compute the remaining receive window via rcv_adv - rcv_nxt. However, this value was then (uint32_t)-1. On a 64 bit machine this could expand to a positive 2^32 - 1 when cast to a long. In particular, when calculating the receive window in tcp_output(), the result would be that the receive window was computed as 2^32 - 1 resulting in advertising a far larger window to the remote peer than actually existed. Fix various places that compute the remaining receive window to either assert that it is not negative (i.e. rcv_nxt <= rcv_adv), or treat the window as full if rcv_nxt is greather than rcv_adv. Modified: stable/8/sys/netinet/tcp_input.c stable/8/sys/netinet/tcp_output.c stable/8/sys/netinet/tcp_timewait.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Mon Jun 20 16:48:00 2011 (r223342) +++ stable/8/sys/netinet/tcp_input.c Mon Jun 20 18:08:34 2011 (r223343) @@ -1792,6 +1792,9 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), + ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, + tp->rcv_adv, tp->rcv_nxt)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ @@ -2830,7 +2833,10 @@ dodata: /* XXX */ * buffer size. * XXX: Unused. */ - len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) + len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); + else + len = so->so_rcv.sb_hiwat; #endif } else { m_freem(m); Modified: stable/8/sys/netinet/tcp_output.c ============================================================================== --- stable/8/sys/netinet/tcp_output.c Mon Jun 20 16:48:00 2011 (r223342) +++ stable/8/sys/netinet/tcp_output.c Mon Jun 20 18:08:34 2011 (r223343) @@ -574,15 +574,21 @@ after_sack_rexmit: * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ - long adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale) - - (tp->rcv_adv - tp->rcv_nxt); + long adv; + int oldwin; + + adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale); + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) { + oldwin = (tp->rcv_adv - tp->rcv_nxt); + adv -= oldwin; + } else + oldwin = 0; /* * If the new window size ends up being the same as the old * size when it is scaled, then don't force a window update. */ - if ((tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale == - (adv + tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale) + if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; if (adv >= (long) (2 * tp->t_maxseg)) goto send; @@ -996,7 +1002,8 @@ send: if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && recwin < (long)tp->t_maxseg) recwin = 0; - if (recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) recwin = (long)(tp->rcv_adv - tp->rcv_nxt); if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) recwin = (long)TCP_MAXWIN << tp->rcv_scale; @@ -1304,7 +1311,7 @@ out: * then remember the size of the advertised window. * Any pending ACK has now been sent. */ - if (recwin > 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) + if (recwin >= 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) tp->rcv_adv = tp->rcv_nxt + recwin; tp->last_ack_sent = tp->rcv_nxt; tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); Modified: stable/8/sys/netinet/tcp_timewait.c ============================================================================== --- stable/8/sys/netinet/tcp_timewait.c Mon Jun 20 16:48:00 2011 (r223342) +++ stable/8/sys/netinet/tcp_timewait.c Mon Jun 20 18:08:34 2011 (r223343) @@ -228,6 +228,9 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), + ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, + tp->rcv_adv, tp->rcv_nxt)); tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; /* From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 18:08:52 2011 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 A320D1065677; Mon, 20 Jun 2011 18:08:52 +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 592318FC1A; Mon, 20 Jun 2011 18:08: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 p5KI8qcB060397; Mon, 20 Jun 2011 18:08:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KI8qYU060393; Mon, 20 Jun 2011 18:08:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106201808.p5KI8qYU060393@svn.freebsd.org> From: John Baldwin Date: Mon, 20 Jun 2011 18:08:52 +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: r223344 - stable/7/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: Mon, 20 Jun 2011 18:08:52 -0000 Author: jhb Date: Mon Jun 20 18:08:52 2011 New Revision: 223344 URL: http://svn.freebsd.org/changeset/base/223344 Log: MFC 221346,223049: Handle a rare edge case with nearly full TCP receive buffers. If a TCP buffer fills up causing the remote sender to enter into persist mode, but there is still room available in the receive buffer when a window probe arrives (either due to window scaling, or due to the local application very slowing draining data from the receive buffer), then the single byte of data in the window probe is accepted. However, this can cause rcv_nxt to be greater than rcv_adv. This condition will only last until the next ACK packet is pushed out via tcp_output(), and since the previous ACK advertised a zero window, the ACK should be pushed out while the TCP pcb is write-locked. To guarantee this, advance the advertised window (rcv_adv) even if we advertise a zero window. During the window while rcv_nxt is greather than rcv_adv, a few places would compute the remaining receive window via rcv_adv - rcv_nxt. However, this value was then (uint32_t)-1. On a 64 bit machine this could expand to a positive 2^32 - 1 when cast to a long. In particular, when calculating the receive window in tcp_output(), the result would be that the receive window was computed as 2^32 - 1 resulting in advertising a far larger window to the remote peer than actually existed. Fix various places that compute the remaining receive window to either assert that it is not negative (i.e. rcv_nxt <= rcv_adv), or treat the window as full if rcv_nxt is greather than rcv_adv. Modified: stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_timewait.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Mon Jun 20 18:08:34 2011 (r223343) +++ stable/7/sys/netinet/tcp_input.c Mon Jun 20 18:08:52 2011 (r223344) @@ -1236,6 +1236,9 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), + ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, + tp->rcv_adv, tp->rcv_nxt)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ @@ -2288,7 +2291,10 @@ dodata: /* XXX */ * buffer size. * XXX: Unused. */ - len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) + len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); + else + len = so->so_rcv.sb_hiwat; #endif } else { m_freem(m); Modified: stable/7/sys/netinet/tcp_output.c ============================================================================== --- stable/7/sys/netinet/tcp_output.c Mon Jun 20 18:08:34 2011 (r223343) +++ stable/7/sys/netinet/tcp_output.c Mon Jun 20 18:08:52 2011 (r223344) @@ -557,15 +557,21 @@ after_sack_rexmit: * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ - long adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale) - - (tp->rcv_adv - tp->rcv_nxt); + long adv; + int oldwin; + + adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale); + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) { + oldwin = (tp->rcv_adv - tp->rcv_nxt); + adv -= oldwin; + } else + oldwin = 0; /* * If the new window size ends up being the same as the old * size when it is scaled, then don't force a window update. */ - if ((tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale == - (adv + tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale) + if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; if (adv >= (long) (2 * tp->t_maxseg)) goto send; @@ -935,7 +941,8 @@ send: if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && recwin < (long)tp->t_maxseg) recwin = 0; - if (recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && + recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) recwin = (long)(tp->rcv_adv - tp->rcv_nxt); if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) recwin = (long)TCP_MAXWIN << tp->rcv_scale; @@ -1239,7 +1246,7 @@ out: * then remember the size of the advertised window. * Any pending ACK has now been sent. */ - if (recwin > 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) + if (recwin >= 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) tp->rcv_adv = tp->rcv_nxt + recwin; tp->last_ack_sent = tp->rcv_nxt; tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); Modified: stable/7/sys/netinet/tcp_timewait.c ============================================================================== --- stable/7/sys/netinet/tcp_timewait.c Mon Jun 20 18:08:34 2011 (r223343) +++ stable/7/sys/netinet/tcp_timewait.c Mon Jun 20 18:08:52 2011 (r223344) @@ -210,6 +210,9 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), + ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, + tp->rcv_adv, tp->rcv_nxt)); tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; /* From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 19:07:20 2011 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 53E0C1065674; Mon, 20 Jun 2011 19:07:20 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC0F8FC19; Mon, 20 Jun 2011 19:07:19 +0000 (UTC) Received: by pzk27 with SMTP id 27so5091420pzk.13 for ; Mon, 20 Jun 2011 12:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=asMHKwnzeWAqkv7wsmBIB6qQ1aIJ91+wMQyi+NPZnaU=; b=CGReixrJdnzGyel73I6dMaXp5zQg82kNaypfz/VKuAZ6vWtS2fO963nvYpwhFOQz1w 2TJg6jYaRrm9lw0qsGx3ENENmpXjadGDFieoIEhRg4BPrCCXxE/qXLSt/VRNvnfoIAGZ fc1ecyR64MqHUfN/JPDy6z56LUB5rUS6FtPxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=QI/87y5CKfH/ecx5r4ENTwx5TXSDHKeNzXyViTRmkdoT/e8rRIxfDzLAGSD9BX+Hgj WFPt4kkILk/ToGz+qk6hk64FEPQJ2eGaQbP+8oswLW2aKDvslpARcMUSDO66F9RHXq+G gL7n8AZDM50s4H5prnxybpijo1yOXynR5pO64= Received: by 10.142.3.27 with SMTP id 27mr743455wfc.173.1308596837287; Mon, 20 Jun 2011 12:07:17 -0700 (PDT) Received: from localhost (saeed.torservers.net [72.46.129.45]) by mx.google.com with ESMTPS id n8sm422185pbh.73.2011.06.20.12.07.09 (version=SSLv3 cipher=OTHER); Mon, 20 Jun 2011 12:07:13 -0700 (PDT) From: Pan Tsu To: Xin LI References: <201106201648.p5KGm0fp057853__48193.742396734$1308588512$gmane$org@svn.freebsd.org> Date: Mon, 20 Jun 2011 23:07:01 +0400 In-Reply-To: <201106201648.p5KGm0fp057853__48193.742396734$1308588512$gmane$org@svn.freebsd.org> (Xin LI's message of "Mon, 20 Jun 2011 16:48:00 +0000 (UTC)") Message-ID: <86k4cgz5ii.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223342 - head/contrib/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 19:07:20 -0000 Xin LI writes: > Author: delphij > Date: Mon Jun 20 16:48:00 2011 > New Revision: 223342 > URL: http://svn.freebsd.org/changeset/base/223342 > > Log: > Revert r214857 pursudant to 9.0-RELEASE cycle. > > Requested by: jh What about closing bin/153235 ? From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 21:28:50 2011 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 7FF39106564A; Mon, 20 Jun 2011 21:28:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EB188FC0C; Mon, 20 Jun 2011 21: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 p5KLSooe066382; Mon, 20 Jun 2011 21:28:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLSo2C066374; Mon, 20 Jun 2011 21:28:50 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106202128.p5KLSo2C066374@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2011 21:28: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: r223345 - head/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 21:28:50 -0000 Author: bz Date: Mon Jun 20 21:28:50 2011 New Revision: 223345 URL: http://svn.freebsd.org/changeset/base/223345 Log: Add global -d and -e options to either print device numbers (usually default) or enclosure:slot information as (Exx:Sxx) or both. Discussed with: jhb Reviewed by: jhb Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_config.c head/usr.sbin/mfiutil/mfi_drive.c head/usr.sbin/mfiutil/mfi_patrol.c head/usr.sbin/mfiutil/mfi_show.c head/usr.sbin/mfiutil/mfiutil.8 head/usr.sbin/mfiutil/mfiutil.c head/usr.sbin/mfiutil/mfiutil.h Modified: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_config.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_config.c Mon Jun 20 21:28:50 2011 (r223345) @@ -419,8 +419,10 @@ build_array(int fd, char *arrayp, struct ar->array_ref = find_next_array(state); for (i = 0; i < array_info->drive_count; i++) { if (verbose) - printf("Adding drive %u to array %u\n", + printf("Adding drive %s to array %u\n", + mfi_drive_name(NULL, array_info->drives[i].ref.v.device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS), ar->array_ref); if (ar->size > array_info->drives[i].coerced_size) ar->size = array_info->drives[i].coerced_size; Modified: head/usr.sbin/mfiutil/mfi_drive.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_drive.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_drive.c Mon Jun 20 21:28:50 2011 (r223345) @@ -45,6 +45,87 @@ MFI_TABLE(top, drive); +/* + * Print the name of a drive either by drive number as %2u or by enclosure:slot + * as Exx:Sxx (or both). Use default unless command line options override it + * and the command allows this (which we usually do unless we already print + * both). We prefer pinfo if given, otherwise try to look it up by device_id. + */ +const char * +mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def) +{ + struct mfi_pd_info info; + static char buf[16]; + char *p; + int error, fd, len; + + if ((def & MFI_DNAME_HONOR_OPTS) != 0 && + (mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) != 0) + def = mfi_opts & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID); + + buf[0] = '\0'; + if (pinfo == NULL && def & MFI_DNAME_ES) { + /* Fallback in case of error, just ignore flags. */ + if (device_id == 0xffff) + snprintf(buf, sizeof(buf), "MISSING"); + else + snprintf(buf, sizeof(buf), "%2u", device_id); + + fd = mfi_open(mfi_unit); + if (fd < 0) { + warn("mfi_open"); + return (buf); + } + + /* Get the info for this drive. */ + if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) { + warn("Failed to fetch info for drive %2u", device_id); + close(fd); + return (buf); + } + + close(fd); + pinfo = &info; + } + + p = buf; + len = sizeof(buf); + if (def & MFI_DNAME_DEVICE_ID) { + if (device_id == 0xffff) + error = snprintf(p, len, "MISSING"); + else + error = snprintf(p, len, "%2u", device_id); + if (error >= 0) { + p += error; + len -= error; + } + } + if ((def & (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID)) == + (MFI_DNAME_ES|MFI_DNAME_DEVICE_ID) && len >= 2) { + *p++ = ' '; + len--; + *p = '\0'; + len--; + } + if (def & MFI_DNAME_ES) { + if (pinfo->encl_device_id == 0xffff) + error = snprintf(p, len, "S%u", + pinfo->slot_number); + else if (pinfo->encl_device_id == pinfo->ref.v.device_id) + error = snprintf(p, len, "E%u", + pinfo->encl_index); + else + error = snprintf(p, len, "E%u:S%u", + pinfo->encl_index, pinfo->slot_number); + if (error >= 0) { + p += error; + len -= error; + } + } + + return (buf); +} + const char * mfi_pdstate(enum mfi_pd_state state) { @@ -547,7 +628,9 @@ drive_progress(int ac, char **av) mfi_display_progress("Clear", &info.prog_info.clear); if ((info.prog_info.active & (MFI_PD_PROGRESS_REBUILD | MFI_PD_PROGRESS_PATROL | MFI_PD_PROGRESS_CLEAR)) == 0) - printf("No activity in progress for drive %u.\n", device_id); + printf("No activity in progress for drive %s.\n", + mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); return (0); } Modified: head/usr.sbin/mfiutil/mfi_patrol.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_patrol.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_patrol.c Mon Jun 20 21:28:50 2011 (r223345) @@ -80,7 +80,7 @@ show_patrol(int ac, char **av) struct mfi_pr_status status; struct mfi_pd_list *list; struct mfi_pd_info info; - char label[16]; + char label[24]; time_t now; uint32_t at; int error, fd; @@ -174,8 +174,10 @@ show_patrol(int ac, char **av) return (error); } if (info.prog_info.active & MFI_PD_PROGRESS_PATROL) { - snprintf(label, sizeof(label), " Drive %u", - list->addr[i].device_id); + snprintf(label, sizeof(label), " Drive %s", + mfi_drive_name(NULL, + list->addr[i].device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress(label, &info.prog_info.patrol); } Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfi_show.c Mon Jun 20 21:28:50 2011 (r223345) @@ -258,7 +258,7 @@ print_ld(struct mfi_ld_info *info, int s } static void -print_pd(struct mfi_pd_info *info, int state_len, int location) +print_pd(struct mfi_pd_info *info, int state_len) { const char *s; char buf[6]; @@ -273,15 +273,6 @@ print_pd(struct mfi_pd_info *info, int s s = mfi_pd_inq_string(info); if (s != NULL) printf(" %s", s); - if (!location) - return; - if (info->encl_device_id == 0xffff) - printf(" slot %d", info->slot_number); - else if (info->encl_device_id == info->ref.v.device_id) - printf(" enclosure %d", info->encl_index); - else - printf(" enclosure %d, slot %d", info->encl_index, - info->slot_number); } static int @@ -329,16 +320,16 @@ show_config(int ac, char **av) ar->num_drives); for (j = 0; j < ar->num_drives; j++) { device_id = ar->pd[j].ref.v.device_id; - if (device_id == 0xffff) - printf(" drive MISSING\n"); - else { - printf(" drive %u ", device_id); + printf(" drive %s ", mfi_drive_name(NULL, + device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); + if (device_id != 0xffff) { if (mfi_pd_get_info(fd, device_id, &pinfo, NULL) < 0) printf("%s", mfi_pdstate(ar->pd[j].fw_state)); else - print_pd(&pinfo, -1, 1); + print_pd(&pinfo, -1); printf("\n"); } } @@ -367,13 +358,14 @@ show_config(int ac, char **av) for (i = 0; i < config->spares_count; i++) { sp = (struct mfi_spare *)p; - printf(" %s spare %u ", + printf(" %s spare %s ", sp->spare_type & MFI_SPARE_DEDICATED ? "dedicated" : - "global", sp->ref.v.device_id); + "global", mfi_drive_name(NULL, sp->ref.v.device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); if (mfi_pd_get_info(fd, sp->ref.v.device_id, &pinfo, NULL) < 0) printf("%s", mfi_pdstate(MFI_PD_STATE_HOT_SPARE)); else - print_pd(&pinfo, -1, 1); + print_pd(&pinfo, -1); if (sp->spare_type & MFI_SPARE_DEDICATED) { printf(" backs:\n"); for (j = 0; j < sp->array_count; j++) @@ -534,7 +526,11 @@ show_drives(int ac, char **av) goto error; } - print_pd(&info, state_len, 1); + printf("%s ", mfi_drive_name(&info, list->addr[i].device_id, + MFI_DNAME_DEVICE_ID)); + print_pd(&info, state_len); + printf(" %s", mfi_drive_name(&info, list->addr[i].device_id, + MFI_DNAME_ES)); printf("\n"); } error: @@ -719,18 +715,21 @@ show_progress(int ac, char **av) } if (pinfo.prog_info.active & MFI_PD_PROGRESS_REBUILD) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Rebuild", &pinfo.prog_info.rbld); busy = 1; } if (pinfo.prog_info.active & MFI_PD_PROGRESS_PATROL) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Patrol Read", &pinfo.prog_info.patrol); busy = 1; } if (pinfo.prog_info.active & MFI_PD_PROGRESS_CLEAR) { - printf("drive %u ", device_id); + printf("drive %s ", mfi_drive_name(NULL, device_id, + MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS)); mfi_display_progress("Clear", &pinfo.prog_info.clear); busy = 1; } Modified: head/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.8 Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.8 Mon Jun 20 21:28:50 2011 (r223345) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2011 +.Dd June 20, 2011 .Dt MFIUTIL 8 .Os .Sh NAME @@ -43,6 +43,8 @@ .Op Fl u Ar unit .Cm show battery .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show config .Nm @@ -63,9 +65,13 @@ .Op Fl u Ar unit .Cm show logstate .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show patrol .Nm +.Op Fl d +.Op Fl e .Op Fl u Ar unit .Cm show progress .Nm @@ -155,15 +161,19 @@ If no unit is specified, then unit 0 is used. .El .Pp -Volumes may be specified in two forms. -First, -a volume may be identified by its target ID. -Second, -on the volume may be specified by the corresponding -.Em mfidX -device, -such as -.Em mfid0 . +Various commands accept either or both of the two options: +.Bl -tag -width indent +.It Fl d +Print numeric device IDs as drive identifier. +This is the default. +Useful in combination with +.Fl e +to print both, numeric device IDs and enclosure:slot information. +.It Fl e +Print drive identifiers in enclosure:slot form. +See next paragraph on format details in context of input rather than +output. +.El .Pp Drives may be specified in two forms. First, @@ -184,6 +194,16 @@ and is the slot for each drive as displayed in .Cm show drives . .Pp +Volumes may be specified in two forms. +First, +a volume may be identified by its target ID. +Second, +on the volume may be specified by the corresponding +.Em mfidX +device, +such as +.Em mfid0 . +.Pp The .Nm utility supports several different groups of commands. Modified: head/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.c Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.c Mon Jun 20 21:28:50 2011 (r223345) @@ -45,11 +45,13 @@ MFI_TABLE(top, abort); int mfi_unit; +u_int mfi_opts; + static void usage(void) { - fprintf(stderr, "usage: mfiutil [-u unit] ...\n\n"); + fprintf(stderr, "usage: mfiutil [-de] [-u unit] ...\n\n"); fprintf(stderr, "Commands include:\n"); fprintf(stderr, " version\n"); fprintf(stderr, " show adapter - display controller information\n"); @@ -108,8 +110,14 @@ main(int ac, char **av) struct mfiutil_command **cmd; int ch; - while ((ch = getopt(ac, av, "u:")) != -1) { + while ((ch = getopt(ac, av, "deu:")) != -1) { switch (ch) { + case 'd': + mfi_opts |= MFI_DNAME_DEVICE_ID; + break; + case 'e': + mfi_opts |= MFI_DNAME_ES; + break; case 'u': mfi_unit = atoi(optarg); break; Modified: head/usr.sbin/mfiutil/mfiutil.h ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.h Mon Jun 20 18:08:52 2011 (r223344) +++ head/usr.sbin/mfiutil/mfiutil.h Mon Jun 20 21:28:50 2011 (r223345) @@ -115,7 +115,13 @@ struct mfiutil_command { } \ MFI_COMMAND(set, name, mfiutil_ ## name ## _table_handler) +/* Drive name printing options */ +#define MFI_DNAME_ES 0x0001 /* E%u:S%u */ +#define MFI_DNAME_DEVICE_ID 0x0002 /* %u */ +#define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */ + extern int mfi_unit; +extern u_int mfi_opts; void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref); void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref); @@ -143,5 +149,7 @@ int mfi_pd_get_info(int fd, uint16_t dev int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp); int mfi_reconfig_supported(void); const char *mfi_status(u_int status_code); +const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, + uint32_t def); #endif /* !__MFIUTIL_H__ */ From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 21:31:01 2011 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 85BF61065675; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0188FC21; Mon, 20 Jun 2011 21:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5KLV1Sj066511; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLV1TG066507; Mon, 20 Jun 2011 21:31:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106202131.p5KLV1TG066507@svn.freebsd.org> From: Marius Strobl Date: Mon, 20 Jun 2011 21:31: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: r223346 - head/sys/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, 20 Jun 2011 21:31:01 -0000 Author: marius Date: Mon Jun 20 21:31:01 2011 New Revision: 223346 URL: http://svn.freebsd.org/changeset/base/223346 Log: - Remove MD usage of pc_cpumask and pc_other_cpus. [1] - Remove CTASSERTs which no longer need to hold since r222813. Submitted by: attilio [1] Modified: head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tlb.c Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/mp_machdep.c Mon Jun 20 21:31:01 2011 (r223346) @@ -140,8 +140,6 @@ static cpu_ipi_single_t spitfire_ipi_sin SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS); -CTASSERT(MAXCPU <= sizeof(u_int) * NBBY); -CTASSERT(MAXCPU <= sizeof(int) * NBBY); void mp_init(u_int cpu_impl) @@ -491,13 +489,14 @@ cpu_mp_shutdown(void) int i; critical_enter(); - shutdown_cpus = PCPU_GET(other_cpus); + shutdown_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &shutdown_cpus); cpus = shutdown_cpus; /* XXX: Stop all the CPUs which aren't already. */ if (CPU_CMP(&stopped_cpus, &cpus)) { - /* pc_other_cpus is just a flat "on" mask without curcpu. */ + /* cpus is just a flat "on" mask without curcpu. */ CPU_NAND(&cpus, &stopped_cpus); stop_cpus(cpus); } @@ -520,23 +519,23 @@ cpu_ipi_ast(struct trapframe *tf) static void cpu_ipi_stop(struct trapframe *tf) { - cpuset_t tcmask; + u_int cpuid; CTR2(KTR_SMP, "%s: stopped %d", __func__, curcpu); sched_pin(); savectx(&stoppcbs[curcpu]); - tcmask = PCPU_GET(cpumask); - CPU_OR_ATOMIC(&stopped_cpus, &tcmask); - while (!CPU_OVERLAP(&started_cpus, &tcmask)) { - if (CPU_OVERLAP(&shutdown_cpus, &tcmask)) { - CPU_NAND_ATOMIC(&shutdown_cpus, &tcmask); + cpuid = PCPU_GET(cpuid); + CPU_SET_ATOMIC(cpuid, &stopped_cpus); + while (!CPU_ISSET(cpuid, &started_cpus)) { + if (CPU_ISSET(cpuid, &shutdown_cpus)) { + CPU_CLR_ATOMIC(cpuid, &shutdown_cpus); (void)intr_disable(); for (;;) ; } } - CPU_NAND_ATOMIC(&started_cpus, &tcmask); - CPU_NAND_ATOMIC(&stopped_cpus, &tcmask); + CPU_CLR_ATOMIC(cpuid, &started_cpus); + CPU_CLR_ATOMIC(cpuid, &stopped_cpus); sched_unpin(); CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu); } Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:31:01 2011 (r223346) @@ -2230,7 +2230,7 @@ pmap_activate(struct thread *td) PCPU_SET(tlb_ctx, context + 1); pm->pm_context[curcpu] = context; - CPU_OR(&pm->pm_active, PCPU_PTR(cpumask)); + CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); Modified: head/sys/sparc64/sparc64/tlb.c ============================================================================== --- head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:28:50 2011 (r223345) +++ head/sys/sparc64/sparc64/tlb.c Mon Jun 20 21:31:01 2011 (r223346) @@ -80,7 +80,7 @@ tlb_context_demap(struct pmap *pm) PMAP_STATS_INC(tlb_ncontext_demap); cookie = ipi_tlb_context_demap(pm); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_context_demap: inactive pmap?")); stxa(TLB_DEMAP_PRIMARY | TLB_DEMAP_CONTEXT, ASI_DMMU_DEMAP, 0); @@ -101,7 +101,7 @@ tlb_page_demap(struct pmap *pm, vm_offse PMAP_STATS_INC(tlb_npage_demap); cookie = ipi_tlb_page_demap(pm, va); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_page_demap: inactive pmap?")); if (pm == kernel_pmap) @@ -128,7 +128,7 @@ tlb_range_demap(struct pmap *pm, vm_offs PMAP_STATS_INC(tlb_nrange_demap); cookie = ipi_tlb_range_demap(pm, start, end); s = intr_disable(); - if (CPU_OVERLAP(&pm->pm_active, PCPU_PTR(cpumask))) { + if (CPU_ISSET(PCPU_GET(cpuid), &pm->pm_active)) { KASSERT(pm->pm_context[curcpu] != -1, ("tlb_range_demap: inactive pmap?")); if (pm == kernel_pmap) From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 21:36:54 2011 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 01F16106566B; Mon, 20 Jun 2011 21:36:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E60F08FC08; Mon, 20 Jun 2011 21:36: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 p5KLarSY066782; Mon, 20 Jun 2011 21:36:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLaroc066780; Mon, 20 Jun 2011 21:36:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106202136.p5KLaroc066780@svn.freebsd.org> From: Marius Strobl Date: Mon, 20 Jun 2011 21:36: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: r223347 - head/sys/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, 20 Jun 2011 21:36:54 -0000 Author: marius Date: Mon Jun 20 21:36:53 2011 New Revision: 223347 URL: http://svn.freebsd.org/changeset/base/223347 Log: As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:31:01 2011 (r223346) +++ head/sys/sparc64/sparc64/pmap.c Mon Jun 20 21:36:53 2011 (r223347) @@ -2217,11 +2217,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2229,17 +2228,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } void From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 21:57:27 2011 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 35571106564A; Mon, 20 Jun 2011 21:57:27 +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 258D88FC15; Mon, 20 Jun 2011 21:57: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 p5KLvRo4067417; Mon, 20 Jun 2011 21:57:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KLvRU0067415; Mon, 20 Jun 2011 21:57:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106202157.p5KLvRU0067415@svn.freebsd.org> From: Rick Macklem Date: Mon, 20 Jun 2011 21:57: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: r223348 - head/sys/fs/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: Mon, 20 Jun 2011 21:57:27 -0000 Author: rmacklem Date: Mon Jun 20 21:57:26 2011 New Revision: 223348 URL: http://svn.freebsd.org/changeset/base/223348 Log: Fix the new NFSv4 server so that it allows Access and Readlink operations while traversing non-exported file systems. This is required for some non-FreeBSD clients to do NFSv4 mounts. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jun 20 21:36:53 2011 (r223347) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Mon Jun 20 21:57:26 2011 (r223348) @@ -786,6 +786,8 @@ nfsrvd_compound(struct nfsrv_descript *n op != NFSV4OP_LOOKUP && op != NFSV4OP_GETATTR && op != NFSV4OP_GETFH && + op != NFSV4OP_ACCESS && + op != NFSV4OP_READLINK && op != NFSV4OP_SECINFO) nd->nd_repstat = NFSERR_NOFILEHANDLE; else if (nfsvno_testexp(nd, &vpnes) && From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 22:02:01 2011 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 E945D1065674; Mon, 20 Jun 2011 22:02:01 +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 D97048FC24; Mon, 20 Jun 2011 22:02: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 p5KM21jF067600; Mon, 20 Jun 2011 22:02:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KM21ou067598; Mon, 20 Jun 2011 22:02:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106202202.p5KM21ou067598@svn.freebsd.org> From: Rick Macklem Date: Mon, 20 Jun 2011 22:02: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: r223349 - head/sys/fs/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: Mon, 20 Jun 2011 22:02:02 -0000 Author: rmacklem Date: Mon Jun 20 22:02:01 2011 New Revision: 223349 URL: http://svn.freebsd.org/changeset/base/223349 Log: Fix the new NFSv4 server so that it only allows Lookup of directories and symbolic links when traversing non-exported file systems. Found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 20 21:57:26 2011 (r223348) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Mon Jun 20 22:02:01 2011 (r223349) @@ -454,7 +454,7 @@ nfsmout: APPLESTATIC int nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram, vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p, - __unused struct nfsexstuff *exp) + struct nfsexstuff *exp) { struct nameidata named; vnode_t vp, dirp = NULL; @@ -508,7 +508,15 @@ nfsrvd_lookup(struct nfsrv_descript *nd, vrele(named.ni_startdir); nfsvno_relpathbuf(&named); vp = named.ni_vp; - nd->nd_repstat = nfsvno_getfh(vp, fhp, p); + if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) && + vp->v_type != VDIR && vp->v_type != VLNK) + /* + * Only allow lookup of VDIR and VLNK for traversal of + * non-exported volumes during NFSv4 mounting. + */ + nd->nd_repstat = ENOENT; + if (nd->nd_repstat == 0) + nd->nd_repstat = nfsvno_getfh(vp, fhp, p); if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); if (vpp != NULL && nd->nd_repstat == 0) From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 22:59:29 2011 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 6E6D21065670; Mon, 20 Jun 2011 22:59:29 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5588FC15; Mon, 20 Jun 2011 22:59: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 p5KMxTHo069300; Mon, 20 Jun 2011 22:59:29 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5KMxT1h069297; Mon, 20 Jun 2011 22:59:29 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201106202259.p5KMxT1h069297@svn.freebsd.org> From: Jack F Vogel Date: Mon, 20 Jun 2011 22:59: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: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2011 22:59:29 -0000 Author: jfv Date: Mon Jun 20 22:59:29 2011 New Revision: 223350 URL: http://svn.freebsd.org/changeset/base/223350 Log: Eliminate some global tuneables in favor of adapter-specific, particular flow control and dma coalesce. Also improve the sysctl operation on those too. Add IPv6 detection in the ioctl code, this was done for ixgbe first, carrying that over. Add resource ability to disable particular adapter. Add HW TSO capability so vlans can make use of TSO Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Jun 20 22:02:01 2011 (r223349) +++ head/sys/dev/e1000/if_igb.c Mon Jun 20 22:59:29 2011 (r223350) @@ -36,6 +36,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_altq.h" #endif @@ -99,7 +100,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.2.3"; +char igb_driver_version[] = "version - 2.2.5"; /********************************************************************* @@ -265,6 +266,7 @@ static void igb_handle_link(void *contex static void igb_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS); +static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS); #ifdef DEVICE_POLLING static poll_handler_t igb_poll; @@ -344,25 +346,6 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); -/* How many packets rxeof tries to clean at a time */ -static int igb_rx_process_limit = 100; -TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); - -/* Flow control setting - default to FULL */ -static int igb_fc_setting = e1000_fc_full; -TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting); - -/* Energy Efficient Ethernet - default to off */ -static int igb_eee_disabled = TRUE; -TUNABLE_INT("hw.igb.eee_disabled", &igb_eee_disabled); - -/* -** DMA Coalescing, only for i350 - default to off, -** this feature is for power savings -*/ -static int igb_dma_coalesce = FALSE; -TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce); - /********************************************************************* * Device identification routine * @@ -433,6 +416,11 @@ igb_attach(device_t dev) INIT_DEBUGOUT("igb_attach: begin"); + if (resource_disabled("igb", device_get_unit(dev))) { + device_printf(dev, "Disabled by device hint\n"); + return (ENXIO); + } + adapter = device_get_softc(dev); adapter->dev = adapter->osdep.dev = dev; IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); @@ -450,7 +438,7 @@ igb_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "fc", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, igb_set_flowcntl, "I", "Flow Control"); callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0); @@ -476,8 +464,8 @@ igb_attach(device_t dev) /* Sysctl for limiting the amount of work done in the taskqueue */ igb_set_sysctl_value(adapter, "rx_processing_limit", - "max number of rx packets to process", &adapter->rx_process_limit, - igb_rx_process_limit); + "max number of rx packets to process", + &adapter->rx_process_limit, 100); /* * Validate number of transmit and receive descriptors. It @@ -552,13 +540,14 @@ igb_attach(device_t dev) /* Some adapter-specific advanced features */ if (adapter->hw.mac.type >= e1000_i350) { - igb_set_sysctl_value(adapter, "dma_coalesce", - "configure dma coalesce", - &adapter->dma_coalesce, igb_dma_coalesce); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW, + adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce"); igb_set_sysctl_value(adapter, "eee_disabled", "enable Energy Efficient Ethernet", &adapter->hw.dev_spec._82575.eee_disable, - igb_eee_disabled); + TRUE); e1000_set_eee_i350(&adapter->hw); } @@ -658,6 +647,7 @@ igb_attach(device_t dev) return (0); err_late: + igb_detach(dev); igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); igb_release_hw_control(adapter); @@ -736,7 +726,8 @@ igb_detach(device_t dev) igb_free_transmit_structures(adapter); igb_free_receive_structures(adapter); - free(adapter->mta, M_DEVBUF); + if (adapter->mta != NULL) + free(adapter->mta, M_DEVBUF); IGB_CORE_LOCK_DESTROY(adapter); @@ -1025,11 +1016,12 @@ static int igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { struct adapter *adapter = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *)data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *)data; + struct ifreq *ifr = (struct ifreq *)data; +#if defined(INET) || defined(INET6) + struct ifaddr *ifa = (struct ifaddr *)data; + bool avoid_reset = FALSE; #endif - int error = 0; + int error = 0; if (adapter->in_detach) return (error); @@ -1037,20 +1029,22 @@ igb_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFADDR: #ifdef INET - if (ifa->ifa_addr->sa_family == AF_INET) { - /* - * XXX - * Since resetting hardware takes a very long time - * and results in link renegotiation we only - * initialize the hardware only when it is absolutely - * required. - */ + if (ifa->ifa_addr->sa_family == AF_INET) + avoid_reset = TRUE; +#endif +#ifdef INET6 + if (ifa->ifa_addr->sa_family == AF_INET6) + avoid_reset = TRUE; +#endif +#if defined(INET) || defined(INET6) + /* + ** Calling init results in link renegotiation, + ** so we avoid doing it when possible. + */ + if (avoid_reset) { ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IGB_CORE_LOCK(adapter); - igb_init_locked(adapter); - IGB_CORE_UNLOCK(adapter); - } + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) + igb_init(adapter); if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); } else @@ -1175,6 +1169,10 @@ igb_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; reinit = 1; } + if (mask & IFCAP_VLAN_HWTSO) { + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + reinit = 1; + } if (mask & IFCAP_LRO) { ifp->if_capenable ^= IFCAP_LRO; reinit = 1; @@ -2721,6 +2719,12 @@ igb_reset(struct adapter *adapter) fc->pause_time = IGB_FC_PAUSE_TIME; fc->send_xon = TRUE; + if (fc->requested_mode) + fc->current_mode = fc->requested_mode; + else + fc->current_mode = e1000_fc_full; + + adapter->fc = fc->current_mode; /* Issue a global reset */ e1000_reset_hw(hw); @@ -2730,9 +2734,13 @@ igb_reset(struct adapter *adapter) device_printf(dev, "Hardware Initialization Failed\n"); /* Setup DMA Coalescing */ - if ((hw->mac.type == e1000_i350) && - (adapter->dma_coalesce == TRUE)) { - u32 reg; + if (hw->mac.type == e1000_i350) { + u32 reg = ~E1000_DMACR_DMAC_EN; + + if (adapter->dmac == 0) { /* Disabling it */ + E1000_WRITE_REG(hw, E1000_DMACR, reg); + goto reset_out; + } hwm = (pba - 4) << 10; reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT) @@ -2741,8 +2749,8 @@ igb_reset(struct adapter *adapter) /* transition to L0x or L1 if available..*/ reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK); - /* timer = +-1000 usec in 32usec intervals */ - reg |= (1000 >> 5); + /* timer = value in adapter->dmac in 32usec intervals */ + reg |= (adapter->dmac >> 5); E1000_WRITE_REG(hw, E1000_DMACR, reg); /* No lower threshold */ @@ -2767,6 +2775,7 @@ igb_reset(struct adapter *adapter) device_printf(dev, "DMA Coalescing enabled\n"); } +reset_out: E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN); e1000_get_phy_info(hw); e1000_check_for_link(hw); @@ -2827,15 +2836,19 @@ igb_setup_interface(device_t dev, struct * support full VLAN capability. */ ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; + ifp->if_capenable |= IFCAP_VLAN_HWTAGGING + | IFCAP_VLAN_HWTSO + | IFCAP_VLAN_MTU; /* - ** Dont turn this on by default, if vlans are + ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) ** then vlan events are not passed thru, breaking ** operation, but with HW FILTER off it works. If - ** using vlans directly on the em driver you can + ** using vlans directly on the igb driver you can ** enable this and get full hardware tag filtering. */ ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; @@ -5595,19 +5608,18 @@ static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; - struct adapter *adapter; + struct adapter *adapter = (struct adapter *) arg1; - error = sysctl_handle_int(oidp, &igb_fc_setting, 0, req); + error = sysctl_handle_int(oidp, &adapter->fc, 0, req); - if (error) + if ((error) || (req->newptr == NULL)) return (error); - adapter = (struct adapter *) arg1; - switch (igb_fc_setting) { + switch (adapter->fc) { case e1000_fc_rx_pause: case e1000_fc_tx_pause: case e1000_fc_full: - adapter->hw.fc.requested_mode = igb_fc_setting; + adapter->hw.fc.requested_mode = adapter->fc; break; case e1000_fc_none: default: @@ -5616,5 +5628,54 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS) adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode; e1000_force_mac_fc(&adapter->hw); - return error; + return (error); +} + +/* +** Manage DMA Coalesce: +** Control values: +** 0/1 - off/on +** Legal timer values are: +** 250,500,1000-10000 in thousands +*/ +static int +igb_sysctl_dmac(SYSCTL_HANDLER_ARGS) +{ + struct adapter *adapter = (struct adapter *) arg1; + int error; + + error = sysctl_handle_int(oidp, &adapter->dmac, 0, req); + + if ((error) || (req->newptr == NULL)) + return (error); + + switch (adapter->dmac) { + case 0: + /*Disabling */ + break; + case 1: /* Just enable and use default */ + adapter->dmac = 1000; + break; + case 250: + case 500: + case 1000: + case 2000: + case 3000: + case 4000: + case 5000: + case 6000: + case 7000: + case 8000: + case 9000: + case 10000: + /* Legal values - allow */ + break; + default: + /* Do nothing, illegal value */ + adapter->dmac = 0; + return (error); + } + /* Reinit the interface */ + igb_init(adapter); + return (error); } Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Mon Jun 20 22:02:01 2011 (r223349) +++ head/sys/dev/e1000/if_igb.h Mon Jun 20 22:59:29 2011 (r223350) @@ -396,11 +396,12 @@ struct adapter { u32 shadow_vfta[IGB_VFTA_SIZE]; /* Info about the interface */ - u8 link_active; + u16 link_active; + u16 fc; u16 link_speed; u16 link_duplex; u32 smartspeed; - u32 dma_coalesce; + u32 dmac; /* Interface queues */ struct igb_queue *queues; From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 23:41:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id E7828106564A; Mon, 20 Jun 2011 23:41:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Mon, 20 Jun 2011 19:40:53 -0400 User-Agent: KMail/1.6.2 References: <201106172141.p5HLf6Rx009154@svn.freebsd.org> <20110618195655.M889@besplex.bde.org> In-Reply-To: <20110618195655.M889@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106201940.56104.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223211 - head/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: Mon, 20 Jun 2011 23:41:09 -0000 On Saturday 18 June 2011 07:08 am, Bruce Evans wrote: > On Fri, 17 Jun 2011, Jung-uk Kim wrote: > > Log: > > Teach the compiler how to shift TSC value efficiently. As noted > > in r220631, some times compiler inserts redundant instructions to > > preserve unused upper 32 bits even when it is casted to a 32-bit > > value. Unfortunately, it seems the problem becomes more serious > > when it is shifted, especially on amd64. > > Er, I tried to point out how to optimize this code before (but > didn't reply to your reply), and it's not by using more asm. > > > Modified: head/sys/x86/x86/tsc.c > > ================================================================= > >============= --- head/sys/x86/x86/tsc.c Fri Jun 17 21:31:13 > > 2011 (r223210) +++ head/sys/x86/x86/tsc.c Fri Jun 17 21:41:06 > > 2011 (r223211) @@ -461,7 +461,7 @@ init_TSC_tc(void) > > tsc_timecounter.tc_quality = 1000; > > > > init: > > - for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; > > shift++) + for (shift = 0; shift < 31 && (tsc_freq >> shift) > > > max_freq; shift++) ; > > if (shift > 0) { > > tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; > > shift == 32 (or even shift == 31) is unreachable. A shift of 31 > will shift 2GHz down to 1 Hz, or support physically impossible > frequencies like 2**33 GHz. OTOH, shifts of up to 63 are supported > by the slow gcc code. It is unreachable but it is a safety belt. Please see below. > > @@ -579,6 +579,9 @@ tsc_get_timecount(struct timecounter *tc > > static u_int > > tsc_get_timecount_low(struct timecounter *tc) > > { > > + uint32_t rv; > > > > - return (rdtsc() >> (int)(intptr_t)tc->tc_priv); > > + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > > Lexical style bug (indentation of second line of the asm). I followed sys/amd64/include/atomic.h style. OTOH, sys/amd64/include/cpufunc.h has little different style. I wasn't sure what's correct because style(9) does not mention anything specific to inline assembly. :-( > > + return (rv); > > } > > Just return the shift of the low 32 bits (and change > tc_counter_mask to match) like I said. This loses only the > accidental ability for the timecounter to work for more than a few > seconds when interrupts are stopped by something like ddb, since > any shift count that loses too many of the low 32 bits will not > work for other reasons. For example, suppose that the TSC > frequency is 8G-1Hz, which is unavailable except possible in > research labs. This must be shifted by 1 to fit in 32 bits. If we > use only the low 32 bits, then we end up with only 31 significant > bits and tsc_get_timecount_low() wraps after ~2 seconds instead of > after the best possible for this shift of ~4 seconds. If we shift > by 7 more, as we do in the SMP case, then if we start with 32 bits > then we end up with 24 bits, but the wrap still takes 2 seconds; if > we start with 64 bits then we end up with 32 bits and the wrap > takes 4*2**7 = 512 seconds. But wrap times longer than 1/HZ times > a few are not needed. 2 seconds is already at least 100 or 1000 > times longer than needed, depending on HZ. The case where the > unscaled frequency is 4G-1Hz and !SMP gives a shift count of 0 and > a wrap time of ~4 seconds. Whatever is done to make that case work > (say, not allowing a fully tickless kernel with HZ = 0), works > almost as well up to an unscaled frequency of 8GHz which is still > far off. > > No one will notice these micro-optimizations, but I agree that the > redundant instructions are ugly. I get the following on i386 for > the original version with an old source tree: > > % #APP > % rdtsc > % #NO_APP > % movl 8(%ebp), %ecx > % movl 28(%ecx), %ecx > % shrdl %edx, %eax > % shrl %cl, %edx > % testb $32, %cl > % je .L3 > % movl %edx, %eax > % xorl %edx, %edx > % .L3: > > The last 4 instructions are not redundant, but are needed to > support shifts of up to 63 (maybe 64). They are not redundant but I wanted to get rid of the check entirely. That's why 32 -> 31 change was made in the first place. FYI, with amd64, we get this from the old code: rdtsc movzbl 48(%rdi), %ecx salq $32, %rdx mov %eax, %eax orq %rax, %rdx shrq %cl, %rdx movl %edx, %eax ret This is slightly better than i386 version, i.e., no conditional jump, but it is still ugly, however. > I tried masking the shift count with 0x1f so that the shift count > is known to be < 32, this just gave an extra instruction for the > masking. Yup. > It's even worse with rdtsc() converted to u_int first like I want: > > % movl %ebx, (%esp) > % movl %esi, 4(%esp) > % #APP > % rdtsc > % #NO_APP > % movl %eax, %ebx > % movl 8(%ebp), %eax > % movl 4(%esp), %esi > % movl 28(%eax), %ecx > % movl %ebx, %eax > % movl (%esp), %ebx > % # some frame pointer epilogue reordered here > % shrl %cl, %eax > > The second case may be what you already fixed on amd64 (only?) -- > use rdtsc32() instead of (u_int)rdtsc(). > > I've always thought that the dynamic shift is overengineered, and > now like it even less. The following is efficent and works well > enough in all currently physically possible cases: > > % /* > % * Don't really need a separate one for `low', but now it costs > less % * (1 shift instruction at runtime and some space). Must > change % * tc_counter_mask to match. > % */ > % u_int > % tsc_get_timecount_low(struct timecounter *tc) > % { > % #ifdef SMP > % /* > % * Works up to 1024 GHz, assuming that nontemporalness scales > with % * freq. I think 8 is too many. But now do extra for SMP > indep. % * of freq. > % */ > % return (((u_int)rdtsc()) >> 8); /* gens rdtsc; shrl $8,%eax */ > % #else > % /* Works up to 8 GHz. */ > % return (((u_int)rdtsc()) >> 1); /* gens rdtsc; shrl %eax */ > % #endif > % } Dynamic shift may be overengineered but it is useful. For example, r223211 give us fairly good optimization on amd64: movq 48(%rdi), %rcx rdtsc shrd %cl, %edx, %eax ret i386 isn't too impressive, though: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movl 28(%eax), %ecx rdtsc shrd %cl, %edx, %eax popl %ebp ret I just couldn't convince GCC to generate code like this without inline asm, unfortunately. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Jun 20 23:41:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1B36710658AF; Mon, 20 Jun 2011 23:41:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Mon, 20 Jun 2011 19:41:00 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106081913.09272.jkim@FreeBSD.org> <20110618210815.W889@besplex.bde.org> In-Reply-To: <20110618210815.W889@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106201941.03393.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222866 - head/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: Mon, 20 Jun 2011 23:41:16 -0000 On Saturday 18 June 2011 08:05 am, Bruce Evans wrote: > Long ago, On Wed, 8 Jun 2011, Jung-uk Kim wrote: > > On Wednesday 08 June 2011 04:55 pm, Bruce Evans wrote: > >> On Wed, 8 Jun 2011, Jung-uk Kim wrote: > >>> Log: > >>> Introduce low-resolution TSC timecounter "TSC-low". It > >>> replaces the normal TSC timecounter if TSC frequency is higher > >>> than ~4.29 MHz (or 2^32-1 Hz) or > >> > >> It should be a separate timecounter so that the user can choose > >> it independently, at least in the SMP case where it is very low > >> (at most ~4.29 GHz >> 8 ~= 17 MHz). > > > > As I noted in the log, it is still higher than the previous > > default ACPI-fast, which is ~3.68 MHz and I've never heard of any > > complaint about ACPI-fast being too low. ;-) > > That's because it is too low to measure itself being low :-). > > > Nothing prevents us from making a separate timecounter, though. > > In fact, we can do the same for ACPI-fast/ACPI-safe. However, > > that'll only confuse users, IMHO. > > TSC/TSC-low sort of corresponds to ACPI-fast/ACPI-safe. Users can > switch between the latter. How do we do that? if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; acpi_timer_timecounter.tc_quality = 850; } We didn't have any code to influence this selection as far as I can remember. > What they can't do is run both concurrently, either to compare them > or use the best one that works in the current context. That would > be more developers and is not implemented mainly because it has more > complexity (only a tiny amount of extra overhead I think, provided > you don't try to keep the 2 times coherent -- just an extra windup > for each active timecounter). > > >>> static void tsc_levels_changed(void *arg, int unit); > >>> > >>> static struct timecounter tsc_timecounter = { > >>> @@ -392,11 +393,19 @@ test_smp_tsc(void) > >>> static void > >>> init_TSC_tc(void) > >> > >> This seems to only be called once at boot time. So the lowness > >> may be much lower than necessary if the levels are reduced > >> significantly later. > > > > It'll only happen when the CPU is started at the highest > > frequency and TSC is not invariant. In this case, its quality > > will be set to 800 and HPET or ACPI timecounter will be selected > > by default. I don't see much problem with the default choice > > here. > > Can the CPU be started at a low frequency and throttled up later? Yes, Intel mobile parts may do that. > I agree that the non-invariant case is not very important. Exactly. > >>> { > >>> + uint64_t max_freq; > >>> + int shift; > >>> > >>> if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) > >>> return; > >>> > >>> /* > >>> + * Limit timecounter frequency to fit in an int and prevent > >>> it from + * overflowing too fast. > >>> + */ > >>> + max_freq = UINT_MAX; > >>> + > >>> + /* > >>> * We can not use the TSC if we support APM. Precise > >>> timekeeping * on an APM'ed machine is at best a fools pursuit, > >>> since * any and all of the time spent in various SMM code can't > >>> @@ -418,13 +427,27 @@ init_TSC_tc(void) > >>> * We can not use the TSC in SMP mode unless the TSCs on all > >>> CPUs are * synchronized. If the user is sure that the system > >>> has synchronized * TSCs, set kern.timecounter.smp_tsc tunable > >>> to a non-zero value. + * We also limit the frequency even > >>> lower to avoid "temporal anomalies" + * as much as possible. > >>> */ > >>> - if (smp_cpus > 1) > >>> + if (smp_cpus > 1) { > >>> tsc_timecounter.tc_quality = test_smp_tsc(); > >>> + max_freq >>= 8; > >>> + } > >> > >> This gives especially low lowness if the levels are reduced > >> significantly. Maybe as low as 100 MHz >> 8 = ~390 KHz = lower > >> than an i8254. > > > > I don't remember any SMP-capable x86 ever running at 100 MHz > > unless it is seriously under-clocked. Even if it existed, it > > won't be available today. :-P > > Doesn't throttling give underclocking? T-state *usually* does not change CPU frequency itself. Only P-state can change TSC frequency. However, some broken implementation *may* just stop incrementing TSC in very low T-state (or C-state). AMD does not have this problem for invariant TSCs. It seems Intel also fixed it for recent processors. Nehalem or Sandy Bridge, I am not sure, though. > Maybe not as low as 100 MHz, but quite low. Only a possible problem > for the non-invariant case anyway. Agreed. > >> OTOH, maybe the temporal anomalies scale with the TSC frequency, > >> so you need to right shift by a few irrespective of the TSC > >> frequency. A shift count of 8 seems too much, but if the initial > >> TSC frequency is already < 2**32 shifted by 8, then the final > >> shift is 0. > > This is my main point. How can it be right to reduce the extra > shift for SMP (if this shift is needed at all) just because the > initial TSC frequency is low? All instructions are clocked, so > non-temporalness within a core scales with the current frequency. > Oops, this leads back to my previous point that the scaling should > depend on the current frequency and not just on the initial > frequency. Across cores, it isn't so clear what the > non-temporalness scales with. The non-temporalness is FUD so its > scaling could be anything :-). My questions to you: a) Why do we care TSC timecounter when it is not invariant where we *know* it is unusable and set to negative quality? b) Why do we complicate code when invariant frequency == current frequency == initial frequency? > >> ... > >> Perhaps the levels can also be increased significantly later. > >> Then the timecounter frequency may exceed 4.29 GHz despite its > >> scaling. > > > > Again, it can only happen when the CPU was started at low > > frequency and the TSC is not invariant. For that case, TSC won't > > be selected by default unless both HPET and ACPI timers are > > disabled/unavailable. > > But users can select it, and since user's can't control the scaling > or even select between TSC/TSC-low, TSC-low must be scaled properly > initially to have the best chance of working later. Maybe we should not allow users to select negative-quality timecounter in the first place. Or maybe we should print scary warning messages if they try foot-shooting. Sigh... > >>> @@ -520,8 +545,15 @@ SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq > >>> 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter > >>> frequency"); > >>> > >>> static u_int > >>> -tsc_get_timecount(struct timecounter *tc) > >>> +tsc_get_timecount(struct timecounter *tc __unused) > >>> { > >>> > >>> return (rdtsc32()); > >>> } > >>> + > >>> +static u_int > >>> +tsc_get_timecount_lowres(struct timecounter *tc) > >>> +{ > >>> + > >>> + return (rdtsc() >> (int)(intptr_t)tc->tc_priv); > >> > >> This forces a slow 64-bit shift (shrdl; shrl) in all cases. > > > > Yes, it does, unfortunately. > > > > I have no clue why AMD didn't implement native 64-bit RDTSC (and > > RDMSR/WRMSR) in the first place. :-( > > I didn't notice before that it still goes to a register pair on > amd64. > > >> rdtsc32() with a scaled tc_counter_mask should work OK > >> (essentially the same as the non-low timecounter except for > >> reduced accuracy; the only loss is an decrease in the time until > >> counter overflow to the same as for the non-low timecounter). > > > > I thought about that but I didn't like that idea, i.e., losing > > resolution and accuracy at the same time. > > But it doesn't lose any more resolution or accuracy than any shift > necessarily uses. It only loses wrap time, which is of no interest > for a small reduction. See another reply. > > The shift of 8 for SMP still seems far too much. clock_gettime() > with a TSC timecounter on an old 2GHz system takes about 250 nS. I > hope it takes only 1/2 that on a newer system. nanouptime() in the > kernel takes more like 30 nS on the old system. It should at least > try to have enough resulution for sequential calls to it to never > return the same time (even ACPI-fast has this property -- about > 1000 nS per call and a resolution of about 250 nS). rdtsc on old > Athlons takes only 12 (9?) cycles so you could almost use it to > time individual instructions (modulo out of order execution). THe > invariant versions have to be much slower for synchronization :-(. > They take at least 42 cycles AFAIR. A shift count of 5 would lose > less resolution than an invariant TSC really has so it would be > good if it is enough to hide the nontemporalness. A shift count of > 6 would be OK too. But a shift count of 8 lets you execute about 4 > nanouptime()'s for every change in the time returned. OTOH, 256 > cycles at 4 GHz is about 64 uS and clock_gettime() unfortunately > takes longer (except on Linux? :-(), so a shift count of 8 is OK > for it. > > My clock measurement program (mostly an old program by Wollman) > shows the following histogram of times for a non-invariant TSC > timecounter on a 2GHz UP system: > > % min 273, max 265102, mean 273.998217, std 79.069534 > % 1th: 273 (1727219 observations) > % 2th: 274 (265607 observations) > % 3th: 275 (6984 observations) > % 4th: 280 (11 observations) > % 5th: 290 (8 observations) > > The variance is small, and differences of a single nS can be seen > clearly. With the SMP shift of 8 on a 4GHz system, the minimum > difference would be 64 nS so it would be impossible to see the > details of the distribution about the mean of 273.998 nS. Thanks for the info, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 03:05:18 2011 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 118FC1065672; Tue, 21 Jun 2011 03:05:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01C018FC08; Tue, 21 Jun 2011 03:05: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 p5L35HhV076654; Tue, 21 Jun 2011 03:05:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L35HOS076652; Tue, 21 Jun 2011 03:05:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106210305.p5L35HOS076652@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 03:05: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: r223352 - head/sys/dev/pccbb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 03:05:18 -0000 Author: imp Date: Tue Jun 21 03:05:17 2011 New Revision: 223352 URL: http://svn.freebsd.org/changeset/base/223352 Log: Mark the card as bad on shutdown. This means that bus_child_present will return false on shutdown and massive spewage from usb disappears for usb cardbus adapters. Modified: head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon Jun 20 23:04:13 2011 (r223351) +++ head/sys/dev/pccbb/pccbb_pci.c Tue Jun 21 03:05:17 2011 (r223352) @@ -658,6 +658,12 @@ cbb_pci_shutdown(device_t brdev) struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev); /* + * We're about to pull the rug out from the card, so mark it as + * gone to prevent harm. + */ + sc->cardok = 0; + + /* * Place the cards in reset, turn off the interrupts and power * down the socket. */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 03:08:00 2011 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 25F48106566C; Tue, 21 Jun 2011 03:08:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1649F8FC18; Tue, 21 Jun 2011 03:08: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 p5L37x7q076765; Tue, 21 Jun 2011 03:07:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L37xG9076762; Tue, 21 Jun 2011 03:07:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106210307.p5L37xG9076762@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 03:07: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: r223353 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 03:08:00 -0000 Author: imp Date: Tue Jun 21 03:07:59 2011 New Revision: 223353 URL: http://svn.freebsd.org/changeset/base/223353 Log: When we see an interrupt status of 0xffffffff, check to see if the child is still present. If not, return 'handled' and don't print anything (this is expected behavior). We expect an interrupt on eject, power-down and/or shutdown. Modified: head/sys/dev/firewire/fwohci.c Modified: head/sys/dev/firewire/fwohci.c ============================================================================== --- head/sys/dev/firewire/fwohci.c Tue Jun 21 03:05:17 2011 (r223352) +++ head/sys/dev/firewire/fwohci.c Tue Jun 21 03:07:59 2011 (r223353) @@ -2072,8 +2072,9 @@ fwohci_check_stat(struct fwohci_softc *s FW_GLOCK_ASSERT(&sc->fc); stat = OREAD(sc, FWOHCI_INTSTAT); if (stat == 0xffffffff) { - device_printf(sc->fc.dev, - "device physically ejected?\n"); + if (!bus_child_present(sc->fc.dev)) + return (FILTER_HANDLED); + device_printf(sc->fc.dev, "device physically ejected?\n"); return (FILTER_STRAY); } if (stat) From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 04:06:39 2011 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 CF0A4106566B; Tue, 21 Jun 2011 04:06:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEDF58FC08; Tue, 21 Jun 2011 04:06: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 p5L46dwv078837; Tue, 21 Jun 2011 04:06:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L46do9078835; Tue, 21 Jun 2011 04:06:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106210406.p5L46do9078835@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 04:06: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: r223355 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 04:06:39 -0000 Author: ae Date: Tue Jun 21 04:06:39 2011 New Revision: 223355 URL: http://svn.freebsd.org/changeset/base/223355 Log: The "size" param needs no adjusting to stripeoffset. Reported by: Kris Moore Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 03:42:00 2011 (r223354) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) @@ -499,8 +499,8 @@ gpart_autofill(struct gctl_req *req) /* Adjust parameters to stripeoffset */ offset = pp->lg_stripeoffset / pp->lg_sectorsize; start = ALIGNUP(start + offset, alignment); - if (size + offset > alignment) - size = ALIGNDOWN(size + offset, alignment); + if (size > alignment) + size = ALIGNDOWN(size, alignment); first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 04:46:00 2011 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 5E4C31065672; Tue, 21 Jun 2011 04:46:00 +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 4E02C8FC0A; Tue, 21 Jun 2011 04:46: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 p5L4k0QA080004; Tue, 21 Jun 2011 04:46:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L4k0IZ080002; Tue, 21 Jun 2011 04:46:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106210446.p5L4k0IZ080002@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 04:46: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: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 04:46:00 -0000 Author: delphij Date: Tue Jun 21 04:46:00 2011 New Revision: 223356 URL: http://svn.freebsd.org/changeset/base/223356 Log: Mod the offset padding by alignment. Without this change we may pad too much when underlying GEOM object have a zero stripesize. MFC after: 1 month Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r223356) @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r goto done; } - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) alignment = len; /* Adjust parameters to stripeoffset */ - offset = pp->lg_stripeoffset / pp->lg_sectorsize; + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; start = ALIGNUP(start + offset, alignment); if (size > alignment) size = ALIGNDOWN(size, alignment); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 05:20:20 2011 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 EFA79106566C; Tue, 21 Jun 2011 05:20:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward4.mail.yandex.net (forward4.mail.yandex.net [77.88.46.9]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6648FC1A; Tue, 21 Jun 2011 05:20:19 +0000 (UTC) Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward4.mail.yandex.net (Yandex) with ESMTP id F10F65025F2; Tue, 21 Jun 2011 09:04:07 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1308632648; bh=XUmg0IgO5MSwO6uKx2prFEEQYz/c7moqcWFIaefP9OA=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=aMUd6o3aSts0xmDxkUbpZX+cHJ1+OnDcbNFKLj5qwfcuVO7uKLMKNX4AHzHQfzqRn unCRS4N0FfE8R6lVQOj6FKwlw2nduaOUN0gvnKOkhVg5lESWuFpHT10DFyKzp+XNqT +lrGBjlJP2bgG7O3h7suQ6/x8u0oGdU7kvyUDg/Y= Received: from [127.0.0.1] (proxy.kirov.so-cdu.ru [77.72.136.146]) by smtp4.mail.yandex.net (Yandex) with ESMTPSA id 9016D64980AF; Tue, 21 Jun 2011 09:04:07 +0400 (MSD) Message-ID: <4E00263C.4040802@yandex.ru> Date: Tue, 21 Jun 2011 09:03:56 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: Xin LI References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> In-Reply-To: <201106210446.p5L4k0IZ080002@svn.freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig4B5615A34375DA2D5C465728" X-Yandex-Spam: 1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 05:20:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4B5615A34375DA2D5C465728 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 21.06.2011 8:46, Xin LI wrote: > Author: delphij > Date: Tue Jun 21 04:46:00 2011 > New Revision: 223356 > URL: http://svn.freebsd.org/changeset/base/223356 >=20 > Log: > Mod the offset padding by alignment. Without this change we may > pad too much when underlying GEOM object have a zero stripesize. No. In any way offset value could not be greater than mediasize. And it do nothing when alignment value is 1. > MFC after: 1 month I did not MFC'd these changes yet. > Modified: > head/sbin/geom/class/part/geom_part.c >=20 > Modified: head/sbin/geom/class/part/geom_part.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/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r22= 3355) > +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r22= 3356) > @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r > goto done; > } > =20 > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > last =3D (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); > LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { > s =3D find_provcfg(pp, "index"); > @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) > alignment =3D len; > =20 > /* Adjust parameters to stripeoffset */ > - offset =3D pp->lg_stripeoffset / pp->lg_sectorsize; > + offset =3D (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; > start =3D ALIGNUP(start + offset, alignment); > if (size > alignment) > size =3D ALIGNDOWN(size, alignment); >=20 >=20 --=20 WBR, Andrey V. Elsukov --------------enig4B5615A34375DA2D5C465728 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOACZCAAoJEAHF6gQQyKF6594IAI1jKu3de1KWJHx6gKrqpbUi ErKG+TdXURy+tonSC+tMkwnP7EYLWzM4xax+/wHQFh9vK6BwcTWWsYZcuEpt6Pee KmanfrEjNtpcq14ypOP6RytElEa1lDyQy96Vam+q1jLLVhTRYkuI3xpY6uk/1I4J lDty1lyomM2PqRpEOsMn0wtdKO71qllmyk2TWySF/uafihV18nHs+w3aSLreGN1w SZC0xTFFEtbvIOt4WwVusb8ZjAbSBDiUk57QJoQLGIEmBP3sBIPVcFhiRnrIdP0V Agi5hqbdQQTE3BJDi57GebaEGCGYqnGMdqOsjNdJ5y2yPUXGwI4JEd4InOvYq1g= =Lf+i -----END PGP SIGNATURE----- --------------enig4B5615A34375DA2D5C465728-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 06:04:45 2011 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 3BB711065672; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE768FC12; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id C517AF2E3; Mon, 20 Jun 2011 23:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308636284; bh=rcnkCBwzhzBvLbW17NFRxX2Z0ilQnN1j4gHV2kP9Aq8=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=AWYOIbjhEVsYNQmRqHRkQDAGAawtMz48tLDEiyT3GNB1X4qvMvbQA8SRb9boXkmMf 6ZTkBbZ8E9xc18Jnt/hx1OTidjFgH7nNqu31dR7+Ci1bfHIl8n02Fvbe3MrlHm+aq6 Td0ocPnXPfXcbsfv1I8oF0sLRC5fWO/n3NT+TVsM= Message-ID: <4E00347B.7060708@delphij.net> Date: Mon, 20 Jun 2011 23:04:43 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> In-Reply-To: <4E00263C.4040802@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages 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, 21 Jun 2011 06:04:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 22:03, Andrey V. Elsukov wrote: I don't think this changeset do anything with mediasize? No, an alignment value of 1 makes offset = 0, which is the intended behavior. Or did I misunderstood the code? Thanks in advance! - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOADR5AAoJEATO+BI/yjfB0OAIAJyN4zlzEfqkQG3umeho6lqY xdPl7/+7iJGFHQABeSnZ2dCUJTl8TpVRA51Ag6070h39YP5oNiJUcPhPy3OQnBXE lpYW/YGMg0uiXt3/sGvzVvMboUUeiH3TBgj2qD8DOHYF3Jr5c/zX/Tn5WCCE5aAu rLgPWw1bD9jnZkedL2fC/QY9jHtTN6BHZhD0o4bpB2IhY7I2xCe1Z25IZ7sbMEEH O8CqrRud+r1VQTXIrnFBrXd/Str98GCN3nnyke8pm23XeuLtu4BDzYbqAACGVwIs MOth1JfgqVcmo9Vch4zxT2652jLxQjxEwJOtqLzXe2DJ1V9iuafVPBENlAE8IG0= =O+OI -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 06:04:45 2011 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 8077C106564A; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 2AFAD8FC13; Tue, 21 Jun 2011 06:04:45 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id D14AEF2E4; Mon, 20 Jun 2011 23:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308636285; bh=qUyT6GK/QBoxk9q3wl9v1gpVh8j/16mBRAKz9CfN/KI=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NfL5o4iPTD3wQjlNFztP0onIbld4tZQWUBFbj6fdGpQfeMBxr8fvj7japZL747eJj HJ11RM8PYhT4Kv3oscKtJYbEcUpND5UNfrGMD/FhRtywOI5VDH8tyLJ2NkM9RqnknK PihlmtFuP43XqNrwTD9YZzx2VORWeoXxMyJcVDcI= Message-ID: <4E00347A.80407@delphij.net> Date: Mon, 20 Jun 2011 23:04:42 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> In-Reply-To: <4E00263C.4040802@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages 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, 21 Jun 2011 06:04:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 22:03, Andrey V. Elsukov wrote: > On 21.06.2011 8:46, Xin LI wrote: >> Author: delphij >> Date: Tue Jun 21 04:46:00 2011 >> New Revision: 223356 >> URL: http://svn.freebsd.org/changeset/base/223356 >> >> Log: >> Mod the offset padding by alignment. Without this change we may >> pad too much when underlying GEOM object have a zero stripesize. > > No. In any way offset value could not be greater than mediasize. I don't think this changeset do anything with mediasize? > And it do nothing when alignment value is 1. No, an alignment value of 1 makes offset = 0, which is the intended behavior. Or did I misunderstood the code? Thanks in advance! >> MFC after: 1 month > > I did not MFC'd these changes yet. > >> Modified: >> head/sbin/geom/class/part/geom_part.c >> >> Modified: head/sbin/geom/class/part/geom_part.c >> ============================================================================== >> --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:06:39 2011 (r223355) >> +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 04:46:00 2011 (r223356) >> @@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *r >> goto done; >> } >> >> - offset = pp->lg_stripeoffset / pp->lg_sectorsize; >> + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; >> last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); >> LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { >> s = find_provcfg(pp, "index"); >> @@ -497,7 +497,7 @@ gpart_autofill(struct gctl_req *req) >> alignment = len; >> >> /* Adjust parameters to stripeoffset */ >> - offset = pp->lg_stripeoffset / pp->lg_sectorsize; >> + offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; >> start = ALIGNUP(start + offset, alignment); >> if (size > alignment) >> size = ALIGNDOWN(size, alignment); >> >> > > - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOADR6AAoJEATO+BI/yjfBG5gH/2AFDv/cyvUXM16C5GBKjj8m XOqqRziAPz8VsICXjFLBdx0wxguYAB7Dr4U8krUgH0rOMIUXuew6lNmjQxfW2TQd 66o8XMTe9WdV28SZcJDJWpU5vAD2lQcGs88AjJt4fbtndHte3XN1kjBdZ6DpmMLw gdbn1iU836DFTE4kMdOhNb+h4RRbGNNx8QJ0jJO0RNrIUMy+w/dbgGUTqjYm6hTj vbZlA41QxSEx/cTDH7puje3/E9j9cIaOo3sCNpk1YrnVF7Syzn7arBruCmpDEVsN NIGVbD+WMvS4VxLK1Vwb6C1G6nYmf74fHDmkcwV4sg5iUw8V2SS6AO73ml9I/7U= =nfFW -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 06:06:47 2011 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 7BFB2106566B; Tue, 21 Jun 2011 06:06:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC008FC14; Tue, 21 Jun 2011 06:06: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 p5L66lqN082667; Tue, 21 Jun 2011 06:06:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L66lZ3082664; Tue, 21 Jun 2011 06:06:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106210606.p5L66lZ3082664@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 06:06: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: r223358 - head/sys/netinet/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, 21 Jun 2011 06:06:47 -0000 Author: ae Date: Tue Jun 21 06:06:47 2011 New Revision: 223358 URL: http://svn.freebsd.org/changeset/base/223358 Log: Do not use SET_HOST_IPLEN() macro for IPv6 packets. PR: kern/157239 MFC after: 2 weeks Modified: head/sys/netinet/ipfw/ip_dn_io.c head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- head/sys/netinet/ipfw/ip_dn_io.c Tue Jun 21 05:27:49 2011 (r223357) +++ head/sys/netinet/ipfw/ip_dn_io.c Tue Jun 21 06:06:47 2011 (r223358) @@ -668,7 +668,6 @@ dummynet_send(struct mbuf *m) break; case DIR_OUT | PROTO_IPV6: - SET_HOST_IPLEN(mtod(m, struct ip *)); ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); break; #endif Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jun 21 05:27:49 2011 (r223357) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jun 21 06:06:47 2011 (r223358) @@ -127,8 +127,9 @@ again: args.rule = *((struct ipfw_rule_ref *)(tag+1)); m_tag_delete(*m0, tag); if (args.rule.info & IPFW_ONEPASS) { - SET_HOST_IPLEN(mtod(*m0, struct ip *)); - return 0; + if (mtod(*m0, struct ip *)->ip_v == 4) + SET_HOST_IPLEN(mtod(*m0, struct ip *)); + return (0); } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 06:23:51 2011 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 A7B15106566C; Tue, 21 Jun 2011 06:23:51 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward3.mail.yandex.net (forward3.mail.yandex.net [77.88.46.8]) by mx1.freebsd.org (Postfix) with ESMTP id 529728FC08; Tue, 21 Jun 2011 06:23:51 +0000 (UTC) Received: from smtp3.mail.yandex.net (smtp3.mail.yandex.net [77.88.46.103]) by forward3.mail.yandex.net (Yandex) with ESMTP id 719E6B42AD2; Tue, 21 Jun 2011 10:23:49 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1308637429; bh=yAEV++ke3o74DxMqamOTMEi14BpQpTaHT8PkbZGGjaY=; h=Message-ID:Date:From:MIME-Version:CC:Subject:References: In-Reply-To:Content-Type; b=KIsx8/wLyoL3fX0m7s+TwqU5dHV0t7RMsLEmISVcVaKbYjUvIFVARb6IbMa5LgPaU A7beiGAlAdFgFEoiaOLNYzo2RP9aR5JmCbUkHn74fAGbo3BFmsWT5Xgph2Dg9lDFbJ Nkws6dVMP15GFkmws5XMxXvF8AbpWwfgOoIHxXEI= Received: from [127.0.0.1] (proxy.kirov.so-cdu.ru [77.72.136.146]) by smtp3.mail.yandex.net (Yandex) with ESMTPSA id 0ECD569800BC; Tue, 21 Jun 2011 10:23:49 +0400 (MSD) Message-ID: <4E0038F1.3050906@yandex.ru> Date: Tue, 21 Jun 2011 10:23:45 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> <4E00347A.80407@delphij.net> In-Reply-To: <4E00347A.80407@delphij.net> X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig5AC99A39D77D396F3B80E683" X-Yandex-Spam: 1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 06:23:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig5AC99A39D77D396F3B80E683 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 21.06.2011 10:04, Xin LI wrote: >>> Mod the offset padding by alignment. Without this change we may >>> pad too much when underlying GEOM object have a zero stripesize. >=20 >> No. In any way offset value could not be greater than mediasize. > I don't think this changeset do anything with mediasize? I did mean that it could not pad too much. When stripesize is zero the stripeoffset points to real offset from the beginning of device. In case when we have nested partitioning schemes like MBR + BSD, stripeoffset of BSD slice could help align partition to the device. >> And it do nothing when alignment value is 1. >=20 > No, an alignment value of 1 makes offset =3D 0, which is the intended > behavior. >=20 > Or did I misunderstood the code? The problem that Kris reported was not here. I think this change is just for the reassurance. --=20 WBR, Andrey V. Elsukov --------------enig5AC99A39D77D396F3B80E683 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJOADj0AAoJEAHF6gQQyKF6xysH/3W+oFrP14nosy1ZzXXnSSvy BJdoetMW7prInPGczw7Xi65fzBBLN8Y793IbG0jObJrkRHxUoEUnb0TzIvhTnh4b cSLuQLcN6g8FZ4gdwBja9W7k5Kx00b0zRyaz+dMkRqDDumBFole4R8tS3dG7z6o1 nsmFadpuq9wajyk3rTQNmG+fPGAy0K4E689nYcy+5JoxA2/FIvuW2K+LVEZ+Es6E rFjHtusW4yejfIWKTXhSXyLdhi+KA+j/Di5znui6YpWzBwygpcTmdRzbJOfsi9ks WWDFJAc14kPLVdg6SWa01fFSkFciC+VfImRxH9k3f1v3vzfnwenbYLE+JzyMvz0= =w1w+ -----END PGP SIGNATURE----- --------------enig5AC99A39D77D396F3B80E683-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 07:19:04 2011 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 1CCDA106566C; Tue, 21 Jun 2011 07:19:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC798FC08; Tue, 21 Jun 2011 07:19: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 p5L7J3LY085713; Tue, 21 Jun 2011 07:19:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L7J3A4085710; Tue, 21 Jun 2011 07:19:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106210719.p5L7J3A4085710@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 21 Jun 2011 07:19: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: r223359 - 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, 21 Jun 2011 07:19:04 -0000 Author: bz Date: Tue Jun 21 07:19:03 2011 New Revision: 223359 URL: http://svn.freebsd.org/changeset/base/223359 Log: Garbage collect never used global, sysctl, externs. MFC after: 1 week Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jun 21 06:06:47 2011 (r223358) +++ head/sys/net/route.c Tue Jun 21 07:19:03 2011 (r223359) @@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes no static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) -#if 0 -/* default fib for tunnels to use */ -u_int tunnel_fib = 0; -SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, ""); -#endif - /* * handler for net.my_fibnum */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Jun 21 06:06:47 2011 (r223358) +++ head/sys/net/route.h Tue Jun 21 07:19:03 2011 (r223359) @@ -108,8 +108,6 @@ struct rt_metrics { #endif extern u_int rt_numfibs; /* number fo usable routing tables */ -extern u_int tunnel_fib; /* tunnels use these */ -extern u_int fwd_fib; /* packets being forwarded use these routes */ /* * XXX kernel function pointer `rt_output' is visible to applications. */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 08:31:29 2011 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 EAEB41065673; Tue, 21 Jun 2011 08:31:29 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id CDDDC8FC08; Tue, 21 Jun 2011 08:31:29 +0000 (UTC) Received: from delta.delphij.net (c-76-102-50-245.hsd1.ca.comcast.net [76.102.50.245]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 3249EF836; Tue, 21 Jun 2011 01:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1308645089; bh=fHsY/k/qwc1MxLiRTDUIUmnc+lHwADCUcVRB+u3XdSw=; h=Message-ID:Date:From:Reply-To:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=GxGWppQ6a5C38pDOADR3Fg4GkqTO+4asaKuWkF7T5POHRBlyQ8PGk2l8OVmtEVEEg 3E58SSk+T9jFDJCsfbFnYiOLXVmedXpAMfBDxzhxuhbE4d7bxgYep8l8+FOo3uY1XN 619oT6I/de9BcRShY6YZXjXQg6f1ekWVACXsaAtQ= Message-ID: <4E0056E0.2030104@delphij.net> Date: Tue, 21 Jun 2011 01:31:28 -0700 From: Xin LI Organization: The FreeBSD Project MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201106210446.p5L4k0IZ080002@svn.freebsd.org> <4E00263C.4040802@yandex.ru> <4E00347A.80407@delphij.net> <4E0038F1.3050906@yandex.ru> In-Reply-To: <4E0038F1.3050906@yandex.ru> OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r223356 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: "SVN commit messages 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, 21 Jun 2011 08:31:30 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 06/20/11 23:23, Andrey V. Elsukov wrote: > On 21.06.2011 10:04, Xin LI wrote: >>>> Mod the offset padding by alignment. Without this change we may >>>> pad too much when underlying GEOM object have a zero stripesize. >> >>> No. In any way offset value could not be greater than mediasize. >> I don't think this changeset do anything with mediasize? > > I did mean that it could not pad too much. When stripesize is zero the > stripeoffset points to real offset from the beginning of device. > In case when we have nested partitioning schemes like MBR + BSD, > stripeoffset of BSD slice could help align partition to the device. Yes agreed. >>> And it do nothing when alignment value is 1. >> >> No, an alignment value of 1 makes offset = 0, which is the intended >> behavior. >> >> Or did I misunderstood the code? > > The problem that Kris reported was not here. > I think this change is just for the reassurance. Well, I think semantically the offset variable expects a value that represents in-stripe offset rather than the real (against the media) offset that GEOM returns. I'll defer the merge until your change have been merged. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJOAFbgAAoJEATO+BI/yjfBNPkH/1HEUxWDuUFoO+4r8FGuTyek 8oFYip67HztN5l8CWiOP61utGPyMLcyk5hS6CwkvAiHaChQeGp75Sp/16D0xkyiT qcJOZIUjtTRvkABrLD/M5vLM5nU3cg80quhPmAjXuPytJFBsy7QdP1cjXK7ql0sB bCXMhqWR8oAbQ5rch8BkFlmRQmHEWFVlR2puxUoBi+YrUEKAiv83ghC9UE4H6NT8 trA+UYr+px2AC+opU0yijdscevdVPdJi6mo08EFqbC6ABzIwTR2Ky2LLhdGrmuk+ impuJz4r44LsKvAxOqFn9bZoBLRTxHMkSju4R8kaAfxT3dehTOK2RViI3FaH7Ko= =jRrp -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 08:37:56 2011 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 1FAB61065673; Tue, 21 Jun 2011 08:37: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 E9C618FC14; Tue, 21 Jun 2011 08:37: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 p5L8bti9088150; Tue, 21 Jun 2011 08:37:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L8btRY088148; Tue, 21 Jun 2011 08:37:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106210837.p5L8btRY088148@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Jun 2011 08:37: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: r223360 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 08:37:56 -0000 Author: mav Date: Tue Jun 21 08:37:55 2011 New Revision: 223360 URL: http://svn.freebsd.org/changeset/base/223360 Log: MFC r222897: Intel NM10 chipset's SATA controller has same PCI ID and revision as ICH7's, but has only 2 SATA ports instead of 4. The worst part is that SStatus and SError registers for missing ports are not implemented and return wrong values (0xffffffff), that caused infinite reset loop. Just ignore that SError value while I found no better way to identify them. Modified: stable/8/sys/dev/ata/ata-sata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/ata-sata.c ============================================================================== --- stable/8/sys/dev/ata/ata-sata.c Tue Jun 21 07:19:03 2011 (r223359) +++ stable/8/sys/dev/ata/ata-sata.c Tue Jun 21 08:37:55 2011 (r223360) @@ -54,6 +54,11 @@ ata_sata_phy_check_events(device_t dev, u_int32_t error, status; ata_sata_scr_read(ch, port, ATA_SERROR, &error); + + /* Check that SError value is sane. */ + if (error == 0xffffffff) + return; + /* Clear set error bits/interrupt. */ if (error) ata_sata_scr_write(ch, port, ATA_SERROR, error); @@ -163,18 +168,18 @@ ata_sata_phy_reset(device_t dev, int por if (bootverbose) { if (port < 0) { - device_printf(dev, "hardware reset ...\n"); + device_printf(dev, "hard reset ...\n"); } else { - device_printf(dev, "p%d: hardware reset ...\n", port); + device_printf(dev, "p%d: hard reset ...\n", port); } } for (retry = 0; retry < 10; retry++) { for (loop = 0; loop < 10; loop++) { if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET)) - return (0); + goto fail; ata_udelay(100); if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) - return (0); + goto fail; if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_RESET) break; } @@ -183,15 +188,26 @@ ata_sata_phy_reset(device_t dev, int por if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))) - return (0); + goto fail; ata_udelay(100); if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) - return (0); + goto fail; if ((val & ATA_SC_DET_MASK) == 0) return ata_sata_connect(ch, port, 0); } } - return 0; +fail: + /* Clear SATA error register. */ + ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff); + + if (bootverbose) { + if (port < 0) { + device_printf(dev, "hard reset failed\n"); + } else { + device_printf(dev, "p%d: hard reset failed\n", port); + } + } + return (0); } int From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 08:39:09 2011 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 840B7106564A; Tue, 21 Jun 2011 08:39:09 +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 737E38FC15; Tue, 21 Jun 2011 08:39: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 p5L8d951088232; Tue, 21 Jun 2011 08:39:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5L8d97u088230; Tue, 21 Jun 2011 08:39:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106210839.p5L8d97u088230@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Jun 2011 08:39: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: r223361 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 08:39:09 -0000 Author: mav Date: Tue Jun 21 08:39:09 2011 New Revision: 223361 URL: http://svn.freebsd.org/changeset/base/223361 Log: MFC r223097: Skip BAR(5) usage for SATA registers access on ICH8M Apples, because for some reason it causes system lock up. Linux does the same. Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 21 08:37:55 2011 (r223360) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Tue Jun 21 08:39:09 2011 (r223361) @@ -288,7 +288,9 @@ ata_intel_chipinit(device_t dev) ATA_OUTL(ctlr->r_res2, 0x0C, ATA_INL(ctlr->r_res2, 0x0C) | 0xf); } - } else { + /* Skip BAR(5) on ICH8M Apples, system locks up on access. */ + } else if (ctlr->chip->chipid != ATA_I82801HBM_S1 || + pci_get_subvendor(dev) != 0x106b) { ctlr->r_type2 = SYS_RES_IOPORT; ctlr->r_rid2 = PCIR_BAR(5); ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 10:35:20 2011 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 7A8901065677; Tue, 21 Jun 2011 10:35:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFFD8FC4B; Tue, 21 Jun 2011 10:35: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 p5LAZKUk091943; Tue, 21 Jun 2011 10:35:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LAZKGq091941; Tue, 21 Jun 2011 10:35:20 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106211035.p5LAZKGq091941@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 21 Jun 2011 10:35: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: r223364 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 10:35:20 -0000 Author: ae Date: Tue Jun 21 10:35:20 2011 New Revision: 223364 URL: http://svn.freebsd.org/changeset/base/223364 Log: When user specifies the bootcode with size smaller than VTOC_BOOTCODE, gpart_write_partcode_vtoc8 does access out of range of allocated memory. Check size of bootcode before writing it. Pointed out by: ru MFC after: 1 week Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jun 21 09:19:38 2011 (r223363) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 21 10:35:20 2011 (r223364) @@ -1208,8 +1208,11 @@ gpart_bootcode(struct gctl_req *req, uns if (idx == 0) errx(EXIT_FAILURE, "missing -i option"); gpart_write_partcode(gp, idx, partcode, partsize); - } else + } else { + if (partsize != VTOC_BOOTSIZE) + errx(EXIT_FAILURE, "invalid bootcode"); gpart_write_partcode_vtoc8(gp, idx, partcode); + } } else if (bootcode == NULL) errx(EXIT_FAILURE, "no -b nor -p"); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 12:38:40 2011 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 D501D1065672; Tue, 21 Jun 2011 12:38:40 +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 C525E8FC16; Tue, 21 Jun 2011 12:38: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 p5LCce8O001410; Tue, 21 Jun 2011 12:38:40 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LCceJV001408; Tue, 21 Jun 2011 12:38:40 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106211238.p5LCceJV001408@svn.freebsd.org> From: Alan Cox Date: Tue, 21 Jun 2011 12:38: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: r223365 - head/sys/ia64/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: Tue, 21 Jun 2011 12:38:40 -0000 Author: alc Date: Tue Jun 21 12:38:40 2011 New Revision: 223365 URL: http://svn.freebsd.org/changeset/base/223365 Log: Use a non-standard page size that is supported. Modified: head/sys/ia64/conf/NOTES Modified: head/sys/ia64/conf/NOTES ============================================================================== --- head/sys/ia64/conf/NOTES Tue Jun 21 10:35:20 2011 (r223364) +++ head/sys/ia64/conf/NOTES Tue Jun 21 12:38:40 2011 (r223365) @@ -25,7 +25,7 @@ options LOG2_ID_PAGE_SIZE=27 # 128M # option: LOG2_PAGE_SIZE # Specify the log2 size of the page to be used for virtual memory management. # The page size being equal to 1< 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 0AD02106566C; Tue, 21 Jun 2011 13:07:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D59FB8FC12; Tue, 21 Jun 2011 13:07:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8C95F46B06; Tue, 21 Jun 2011 09:07:19 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1EFAA8A01F; Tue, 21 Jun 2011 09:07:19 -0400 (EDT) From: John Baldwin To: Jack F Vogel Date: Tue, 21 Jun 2011 09:07:17 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106202259.p5KMxT1h069297@svn.freebsd.org> In-Reply-To: <201106202259.p5KMxT1h069297@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106210907.18414.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 09:07:19 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 13:07:20 -0000 On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > Author: jfv > Date: Mon Jun 20 22:59:29 2011 > New Revision: 223350 > URL: http://svn.freebsd.org/changeset/base/223350 > > Log: > Eliminate some global tuneables in favor of adapter-specific, > particular flow control and dma coalesce. Also improve the > sysctl operation on those too. > > Add IPv6 detection in the ioctl code, this was done for > ixgbe first, carrying that over. > > Add resource ability to disable particular adapter. > > Add HW TSO capability so vlans can make use of TSO The tunables are useful for setting defaults for all interfaces. :( I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can ensure that all igb interfaces in a given system have that setting. This is more scalable than having to set the right number of entries in /etc/sysctl.conf.local on different machines, etc, without spamming the console during boot with warnings about tweaking non-existing sysctls, etc. Please consider keeping the tunables where the tunables are used to set default settings for all adapters from the loader but per-device sysctls are used post-boot to provide runtime, per-device settings. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 13:31:43 2011 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 57DCD106566B; Tue, 21 Jun 2011 13:31:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2DCBE8FC15; Tue, 21 Jun 2011 13:31:43 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D5E9C46B23; Tue, 21 Jun 2011 09:31:42 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 718038A01F; Tue, 21 Jun 2011 09:31:42 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 21 Jun 2011 09:10:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110618210815.W889@besplex.bde.org> <201106201941.03393.jkim@FreeBSD.org> In-Reply-To: <201106201941.03393.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106210910.25697.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 09:31:42 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/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: Tue, 21 Jun 2011 13:31:43 -0000 On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > My questions to you: > > a) Why do we care TSC timecounter when it is not invariant where we > *know* it is unusable and set to negative quality? What if the user knows they will not enable CPU throttling so for them the TSC is safe? In that case, TSC is a more efficient timecounter and if the user constrains the system to make the TSC safe we should let them use it. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 14:40:12 2011 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 BE9661065674; Tue, 21 Jun 2011 14:40:12 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id 6F99A8FC16; Tue, 21 Jun 2011 14:40:12 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LEDqOS044711; Tue, 21 Jun 2011 09:13:52 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LEDjCw032591 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 09:13:46 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LEDjCw032591 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308665627; bh=QReqI2toiDtyqfrWzJ1Xa76muHycMexXERopW+Q6Apk=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=VlVng96NdbBo0e2Zv1ZPDFrRqx1RNe9kdCmQdXORAeZ+od2BaMgQWhRQ9ecMVjTh5 IeWP9ViutKIXrcHDGPzDT/cIUck41pEaz7klIeKMrU92EdmO/tl3jkxbXwFJwsM8UQ z1N3YK9hJgRZ4ON6Geqo7VG0qiVC5yBCAqUzLfm0= Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <201106210907.18414.jhb@freebsd.org> Date: Tue, 21 Jun 2011 09:13:45 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <5DCAB741-793C-4595-A83D-CC89D9D14A13@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 09:13:47 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LEDjCw032591 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: Jack F Vogel , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 14:40:12 -0000 On Jun 21, 2011, at 8:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> Author: jfv >> Date: Mon Jun 20 22:59:29 2011 >> New Revision: 223350 >> URL: http://svn.freebsd.org/changeset/base/223350 >>=20 >> Log: >> Eliminate some global tuneables in favor of adapter-specific, >> particular flow control and dma coalesce. Also improve the >> sysctl operation on those too. >>=20 >> Add IPv6 detection in the ioctl code, this was done for >> ixgbe first, carrying that over. >>=20 >> Add resource ability to disable particular adapter. >>=20 >> Add HW TSO capability so vlans can make use of TSO >=20 > The tunables are useful for setting defaults for all interfaces. :( >=20 > I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can=20 > ensure that all igb interfaces in a given system have that setting. = This is=20 > more scalable than having to set the right number of entries in=20 > /etc/sysctl.conf.local on different machines, etc, without spamming = the=20 > console during boot with warnings about tweaking non-existing sysctls, = etc. >=20 > Please consider keeping the tunables where the tunables are used to = set > default settings for all adapters from the loader but per-device = sysctls are > used post-boot to provide runtime, per-device settings. I agree. Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 15:49:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id E4FF8106564A; Tue, 21 Jun 2011 15:49:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 21 Jun 2011 11:48:55 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106201941.03393.jkim@FreeBSD.org> <201106210910.25697.jhb@freebsd.org> In-Reply-To: <201106210910.25697.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211149.02280.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/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: Tue, 21 Jun 2011 15:49:15 -0000 On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > My questions to you: > > > > a) Why do we care TSC timecounter when it is not invariant where > > we *know* it is unusable and set to negative quality? > > What if the user knows they will not enable CPU throttling so for > them the TSC is safe? In that case, TSC is a more efficient > timecounter and if the user constrains the system to make the TSC > safe we should let them use it. In that case, it must be a UP system, the quality is still 800, and TSC value won't be shifted. My question was specific to SMP cases. Sorry, I didn't make that clear. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 15:57:26 2011 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 854551065672; Tue, 21 Jun 2011 15:57:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 59A9F8FC17; Tue, 21 Jun 2011 15:57:26 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 076E946B03; Tue, 21 Jun 2011 11:57:26 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 87E218A01F; Tue, 21 Jun 2011 11:57:25 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Tue, 21 Jun 2011 11:56:38 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106210910.25697.jhb@freebsd.org> <201106211149.02280.jkim@FreeBSD.org> In-Reply-To: <201106211149.02280.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211156.38396.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 11:57:25 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/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: Tue, 21 Jun 2011 15:57:26 -0000 On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote: > On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > > My questions to you: > > > > > > a) Why do we care TSC timecounter when it is not invariant where > > > we *know* it is unusable and set to negative quality? > > > > What if the user knows they will not enable CPU throttling so for > > them the TSC is safe? In that case, TSC is a more efficient > > timecounter and if the user constrains the system to make the TSC > > safe we should let them use it. > > In that case, it must be a UP system, the quality is still 800, and > TSC value won't be shifted. > > My question was specific to SMP cases. Sorry, I didn't make that > clear. What if the user has an SMP system where the TSCs are in sync but it's older so it doesn't set the TSC invariant bit set in cpuid. Are we now forbidding that user from using the TSC? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 16:07:25 2011 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 47AB41065672; Tue, 21 Jun 2011 16:07:25 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 956FC8FC13; Tue, 21 Jun 2011 16:07:24 +0000 (UTC) Received: by vws18 with SMTP id 18so2343895vws.13 for ; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mCaN4XP7X/wzi2TdNzoY2SDzy2UIXBQzy9kPMDYwKFQ=; b=BsAsw5cWBdWqJf4OkOoL/B4QBoJXAxXWy3FEkd61xljTUEBIue4Ts7JOX0P86wfjcF +liMeIkoyyeeM3oleL9xKuM9UkN1UEDZUr5RQShRDE26GSXJNz/8ei7mvRM6ey5SKcFu 159pNc3jt/s9d7oU/snA8599vrv2t8d3FSjEQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=C+RvUCg5nWf2diIp21Lja8lwmMuZQYHl2kIhjNp34nkqDIw/2Yo9QV0EJus3GC0XJD i1e06ogvasOvhvRiWrt0RVmzPF+SNZ5vm7lzUiP3hx2kN8bdYkeUu8vGimNZpCK38g8G EbgLKAF3UEusFpzZ3tZWTau+KT7IrBWxSFLNU= MIME-Version: 1.0 Received: by 10.52.98.34 with SMTP id ef2mr5540910vdb.293.1308672443711; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) Received: by 10.52.114.99 with HTTP; Tue, 21 Jun 2011 09:07:23 -0700 (PDT) In-Reply-To: <201106210907.18414.jhb@freebsd.org> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> Date: Tue, 21 Jun 2011 09:07:23 -0700 Message-ID: From: Jack Vogel To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 16:07:25 -0000 LOL, the old adage is true, you just can't please all the people... :) The way the code now is it assigns a default, but you could still have a loader entry that would change it for all adapters if you wanted to, but ok, if you prefer the older for this. What other globals do you think should be retained? Jack On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Jun 20 22:59:29 2011 > > New Revision: 223350 > > URL: http://svn.freebsd.org/changeset/base/223350 > > > > Log: > > Eliminate some global tuneables in favor of adapter-specific, > > particular flow control and dma coalesce. Also improve the > > sysctl operation on those too. > > > > Add IPv6 detection in the ioctl code, this was done for > > ixgbe first, carrying that over. > > > > Add resource ability to disable particular adapter. > > > > Add HW TSO capability so vlans can make use of TSO > > The tunables are useful for setting defaults for all interfaces. :( > > I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can > ensure that all igb interfaces in a given system have that setting. This > is > more scalable than having to set the right number of entries in > /etc/sysctl.conf.local on different machines, etc, without spamming the > console during boot with warnings about tweaking non-existing sysctls, etc. > > Please consider keeping the tunables where the tunables are used to set > default settings for all adapters from the loader but per-device sysctls > are > used post-boot to provide runtime, per-device settings. > > -- > John Baldwin > From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 16:12:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id C4B88106564A; Tue, 21 Jun 2011 16:12:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Tue, 21 Jun 2011 12:11:58 -0400 User-Agent: KMail/1.6.2 References: <201106081938.p58JcWuB044252@svn.freebsd.org> <201106211149.02280.jkim@FreeBSD.org> <201106211156.38396.jhb@freebsd.org> In-Reply-To: <201106211156.38396.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106211212.03140.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r222866 - head/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: Tue, 21 Jun 2011 16:12:14 -0000 On Tuesday 21 June 2011 11:56 am, John Baldwin wrote: > On Tuesday, June 21, 2011 11:48:55 am Jung-uk Kim wrote: > > On Tuesday 21 June 2011 09:10 am, John Baldwin wrote: > > > On Monday, June 20, 2011 7:41:00 pm Jung-uk Kim wrote: > > > > My questions to you: > > > > > > > > a) Why do we care TSC timecounter when it is not invariant > > > > where we *know* it is unusable and set to negative quality? > > > > > > What if the user knows they will not enable CPU throttling so > > > for them the TSC is safe? In that case, TSC is a more > > > efficient timecounter and if the user constrains the system to > > > make the TSC safe we should let them use it. > > > > In that case, it must be a UP system, the quality is still 800, > > and TSC value won't be shifted. > > > > My question was specific to SMP cases. Sorry, I didn't make that > > clear. > > What if the user has an SMP system where the TSCs are in sync but > it's older so it doesn't set the TSC invariant bit set in cpuid. > Are we now forbidding that user from using the TSC? We do not forbid it but we cannot increase the quality because we don't compensate drift. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 16:18:10 2011 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 3F3AC1065672; Tue, 21 Jun 2011 16:18:10 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id EF7318FC16; Tue, 21 Jun 2011 16:18:09 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LGHrOh050082; Tue, 21 Jun 2011 11:17:53 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LGHhCN036265 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 11:17:44 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LGHhCN036265 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308673065; bh=EoL280FRHu8JSFiaa5OWWFzVaM89NSbjTapQ52jk808=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=mL57pDsn0kwXANNb9TNWSUrdxvvgUyWz1lNYPfD5KSSUkxp1i9YwvLBbjjifCeNF8 O0pejRGZOfOhHH+/Tlz+k/cTDgc5SGTMZG4i7vdyFrYjEKmiI2cdTtlXDSOG4hNAph sLxQ5TnbVWUHZxPZf9ca8ikw1btefS4A30Ez7zNU= Mime-Version: 1.0 (Apple Message framework v1084) From: Guy Helmer In-Reply-To: Date: Tue, 21 Jun 2011 11:17:43 -0500 Message-Id: <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> To: Jack Vogel X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 11:17:45 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LGHhCN036265 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.899, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 16:18:10 -0000 On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: > LOL, the old adage is true, you just can't please all the people... :)=20= >=20 > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you=20 > think should be retained? >=20 I'd like to be able to set the global default for flow control. I'd = also appreciate a global default for disabling TCP checksum offload, but = that's above and beyond what we had before :-) > Jack >=20 >=20 > On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: > > Author: jfv > > Date: Mon Jun 20 22:59:29 2011 > > New Revision: 223350 > > URL: http://svn.freebsd.org/changeset/base/223350 > > > > Log: > > Eliminate some global tuneables in favor of adapter-specific, > > particular flow control and dma coalesce. Also improve the > > sysctl operation on those too. > > > > Add IPv6 detection in the ioctl code, this was done for > > ixgbe first, carrying that over. > > > > Add resource ability to disable particular adapter. > > > > Add HW TSO capability so vlans can make use of TSO >=20 > The tunables are useful for setting defaults for all interfaces. :( >=20 > I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can > ensure that all igb interfaces in a given system have that setting. = This is > more scalable than having to set the right number of entries in > /etc/sysctl.conf.local on different machines, etc, without spamming = the > console during boot with warnings about tweaking non-existing sysctls, = etc. >=20 > Please consider keeping the tunables where the tunables are used to = set > default settings for all adapters from the loader but per-device = sysctls are > used post-boot to provide runtime, per-device settings. >=20 > -- > John Baldwin >=20 --------=0AThis message has been scanned by ComplianceSafe, powered by Palisade's PacketSure.=0A From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 16:34:07 2011 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 C248C106566B; Tue, 21 Jun 2011 16:34:07 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2BDD88FC16; Tue, 21 Jun 2011 16:34:06 +0000 (UTC) Received: by vws18 with SMTP id 18so2374483vws.13 for ; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fACssCU+1efZmGJOKOTvNCIwtpQjEMTBYYjx98eI7XA=; b=ZZ+TzMPblZ9+axXAupcol6O+nYrbfG/hd3iTZ1tJhhKlxJSIU10jO4imrDRLXCdmco dd4KbB1mJcyUwh3FweRhJCvhL1uGgr/0Pb6uikHho8nAvzBPF2NZqikSt/ElWdShVVXg 3+3pF22b9nGdn1g6IOjDzYU9bK+l7r0ekCxbE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kBgpC7QkB1N7DBWbahc/+8nLpfGgioUzZfjFWjSdfHb9EOdfToX+mn4sywe+8qK+kr ktzJoBOozzvCpKqOwpuJG8bjSO5Emw520v4/ex+BGXoUcyGuayBaUrPspBp3dnZyC5dn P+VVHK5JFxhI7zE/VnITRnfBCkcB8pH1aa18I= MIME-Version: 1.0 Received: by 10.52.71.176 with SMTP id w16mr6255525vdu.133.1308674046050; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) Received: by 10.52.114.99 with HTTP; Tue, 21 Jun 2011 09:34:06 -0700 (PDT) In-Reply-To: <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> Date: Tue, 21 Jun 2011 09:34:06 -0700 Message-ID: From: Jack Vogel To: Guy Helmer Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 16:34:07 -0000 There IS a global default for flow control, its just hardcoded.. :) Flow control was something my validation group specifically ragged on me about... and was the reason I changed to a per-adapter setting. Let me think about it. Jack On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer wrote: > On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: > > LOL, the old adage is true, you just can't please all the people... :) > > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you > think should be retained? > > > I'd like to be able to set the global default for flow control. I'd also > appreciate a global default for disabling TCP checksum offload, but that's > above and beyond what we had before :-) > > Jack > > > On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin wrote: > >> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> > Author: jfv >> > Date: Mon Jun 20 22:59:29 2011 >> > New Revision: 223350 >> > URL: http://svn.freebsd.org/changeset/base/223350 >> > >> > Log: >> > Eliminate some global tuneables in favor of adapter-specific, >> > particular flow control and dma coalesce. Also improve the >> > sysctl operation on those too. >> > >> > Add IPv6 detection in the ioctl code, this was done for >> > ixgbe first, carrying that over. >> > >> > Add resource ability to disable particular adapter. >> > >> > Add HW TSO capability so vlans can make use of TSO >> >> The tunables are useful for setting defaults for all interfaces. :( >> >> I use hw.igb.rx_processing_limit=-1 in loader.conf at work so that we can >> ensure that all igb interfaces in a given system have that setting. This >> is >> more scalable than having to set the right number of entries in >> /etc/sysctl.conf.local on different machines, etc, without spamming the >> console during boot with warnings about tweaking non-existing sysctls, >> etc. >> >> Please consider keeping the tunables where the tunables are used to set >> default settings for all adapters from the loader but per-device sysctls >> are >> used post-boot to provide runtime, per-device settings. >> >> -- >> John Baldwin >> > > > > > > ------------------------------ > *This message has been scanned by ComplianceSafe, powered by Palisade's > PacketSure.* > From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 16:40:11 2011 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 CBCC61065672; Tue, 21 Jun 2011 16:40:11 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-2-a.compliancesafe.com (ps-2-a.compliancesafe.com [216.81.161.163]) by mx1.freebsd.org (Postfix) with ESMTP id 76D5F8FC0A; Tue, 21 Jun 2011 16:40:11 +0000 (UTC) Received: from mail.palisadesystems.com (localhost.compliancesafe.com [127.0.0.1]) by ps-2-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id p5LGeAJh051062; Tue, 21 Jun 2011 11:40:10 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id p5LGe4Iq037001 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 11:40:05 -0500 (CDT) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com p5LGe4Iq037001 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1308674405; bh=U9Ie/T1VDtzlujMARog6Ujou1SkZDTucv9262zgUDCU=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=S9Xtn8QonYj2gImg3DpUZbN3ZXa/2lFWMneZWYs1bMe9K9PZFKg2nBjjxkerryKYC vOe2+iRQg3iF9xVaBIyCu1D8gdQ1TF160D25EpsQ5qtr554Gd5OSwyuHyB6zut09XK rmGS7B0bg9TnQqtrj/kQEyb1oLYDEUYLcdxQY1Ek= Mime-Version: 1.0 (Apple Message framework v1084) From: Guy Helmer In-Reply-To: Date: Tue, 21 Jun 2011 11:40:04 -0500 Message-Id: References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> <5B6CCF15-05B9-418A-8B84-6A2FF441A39C@palisadesystems.com> To: Jack Vogel X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 21 Jun 2011 11:40:05 -0500 (CDT) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: p5LGe4Iq037001 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.899, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 16:40:11 -0000 Ahh, I meant to say "global tunables". It is nice to have flow control as a per-interface setting also - didn't = have that back in FreeBSD 8.1. Thanks, Guy On Jun 21, 2011, at 11:34 AM, Jack Vogel wrote: > There IS a global default for flow control, its just hardcoded.. :) >=20 > Flow control was something my validation group specifically ragged on = me=20 > about... and was the reason I changed to a per-adapter setting. >=20 > Let me think about it. >=20 > Jack >=20 >=20 > On Tue, Jun 21, 2011 at 9:17 AM, Guy Helmer = wrote: > On Jun 21, 2011, at 11:07 AM, Jack Vogel wrote: >=20 >> LOL, the old adage is true, you just can't please all the people... = :)=20 >>=20 >> The way the code now is it assigns a default, but you could still = have >> a loader entry that would change it for all adapters if you wanted = to, >> but ok, if you prefer the older for this. What other globals do you=20= >> think should be retained? >>=20 >=20 > I'd like to be able to set the global default for flow control. I'd = also appreciate a global default for disabling TCP checksum offload, but = that's above and beyond what we had before :-) >=20 >> Jack >>=20 >>=20 >> On Tue, Jun 21, 2011 at 6:07 AM, John Baldwin = wrote: >> On Monday, June 20, 2011 6:59:29 pm Jack F Vogel wrote: >> > Author: jfv >> > Date: Mon Jun 20 22:59:29 2011 >> > New Revision: 223350 >> > URL: http://svn.freebsd.org/changeset/base/223350 >> > >> > Log: >> > Eliminate some global tuneables in favor of adapter-specific, >> > particular flow control and dma coalesce. Also improve the >> > sysctl operation on those too. >> > >> > Add IPv6 detection in the ioctl code, this was done for >> > ixgbe first, carrying that over. >> > >> > Add resource ability to disable particular adapter. >> > >> > Add HW TSO capability so vlans can make use of TSO >>=20 >> The tunables are useful for setting defaults for all interfaces. :( >>=20 >> I use hw.igb.rx_processing_limit=3D-1 in loader.conf at work so that = we can >> ensure that all igb interfaces in a given system have that setting. = This is >> more scalable than having to set the right number of entries in >> /etc/sysctl.conf.local on different machines, etc, without spamming = the >> console during boot with warnings about tweaking non-existing = sysctls, etc. >>=20 >> Please consider keeping the tunables where the tunables are used to = set >> default settings for all adapters from the loader but per-device = sysctls are >> used post-boot to provide runtime, per-device settings. >>=20 >> -- >> John Baldwin >>=20 >=20 >=20 >=20 --------=0AThis message has been scanned by ComplianceSafe, powered by Palisade's PacketSure.=0A From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 17:24:57 2011 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 6828D1065670; Tue, 21 Jun 2011 17:24:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3D00C8FC17; Tue, 21 Jun 2011 17:24:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AA13846B23; Tue, 21 Jun 2011 13:24:56 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 491258A027; Tue, 21 Jun 2011 13:24:56 -0400 (EDT) From: John Baldwin To: Jack Vogel Date: Tue, 21 Jun 2011 13:24:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106202259.p5KMxT1h069297@svn.freebsd.org> <201106210907.18414.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201106211324.41214.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 21 Jun 2011 13:24:56 -0400 (EDT) Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223350 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 17:24:57 -0000 On Tuesday, June 21, 2011 12:07:23 pm Jack Vogel wrote: > LOL, the old adage is true, you just can't please all the people... :) > > The way the code now is it assigns a default, but you could still have > a loader entry that would change it for all adapters if you wanted to, > but ok, if you prefer the older for this. What other globals do you > think should be retained? I mostly care about the 'rxd', 'txd', 'rx_processing_limit', 'enable_aim', and 'num_queues'. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 17:59:51 2011 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 E9CDA1065693; Tue, 21 Jun 2011 17:59:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C200D8FC1D; Tue, 21 Jun 2011 17: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 p5LHxptB010734; Tue, 21 Jun 2011 17:59:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LHxpIm010731; Tue, 21 Jun 2011 17:59:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106211759.p5LHxpIm010731@svn.freebsd.org> From: Ed Schouten Date: Tue, 21 Jun 2011 17:59: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: r223367 - head/libexec/ulog-helper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 17:59:52 -0000 Author: ed Date: Tue Jun 21 17:59:51 2011 New Revision: 223367 URL: http://svn.freebsd.org/changeset/base/223367 Log: Minor cleanups to ulog-helper: - Remove unneeded linking against libmd. libulog depends on this library, but the ulog-helper tool itself does not. - Change the comment at the top to mention utmpx instead of utmp, wtmp and lastlog. - Simply use user_from_uid() to translate to a username string. - Put variable declarations together. Modified: head/libexec/ulog-helper/Makefile head/libexec/ulog-helper/ulog-helper.c Modified: head/libexec/ulog-helper/Makefile ============================================================================== --- head/libexec/ulog-helper/Makefile Tue Jun 21 14:31:36 2011 (r223366) +++ head/libexec/ulog-helper/Makefile Tue Jun 21 17:59:51 2011 (r223367) @@ -5,7 +5,7 @@ BINOWN= root BINMODE=4555 NO_MAN= -DPADD= ${LIBULOG} ${LIBMD} -LDADD= -lulog -lmd +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: head/libexec/ulog-helper/ulog-helper.c ============================================================================== --- head/libexec/ulog-helper/ulog-helper.c Tue Jun 21 14:31:36 2011 (r223366) +++ head/libexec/ulog-helper/ulog-helper.c Tue Jun 21 17:59:51 2011 (r223367) @@ -36,11 +36,11 @@ __FBSDID("$FreeBSD$"); /* * This setuid helper utility writes user login records to disk. - * Unprivileged processes are not capable of writing records to utmp, - * wtmp and lastlog, but we do want to allow this for pseudo-terminals. - * Because a file descriptor to a pseudo-terminal master device can only - * be obtained by processes using the pseudo-terminal, we expect such a - * descriptor on stdin. + * Unprivileged processes are not capable of writing records to utmpx, + * but we do want to allow this for pseudo-terminals. Because a file + * descriptor to a pseudo-terminal master device can only be obtained by + * processes using the pseudo-terminal, we expect such a descriptor on + * stdin. * * It uses the real user ID of the calling process to determine the * username. It does allow users to log arbitrary hostnames. @@ -49,26 +49,22 @@ __FBSDID("$FreeBSD$"); int main(int argc, char *argv[]) { - const char *line; + const char *line, *user, *host; /* Device line name. */ if ((line = ptsname(STDIN_FILENO)) == NULL) return (EX_USAGE); if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) { - struct passwd *pwd; - const char *host = NULL; - /* Username. */ - pwd = getpwuid(getuid()); - if (pwd == NULL) + user = user_from_uid(getuid(), 1); + if (user == NULL) return (EX_OSERR); /* Hostname. */ - if (argc == 3) - host = argv[2]; + host = argc == 3 ? argv[2] : NULL; - ulog_login(line, pwd->pw_name, host); + ulog_login(line, user, host); return (EX_OK); } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { ulog_logout(line); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 19:15:24 2011 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 3BF0E10656D0; Tue, 21 Jun 2011 19:15:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9B88FC0C; Tue, 21 Jun 2011 19:15: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 p5LJFOQ8013118; Tue, 21 Jun 2011 19:15:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJFOFN013116; Tue, 21 Jun 2011 19:15:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106211915.p5LJFOFN013116@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 19:15: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: r223369 - head/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, 21 Jun 2011 19:15:24 -0000 Author: marius Date: Tue Jun 21 19:15:23 2011 New Revision: 223369 URL: http://svn.freebsd.org/changeset/base/223369 Log: Change sparc64 to use the initial exec TLS model, too. This avoids random assertion failures in _malloc_thread_cleanup(). Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Tue Jun 21 19:13:48 2011 (r223368) +++ head/lib/libc/stdlib/malloc.c Tue Jun 21 19:15:23 2011 (r223369) @@ -234,7 +234,7 @@ __FBSDID("$FreeBSD$"); #ifdef __sparc64__ # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 -# define TLS_MODEL /* default */ +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __amd64__ # define LG_QUANTUM 4 From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 19:29:27 2011 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 EF4B910656EF; Tue, 21 Jun 2011 19:29:27 +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 DE1E58FC1D; Tue, 21 Jun 2011 19:29: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 p5LJTRUt013592; Tue, 21 Jun 2011 19:29:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJTRA5013589; Tue, 21 Jun 2011 19:29:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106211929.p5LJTRA5013589@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 19:29: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: r223370 - 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, 21 Jun 2011 19:29:28 -0000 Author: jhb Date: Tue Jun 21 19:29:27 2011 New Revision: 223370 URL: http://svn.freebsd.org/changeset/base/223370 Log: Use AcpiWalkResources() to parse the resource list from _CRS rather than using a home-rolled loop. While here, add support for 64-bit address range resources. Silence on: acpi@ (older version) Modified: head/sys/dev/acpica/acpi_resource.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:15:23 2011 (r223369) +++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 19:29:27 2011 (r223370) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,6 +140,248 @@ acpi_config_intr(device_t dev, ACPI_RESO INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } +struct acpi_resource_context { + struct acpi_parse_resource_set *set; + device_t dev; + void *context; +}; + +#ifdef ACPI_DEBUG_OUTPUT +static const char * +acpi_address_range_name(UINT8 ResourceType) +{ + static char buf[16]; + + switch (ResourceType) { + case ACPI_MEMORY_RANGE: + return ("Memory"); + case ACPI_IO_RANGE: + return ("IO"); + case ACPI_BUS_NUMBER_RANGE: + return ("Bus Number"); + default: + snprintf(buf, sizeof(buf), "type %u", ResourceType); + return (buf); + } +} +#endif + +static ACPI_STATUS +acpi_parse_resource(ACPI_RESOURCE *res, void *context) +{ + struct acpi_parse_resource_set *set; + struct acpi_resource_context *arc; + UINT64 min, max, length, gran; + const char *name; + device_t dev; + + arc = context; + dev = arc->dev; + set = arc->set; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_END_TAG: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); + break; + case ACPI_RESOURCE_TYPE_FIXED_IO: + if (res->Data.FixedIo.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", + res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, + res->Data.FixedIo.AddressLength); + break; + case ACPI_RESOURCE_TYPE_IO: + if (res->Data.Io.AddressLength <= 0) + break; + if (res->Data.Io.Minimum == res->Data.Io.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.AddressLength)); + set->set_ioport(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", + res->Data.Io.Minimum, res->Data.Io.Maximum, + res->Data.Io.AddressLength)); + set->set_iorange(dev, arc->context, res->Data.Io.Minimum, + res->Data.Io.Maximum, res->Data.Io.AddressLength, + res->Data.Io.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + if (res->Data.FixedMemory32.AddressLength <= 0) + break; + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", + res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, + res->Data.FixedMemory32.AddressLength); + break; + case ACPI_RESOURCE_TYPE_MEMORY32: + if (res->Data.Memory32.AddressLength <= 0) + break; + if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", + res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, + res->Data.Memory32.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, + res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, + res->Data.Memory32.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_MEMORY24: + if (res->Data.Memory24.AddressLength <= 0) + break; + if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength)); + set->set_memory(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.AddressLength); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", + res->Data.Memory24.Minimum, res->Data.Memory24.Maximum, + res->Data.Memory24.AddressLength)); + set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum, + res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength, + res->Data.Memory24.Alignment); + } + break; + case ACPI_RESOURCE_TYPE_IRQ: + /* + * from 1.0b 6.4.2 + * "This structure is repeated for each separate interrupt + * required" + */ + set->set_irq(dev, arc->context, res->Data.Irq.Interrupts, + res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, + res->Data.Irq.Polarity); + break; + case ACPI_RESOURCE_TYPE_DMA: + /* + * from 1.0b 6.4.3 + * "This structure is repeated for each separate DMA channel + * required" + */ + set->set_drq(dev, arc->context, res->Data.Dma.Channels, + res->Data.Dma.ChannelCount); + break; + case ACPI_RESOURCE_TYPE_START_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n")); + set->set_start_dependent(dev, arc->context, + res->Data.StartDpf.CompatibilityPriority); + break; + case ACPI_RESOURCE_TYPE_END_DEPENDENT: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n")); + set->set_end_dependent(dev, arc->context); + break; + case ACPI_RESOURCE_TYPE_ADDRESS16: + case ACPI_RESOURCE_TYPE_ADDRESS32: + case ACPI_RESOURCE_TYPE_ADDRESS64: + case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64: + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS16: + gran = res->Data.Address16.Granularity; + min = res->Data.Address16.Minimum; + max = res->Data.Address16.Maximum; + length = res->Data.Address16.AddressLength; + name = "Address16"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS32: + gran = res->Data.Address32.Granularity; + min = res->Data.Address32.Minimum; + max = res->Data.Address32.Maximum; + length = res->Data.Address32.AddressLength; + name = "Address32"; + break; + case ACPI_RESOURCE_TYPE_ADDRESS64: + gran = res->Data.Address64.Granularity; + min = res->Data.Address64.Minimum; + max = res->Data.Address64.Maximum; + length = res->Data.Address64.AddressLength; + name = "Address64"; + break; + default: + KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, + ("should never happen")); + gran = res->Data.ExtAddress64.Granularity; + min = res->Data.ExtAddress64.Minimum; + max = res->Data.ExtAddress64.Maximum; + length = res->Data.ExtAddress64.AddressLength; + name = "ExtAddress64"; + break; + } + if (length <= 0) + break; + if (res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s %s producer\n", name, + acpi_address_range_name(res->Data.Address.ResourceType))); + break; + } + if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE && + res->Data.Address.ResourceType != ACPI_IO_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "ignored %s for non-memory, non-I/O\n", name)); + break; + } + +#ifdef __i386__ + if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max > + ULONG_MAX)) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s above 4G\n", + name)); + break; + } + if (max > ULONG_MAX) + max = ULONG_MAX; +#endif + if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && + res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { + if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", + name, min, length)); + set->set_memory(dev, arc->context, min, length); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, + min, length)); + set->set_ioport(dev, arc->context, min, length); + } + } else { + if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", + name, min, max, length)); + set->set_memoryrange(dev, arc->context, min, max, length, gran); + } else { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", + name, min, max, length)); + set->set_iorange(dev, arc->context, min, max, length, gran); + } + } + break; + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: + if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored ExtIRQ producer\n")); + break; + } + set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts, + res->Data.ExtendedIrq.InterruptCount, + res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity); + break; + case ACPI_RESOURCE_TYPE_VENDOR: + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "unimplemented VendorSpecific resource\n")); + break; + default: + break; + } + return (AE_OK); +} + /* * Fetch a device's resources and associate them with the device. * @@ -153,318 +396,21 @@ ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle, struct acpi_parse_resource_set *set, void *arg) { - ACPI_BUFFER buf; - ACPI_RESOURCE *res; - char *curr, *last; + struct acpi_resource_context arc; ACPI_STATUS status; - void *context; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - /* - * Special-case some devices that abuse _PRS/_CRS to mean - * something other than "I consume this resource". - * - * XXX do we really need this? It's only relevant once - * we start always-allocating these resources, and even - * then, the only special-cased device is likely to be - * the PCI interrupt link. - */ - - /* Fetch the device's current resources. */ - buf.Length = ACPI_ALLOCATE_BUFFER; - if (ACPI_FAILURE((status = AcpiGetCurrentResources(handle, &buf)))) { - if (status != AE_NOT_FOUND && status != AE_TYPE) - printf("can't fetch resources for %s - %s\n", - acpi_name(handle), AcpiFormatException(status)); + set->set_init(dev, arg, &arc.context); + arc.set = set; + arc.dev = dev; + status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + printf("can't fetch resources for %s - %s\n", + acpi_name(handle), AcpiFormatException(status)); return_ACPI_STATUS (status); } - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s - got %ld bytes of resources\n", - acpi_name(handle), (long)buf.Length)); - set->set_init(dev, arg, &context); - - /* Iterate through the resources */ - curr = buf.Pointer; - last = (char *)buf.Pointer + buf.Length; - while (curr < last) { - res = (ACPI_RESOURCE *)curr; - curr += res->Length; - - /* Handle the individual resource types */ - switch(res->Type) { - case ACPI_RESOURCE_TYPE_END_TAG: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "EndTag\n")); - curr = last; - break; - case ACPI_RESOURCE_TYPE_FIXED_IO: - if (res->Data.FixedIo.AddressLength <= 0) - break; - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedIo 0x%x/%d\n", - res->Data.FixedIo.Address, - res->Data.FixedIo.AddressLength)); - set->set_ioport(dev, context, - res->Data.FixedIo.Address, - res->Data.FixedIo.AddressLength); - break; - case ACPI_RESOURCE_TYPE_IO: - if (res->Data.Io.AddressLength <= 0) - break; - if (res->Data.Io.Minimum == res->Data.Io.Maximum) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x/%d\n", - res->Data.Io.Minimum, - res->Data.Io.AddressLength)); - set->set_ioport(dev, context, - res->Data.Io.Minimum, - res->Data.Io.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", - res->Data.Io.Minimum, - res->Data.Io.Maximum, - res->Data.Io.AddressLength)); - set->set_iorange(dev, context, - res->Data.Io.Minimum, - res->Data.Io.Maximum, - res->Data.Io.AddressLength, - res->Data.Io.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: - if (res->Data.FixedMemory32.AddressLength <= 0) - break; - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "FixedMemory32 0x%x/%d\n", - res->Data.FixedMemory32.Address, - res->Data.FixedMemory32.AddressLength)); - set->set_memory(dev, context, - res->Data.FixedMemory32.Address, - res->Data.FixedMemory32.AddressLength); - break; - case ACPI_RESOURCE_TYPE_MEMORY32: - if (res->Data.Memory32.AddressLength <= 0) - break; - if (res->Data.Memory32.Minimum == - res->Data.Memory32.Maximum) { - - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x/%d\n", - res->Data.Memory32.Minimum, - res->Data.Memory32.AddressLength)); - set->set_memory(dev, context, - res->Data.Memory32.Minimum, - res->Data.Memory32.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", - res->Data.Memory32.Minimum, - res->Data.Memory32.Maximum, - res->Data.Memory32.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Memory32.Minimum, - res->Data.Memory32.Maximum, - res->Data.Memory32.AddressLength, - res->Data.Memory32.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_MEMORY24: - if (res->Data.Memory24.AddressLength <= 0) - break; - if (res->Data.Memory24.Minimum == - res->Data.Memory24.Maximum) { - - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x/%d\n", - res->Data.Memory24.Minimum, - res->Data.Memory24.AddressLength)); - set->set_memory(dev, context, res->Data.Memory24.Minimum, - res->Data.Memory24.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", - res->Data.Memory24.Minimum, - res->Data.Memory24.Maximum, - res->Data.Memory24.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Memory24.Minimum, - res->Data.Memory24.Maximum, - res->Data.Memory24.AddressLength, - res->Data.Memory24.Alignment); - } - break; - case ACPI_RESOURCE_TYPE_IRQ: - /* - * from 1.0b 6.4.2 - * "This structure is repeated for each separate interrupt - * required" - */ - set->set_irq(dev, context, res->Data.Irq.Interrupts, - res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, - res->Data.Irq.Polarity); - break; - case ACPI_RESOURCE_TYPE_DMA: - /* - * from 1.0b 6.4.3 - * "This structure is repeated for each separate dma channel - * required" - */ - set->set_drq(dev, context, res->Data.Dma.Channels, - res->Data.Dma.ChannelCount); - break; - case ACPI_RESOURCE_TYPE_START_DEPENDENT: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "start dependent functions\n")); - set->set_start_dependent(dev, context, - res->Data.StartDpf.CompatibilityPriority); - break; - case ACPI_RESOURCE_TYPE_END_DEPENDENT: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "end dependent functions\n")); - set->set_end_dependent(dev, context); - break; - case ACPI_RESOURCE_TYPE_ADDRESS32: - if (res->Data.Address32.AddressLength <= 0) - break; - if (res->Data.Address32.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address32 %s producer\n", - res->Data.Address32.ResourceType == ACPI_IO_RANGE ? - "IO" : "Memory")); - break; - } - if (res->Data.Address32.ResourceType != ACPI_MEMORY_RANGE && - res->Data.Address32.ResourceType != ACPI_IO_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address32 for non-memory, non-I/O\n")); - break; - } - - if (res->Data.Address32.MinAddressFixed == ACPI_ADDRESS_FIXED && - res->Data.Address32.MaxAddressFixed == ACPI_ADDRESS_FIXED) { - - if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/Memory 0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength)); - set->set_memory(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/IO 0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength)); - set->set_ioport(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.AddressLength); - } - } else { - if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/Memory 0x%x-0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength, - res->Data.Address32.Granularity); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address32/IO 0x%x-0x%x/%d\n", - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength)); - set->set_iorange(dev, context, - res->Data.Address32.Minimum, - res->Data.Address32.Maximum, - res->Data.Address32.AddressLength, - res->Data.Address32.Granularity); - } - } - break; - case ACPI_RESOURCE_TYPE_ADDRESS16: - if (res->Data.Address16.AddressLength <= 0) - break; - if (res->Data.Address16.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address16 %s producer\n", - res->Data.Address16.ResourceType == ACPI_IO_RANGE ? - "IO" : "Memory")); - break; - } - if (res->Data.Address16.ResourceType != ACPI_MEMORY_RANGE && - res->Data.Address16.ResourceType != ACPI_IO_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored Address16 for non-memory, non-I/O\n")); - break; - } - - if (res->Data.Address16.MinAddressFixed == ACPI_ADDRESS_FIXED && - res->Data.Address16.MaxAddressFixed == ACPI_ADDRESS_FIXED) { - - if (res->Data.Address16.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/Memory 0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength)); - set->set_memory(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/IO 0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength)); - set->set_ioport(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.AddressLength); - } - } else { - if (res->Data.Address16.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/Memory 0x%x-0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength)); - set->set_memoryrange(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength, - res->Data.Address16.Granularity); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "Address16/IO 0x%x-0x%x/%d\n", - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength)); - set->set_iorange(dev, context, - res->Data.Address16.Minimum, - res->Data.Address16.Maximum, - res->Data.Address16.AddressLength, - res->Data.Address16.Granularity); - } - } - break; - case ACPI_RESOURCE_TYPE_ADDRESS64: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "unimplemented Address64 resource\n")); - break; - case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: - if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "ignored ExtIRQ producer\n")); - break; - } - set->set_ext_irq(dev, context, res->Data.ExtendedIrq.Interrupts, - res->Data.ExtendedIrq.InterruptCount, - res->Data.ExtendedIrq.Triggering, - res->Data.ExtendedIrq.Polarity); - break; - case ACPI_RESOURCE_TYPE_VENDOR: - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, - "unimplemented VendorSpecific resource\n")); - break; - default: - break; - } - } - - AcpiOsFree(buf.Pointer); - set->set_done(dev, context); + set->set_done(dev, arc.context); return_ACPI_STATUS (AE_OK); } @@ -475,20 +421,20 @@ acpi_parse_resources(device_t dev, ACPI_ static void acpi_res_set_init(device_t dev, void *arg, void **context); static void acpi_res_set_done(device_t dev, void *context); static void acpi_res_set_ioport(device_t dev, void *context, - u_int32_t base, u_int32_t length); + uint64_t base, uint64_t length); static void acpi_res_set_iorange(device_t dev, void *context, - u_int32_t low, u_int32_t high, - u_int32_t length, u_int32_t align); + uint64_t low, uint64_t high, + uint64_t length, uint64_t align); static void acpi_res_set_memory(device_t dev, void *context, - u_int32_t base, u_int32_t length); + uint64_t base, uint64_t length); static void acpi_res_set_memoryrange(device_t dev, void *context, - u_int32_t low, u_int32_t high, - u_int32_t length, u_int32_t align); -static void acpi_res_set_irq(device_t dev, void *context, u_int8_t *irq, + uint64_t low, uint64_t high, + uint64_t length, uint64_t align); +static void acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol); static void acpi_res_set_ext_irq(device_t dev, void *context, - u_int32_t *irq, int count, int trig, int pol); -static void acpi_res_set_drq(device_t dev, void *context, u_int8_t *drq, + uint32_t *irq, int count, int trig, int pol); +static void acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count); static void acpi_res_set_start_dependent(device_t dev, void *context, int preference); @@ -539,8 +485,8 @@ acpi_res_set_done(device_t dev, void *co } static void -acpi_res_set_ioport(device_t dev, void *context, u_int32_t base, - u_int32_t length) +acpi_res_set_ioport(device_t dev, void *context, uint64_t base, + uint64_t length) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -550,8 +496,8 @@ acpi_res_set_ioport(device_t dev, void * } static void -acpi_res_set_iorange(device_t dev, void *context, u_int32_t low, - u_int32_t high, u_int32_t length, u_int32_t align) +acpi_res_set_iorange(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -561,8 +507,8 @@ acpi_res_set_iorange(device_t dev, void } static void -acpi_res_set_memory(device_t dev, void *context, u_int32_t base, - u_int32_t length) +acpi_res_set_memory(device_t dev, void *context, uint64_t base, + uint64_t length) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -573,8 +519,8 @@ acpi_res_set_memory(device_t dev, void * } static void -acpi_res_set_memoryrange(device_t dev, void *context, u_int32_t low, - u_int32_t high, u_int32_t length, u_int32_t align) +acpi_res_set_memoryrange(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -584,7 +530,7 @@ acpi_res_set_memoryrange(device_t dev, v } static void -acpi_res_set_irq(device_t dev, void *context, u_int8_t *irq, int count, +acpi_res_set_irq(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -600,7 +546,7 @@ acpi_res_set_irq(device_t dev, void *con } static void -acpi_res_set_ext_irq(device_t dev, void *context, u_int32_t *irq, int count, +acpi_res_set_ext_irq(device_t dev, void *context, uint32_t *irq, int count, int trig, int pol) { struct acpi_res_context *cp = (struct acpi_res_context *)context; @@ -616,7 +562,7 @@ acpi_res_set_ext_irq(device_t dev, void } static void -acpi_res_set_drq(device_t dev, void *context, u_int8_t *drq, int count) +acpi_res_set_drq(device_t dev, void *context, uint8_t *drq, int count) { struct acpi_res_context *cp = (struct acpi_res_context *)context; Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Tue Jun 21 19:15:23 2011 (r223369) +++ head/sys/dev/acpica/acpivar.h Tue Jun 21 19:29:27 2011 (r223370) @@ -355,19 +355,19 @@ BOOLEAN acpi_MatchHid(ACPI_HANDLE h, co struct acpi_parse_resource_set { void (*set_init)(device_t dev, void *arg, void **context); void (*set_done)(device_t dev, void *context); - void (*set_ioport)(device_t dev, void *context, uint32_t base, - uint32_t length); - void (*set_iorange)(device_t dev, void *context, uint32_t low, - uint32_t high, uint32_t length, uint32_t align); - void (*set_memory)(device_t dev, void *context, uint32_t base, - uint32_t length); - void (*set_memoryrange)(device_t dev, void *context, uint32_t low, - uint32_t high, uint32_t length, uint32_t align); - void (*set_irq)(device_t dev, void *context, u_int8_t *irq, + void (*set_ioport)(device_t dev, void *context, uint64_t base, + uint64_t length); + void (*set_iorange)(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align); + void (*set_memory)(device_t dev, void *context, uint64_t base, + uint64_t length); + void (*set_memoryrange)(device_t dev, void *context, uint64_t low, + uint64_t high, uint64_t length, uint64_t align); + void (*set_irq)(device_t dev, void *context, uint8_t *irq, int count, int trig, int pol); - void (*set_ext_irq)(device_t dev, void *context, u_int32_t *irq, + void (*set_ext_irq)(device_t dev, void *context, uint32_t *irq, int count, int trig, int pol); - void (*set_drq)(device_t dev, void *context, u_int8_t *drq, + void (*set_drq)(device_t dev, void *context, uint8_t *drq, int count); void (*set_start_dependent)(device_t dev, void *context, int preference); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 19:31:32 2011 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 0061D10656A9; Tue, 21 Jun 2011 19:31: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 E52E38FC14; Tue, 21 Jun 2011 19:31: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 p5LJVVei013695; Tue, 21 Jun 2011 19:31:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJVVI5013693; Tue, 21 Jun 2011 19:31:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106211931.p5LJVVI5013693@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 19:31: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: r223371 - 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: Tue, 21 Jun 2011 19:31:32 -0000 Author: jhb Date: Tue Jun 21 19:31:31 2011 New Revision: 223371 URL: http://svn.freebsd.org/changeset/base/223371 Log: Minor whitespace and style fixes. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jun 21 19:29:27 2011 (r223370) +++ head/sys/dev/pci/pci.c Tue Jun 21 19:31:31 2011 (r223371) @@ -297,7 +297,7 @@ static int pci_usb_takeover = 1; static int pci_usb_takeover = 0; #endif TUNABLE_INT("hw.pci.usb_early_takeover", &pci_usb_takeover); -SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RD | CTLFLAG_TUN, +SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); @@ -2482,7 +2482,8 @@ pci_write_bar(device_t dev, struct pci_m pci_write_config(dev, pm->pm_reg + 4, base >> 32, 4); pm->pm_value = pci_read_config(dev, pm->pm_reg, 4); if (ln2range == 64) - pm->pm_value |= (pci_addr_t)pci_read_config(dev, pm->pm_reg + 4, 4) << 32; + pm->pm_value |= (pci_addr_t)pci_read_config(dev, + pm->pm_reg + 4, 4) << 32; } struct pci_map * @@ -2680,7 +2681,7 @@ pci_add_map(device_t bus, device_t dev, count = (pci_addr_t)1 << mapsize; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ - end = ~0ULL; + end = ~0ul; } else { start = base; end = base + count - 1; From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 19:34:57 2011 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 8329D106566C; Tue, 21 Jun 2011 19:34:57 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5FE8FC0C; Tue, 21 Jun 2011 19:34: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 p5LJYvoB013840; Tue, 21 Jun 2011 19:34:57 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJYvsP013837; Tue, 21 Jun 2011 19:34:57 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201106211934.p5LJYvsP013837@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 21 Jun 2011 19:34: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: r223372 - head/bin/realpath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 19:34:57 -0000 Author: ru Date: Tue Jun 21 19:34:57 2011 New Revision: 223372 URL: http://svn.freebsd.org/changeset/base/223372 Log: Make ``realpath'' behave like ``realpath .''. Modified: head/bin/realpath/realpath.1 head/bin/realpath/realpath.c Modified: head/bin/realpath/realpath.1 ============================================================================== --- head/bin/realpath/realpath.1 Tue Jun 21 19:31:31 2011 (r223371) +++ head/bin/realpath/realpath.1 Tue Jun 21 19:34:57 2011 (r223372) @@ -33,7 +33,7 @@ .\" From: src/bin/pwd/pwd.1,v 1.11 2000/11/20 11:39:39 ru Exp .\" $FreeBSD$ .\" -.Dd November 24, 2000 +.Dd June 21, 2011 .Dt REALPATH 1 .Os .Sh NAME @@ -42,8 +42,7 @@ .Sh SYNOPSIS .Nm .Op Fl q -.Ar path -.Op Ar ... +.Op Ar path ... .Sh DESCRIPTION The .Nm @@ -57,6 +56,11 @@ and .Pa /../ in .Ar path . +If +.Ar path +is absent, the current working directory +.Pq Sq Pa .\& +is assumed. .Pp If .Fl q Modified: head/bin/realpath/realpath.c ============================================================================== --- head/bin/realpath/realpath.c Tue Jun 21 19:31:31 2011 (r223371) +++ head/bin/realpath/realpath.c Tue Jun 21 19:34:57 2011 (r223372) @@ -44,7 +44,8 @@ main(int argc, char *argv[]) { char buf[PATH_MAX]; char *p; - int ch, i, qflag, rval; + const char *path; + int ch, qflag, rval; qflag = 0; while ((ch = getopt(argc, argv, "q")) != -1) { @@ -59,17 +60,16 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 1) - usage(); + path = *argv != NULL ? *argv++ : "."; rval = 0; - for (i = 0; i < argc; i++) { - if ((p = realpath(argv[i], buf)) == NULL) { + do { + if ((p = realpath(path, buf)) == NULL) { if (!qflag) - warn("%s", argv[i]); + warn("%s", path); rval = 1; } else (void)printf("%s\n", p); - } + } while ((path = *argv++) != NULL); exit(rval); } @@ -77,6 +77,6 @@ static void usage(void) { - (void)fprintf(stderr, "usage: realpath [-q] path [...]\n"); + (void)fprintf(stderr, "usage: realpath [-q] [path ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 19:58:30 2011 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 2042D106568A; Tue, 21 Jun 2011 19:58:30 +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 108F98FC1B; Tue, 21 Jun 2011 19:58: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 p5LJwTLZ014585; Tue, 21 Jun 2011 19:58:29 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LJwTlM014583; Tue, 21 Jun 2011 19:58:29 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106211958.p5LJwTlM014583@svn.freebsd.org> From: Rick Macklem Date: Tue, 21 Jun 2011 19:58: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: r223373 - head/sys/fs/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: Tue, 21 Jun 2011 19:58:30 -0000 Author: rmacklem Date: Tue Jun 21 19:58:29 2011 New Revision: 223373 URL: http://svn.freebsd.org/changeset/base/223373 Log: Fix the new NFSv4 server so that it checks for VREAD_ACL when a client does a Getattr for an ACL and not VREAD_ATTRIBUTES. This was found during the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 19:34:57 2011 (r223372) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Tue Jun 21 19:58:29 2011 (r223373) @@ -172,11 +172,12 @@ nfsrvd_getattr(struct nfsrv_descript *nd fhandle_t fh; int at_root = 0, error = 0, supports_nfsv4acls; struct nfsreferral *refp; - nfsattrbit_t attrbits; + nfsattrbit_t attrbits, tmpbits; struct mount *mp; struct vnode *tvp = NULL; struct vattr va; uint64_t mounted_on_fileno = 0; + accmode_t accmode; if (nd->nd_repstat) return (0); @@ -197,11 +198,20 @@ nfsrvd_getattr(struct nfsrv_descript *nd vput(vp); return (0); } - if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, - VREAD_ATTRIBUTES, - nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, - NFSACCCHK_VPISLOCKED, NULL); + if (nd->nd_repstat == 0) { + accmode = 0; + NFSSET_ATTRBIT(&tmpbits, &attrbits); + if (NFSISSET_ATTRBIT(&tmpbits, NFSATTRBIT_ACL)) { + NFSCLRBIT_ATTRBIT(&tmpbits, NFSATTRBIT_ACL); + accmode |= VREAD_ACL; + } + if (NFSNONZERO_ATTRBIT(&tmpbits)) + accmode |= VREAD_ATTRIBUTES; + if (accmode != 0) + nd->nd_repstat = nfsvno_accchk(vp, accmode, + nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, + NFSACCCHK_VPISLOCKED, NULL); + } } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:28:04 2011 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 B40F11065690; Tue, 21 Jun 2011 20:28:04 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 549D38FC12; Tue, 21 Jun 2011 20:28:04 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 287A4359388; Tue, 21 Jun 2011 22:28:03 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 1F01F17443; Tue, 21 Jun 2011 22:28:03 +0200 (CEST) Date: Tue, 21 Jun 2011 22:28:03 +0200 From: Jilles Tjoelker To: Ruslan Ermilov Message-ID: <20110621202802.GA28834@stack.nl> References: <201106211934.p5LJYvsP013837@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106211934.p5LJYvsP013837@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: r223372 - head/bin/realpath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:28:04 -0000 On Tue, Jun 21, 2011 at 07:34:57PM +0000, Ruslan Ermilov wrote: > Author: ru > Date: Tue Jun 21 19:34:57 2011 > New Revision: 223372 > URL: http://svn.freebsd.org/changeset/base/223372 > Log: > Make ``realpath'' behave like ``realpath .''. Is this being added for compatibility with something? If not, why do we need this non-standard extension if the shorter and standard pwd -P already fulfills this function? -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:30:46 2011 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 F388B10656ED; Tue, 21 Jun 2011 20:30:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9408FC16; Tue, 21 Jun 2011 20:30:45 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E64A625D386D; Tue, 21 Jun 2011 20:30:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 3280515A2310; Tue, 21 Jun 2011 20:30:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id e5Yt7OjTz20U; Tue, 21 Jun 2011 20:30:40 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 435A715A230E; Tue, 21 Jun 2011 20:30:40 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106191913.p5JJDOqJ006272@svn.freebsd.org> Date: Tue, 21 Jun 2011 20:30:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> To: Alan Cox X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 20:30:46 -0000 On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: Hi Alan, > Author: alc > Date: Sun Jun 19 19:13:24 2011 > New Revision: 223307 > URL: http://svn.freebsd.org/changeset/base/223307 >=20 > Log: > Precisely document the synchronization rules for the page's dirty = field. > (Saying that the lock on the object that the page belongs to must be = held > only represents one aspect of the rules.) >=20 > Eliminate the use of the page queues lock for atomically performing = read- > modify-write operations on the dirty field when the underlying = architecture > supports atomic operations on char and short types. >=20 > Document the fact that 32KB pages aren't really supported. >=20 contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. Could = you please check and see if you can fix it? The errors I get are: vm_page.o: In function `vm_page_clear_dirty': /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 = against `atomic_clear_8' vm_page.o: In function `vm_page_set_validclean': /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 = against `atomic_clear_8' Thanks a lot! /bz > Reviewed by: attilio, kib >=20 > Modified: > head/sys/vm/vm_fault.c > head/sys/vm/vm_page.c > head/sys/vm/vm_page.h >=20 > Modified: head/sys/vm/vm_fault.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/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 = (r223307) > @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,=20 > * caller's changes may go unnoticed because = they are > * performed through an unmanaged mapping or by = a DMA > * operation. > + * > + * The object lock is not held here. Therefore, = like > + * a pmap operation, the page queues lock may be > + * required in order to call vm_page_dirty(). = See > + * vm_page_clear_dirty_mask(). > */ > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + defined(__mips__) > + vm_page_dirty(*mp); > +#else > vm_page_lock_queues(); > vm_page_dirty(*mp); > vm_page_unlock_queues(); > +#endif > } > } > if (pmap_failed) { >=20 > Modified: head/sys/vm/vm_page.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/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 = (r223307) > @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m > /* > * vm_page_dirty: > * > - * make page all dirty > + * Set all bits in the page's dirty field. > + * > + * The object containing the specified page must be locked if the = call is > + * made from the machine-independent layer. If, however, the call = is > + * made from the pmap layer, then the page queues lock may be = required. > + * See vm_page_clear_dirty_mask(). > */ > void > vm_page_dirty(vm_page_t m) > @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in > /* > * If the object is locked and the page is neither VPO_BUSY nor > * PG_WRITEABLE, then the page's dirty field cannot possibly be > - * modified by a concurrent pmap operation.=20 > + * set by a concurrent pmap operation.=20 > */ > VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); > if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRITEABLE) = =3D=3D 0) > m->dirty &=3D ~pagebits; > else { > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + defined(__mips__) > + /* > + * On the aforementioned architectures, the page queues = lock > + * is not required by the following read-modify-write > + * operation. The combination of the object's lock and = an > + * atomic operation suffice. Moreover, the pmap layer = on > + * these architectures can call vm_page_dirty() without > + * holding the page queues lock. > + */ > +#if PAGE_SIZE =3D=3D 4096 > + atomic_clear_char(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 8192 > + atomic_clear_short(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 16384 > + atomic_clear_int(&m->dirty, pagebits); > +#else > +#error "PAGE_SIZE is not supported." > +#endif > +#else > + /* > + * Otherwise, the page queues lock is required to ensure = that > + * a concurrent pmap operation does not set the page's = dirty > + * field during the following read-modify-write = operation. > + */ > vm_page_lock_queues(); > m->dirty &=3D ~pagebits; > vm_page_unlock_queues(); > +#endif > } > } >=20 >=20 > Modified: head/sys/vm/vm_page.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 = (r223306) > +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 = (r223307) > @@ -89,10 +89,26 @@ > * and offset to which this page belongs (for pageout), > * and sundry status bits. > * > - * Fields in this structure are locked either by the lock on the > - * object that the page belongs to (O), its corresponding page lock = (P), > - * or by the lock on the page queues (Q). > - *=09 > + * In general, operations on this structure's mutable fields are > + * synchronized using either one of or a combination of the lock on = the > + * object that the page belongs to (O), the pool lock for the page = (P), > + * or the lock for either the free or paging queues (Q). If a = field is > + * annotated below with two of these locks, then holding either = lock is > + * sufficient for read access, but both locks are required for = write=20 > + * access. > + * > + * In contrast, the synchronization of accesses to the page's dirty = field > + * is machine dependent (M). In the machine-independent layer, the = lock > + * on the object that the page belongs to must be held in order to > + * operate on the field. However, the pmap layer is permitted to = set > + * all bits within the field without holding that lock. Therefore, = if > + * the underlying architecture does not support atomic = read-modify-write > + * operations on the field's type, then the machine-independent = layer > + * must also hold the page queues lock when performing = read-modify-write > + * operations and the pmap layer must hold the page queues lock = when > + * setting the field. In the machine-independent layer, the > + * implementation of read-modify-write operations on the field is > + * encapsulated in vm_page_clear_dirty_mask(). > */ >=20 > TAILQ_HEAD(pglist, vm_page); > @@ -120,18 +136,19 @@ struct vm_page { > u_char busy; /* page busy count (O) */ > /* NOTE that these must support one bit per DEV_BSIZE in a = page!!! */ > /* so, on normal X86 kernels, they must be at least 8 bits wide = */ > + /* In reality, support for 32KB pages is not fully implemented. = */ > #if PAGE_SIZE =3D=3D 4096 > u_char valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_char dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_char dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 8192 > u_short valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_short dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_short dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 16384 > u_int valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_int dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_int dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #elif PAGE_SIZE =3D=3D 32768 > u_long valid; /* map of valid DEV_BSIZE chunks = (O) */ > - u_long dirty; /* map of dirty DEV_BSIZE chunks = (O) */ > + u_long dirty; /* map of dirty DEV_BSIZE chunks = (M) */ > #endif > }; >=20 --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:33:55 2011 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 9C4C910656F8; Tue, 21 Jun 2011 20:33: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 8CE4D8FC12; Tue, 21 Jun 2011 20:33: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 p5LKXt9U015729; Tue, 21 Jun 2011 20:33:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKXtng015727; Tue, 21 Jun 2011 20:33:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212033.p5LKXtng015727@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:33: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: r223374 - head/usr.bin/finger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:33:55 -0000 Author: delphij Date: Tue Jun 21 20:33:55 2011 New Revision: 223374 URL: http://svn.freebsd.org/changeset/base/223374 Log: Staticify cleanup() which is not referenced in other places. MFC after: 2 weeks Modified: head/usr.bin/finger/net.c Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Tue Jun 21 19:58:29 2011 (r223373) +++ head/usr.bin/finger/net.c Tue Jun 21 20:33:55 2011 (r223374) @@ -226,7 +226,7 @@ trying(const struct addrinfo *ai) printf("Trying %s...\n", buf); } -void +static void cleanup(int sig __unused) { #define ERRSTR "Timed out.\n" From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:36:11 2011 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 2516B10656D6; Tue, 21 Jun 2011 20:36:11 +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 15D738FC19; Tue, 21 Jun 2011 20:36: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 p5LKaA4b015827; Tue, 21 Jun 2011 20:36:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKaAeF015824; Tue, 21 Jun 2011 20:36:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212036.p5LKaAeF015824@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:36: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: r223375 - head/usr.bin/lastcomm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:36:11 -0000 Author: delphij Date: Tue Jun 21 20:36:10 2011 New Revision: 223375 URL: http://svn.freebsd.org/changeset/base/223375 Log: Remove unneeded headers. MFC after: 2 weeks Modified: head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/readrec.c Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Tue Jun 21 20:33:55 2011 (r223374) +++ head/usr.bin/lastcomm/lastcomm.c Tue Jun 21 20:36:10 2011 (r223375) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include Modified: head/usr.bin/lastcomm/readrec.c ============================================================================== --- head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:33:55 2011 (r223374) +++ head/usr.bin/lastcomm/readrec.c Tue Jun 21 20:36:10 2011 (r223375) @@ -33,13 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include #include #include -#include #include int readrec_forward(FILE *f, struct acctv2 *av2); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:44:07 2011 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 24B5D10656A8; Tue, 21 Jun 2011 20:44:07 +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 1548F8FC14; Tue, 21 Jun 2011 20:44: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 p5LKi6vW016091; Tue, 21 Jun 2011 20:44:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKi6ep016088; Tue, 21 Jun 2011 20:44:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106212044.p5LKi6ep016088@svn.freebsd.org> From: Xin LI Date: Tue, 21 Jun 2011 20:44: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: r223376 - head/usr.bin/cmp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:44:07 -0000 Author: delphij Date: Tue Jun 21 20:44:06 2011 New Revision: 223376 URL: http://svn.freebsd.org/changeset/base/223376 Log: Eliminate unneeded headers. Modified: head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Tue Jun 21 20:36:10 2011 (r223375) +++ head/usr.bin/cmp/regular.c Tue Jun 21 20:44:06 2011 (r223376) @@ -41,12 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include "extern.h" Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Tue Jun 21 20:36:10 2011 (r223375) +++ head/usr.bin/cmp/special.c Tue Jun 21 20:44:06 2011 (r223376) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "extern.h" From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:44:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id CE02F1065689; Tue, 21 Jun 2011 20:44:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 21 Jun 2011 16:44:18 -0400 User-Agent: KMail/1.6.2 References: <201106211929.p5LJTRA5013589@svn.freebsd.org> In-Reply-To: <201106211929.p5LJTRA5013589@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_lKQAOuKuA7Ph73B" Message-Id: <201106211644.21026.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r223370 - 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, 21 Jun 2011 20:44:35 -0000 --Boundary-00=_lKQAOuKuA7Ph73B Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 21 June 2011 03:29 pm, John Baldwin wrote: > Author: jhb > Date: Tue Jun 21 19:29:27 2011 > New Revision: 223370 > URL: http://svn.freebsd.org/changeset/base/223370 > > Log: > Use AcpiWalkResources() to parse the resource list from _CRS > rather than using a home-rolled loop. While here, add support for > 64-bit address range resources. This broke build with ACPI_DEBUG. The attached patch should fix it. > Silence on: acpi@ (older version) Sorry, I am quite busy at $work recently. :-( Jung-uk Kim --Boundary-00=_lKQAOuKuA7Ph73B Content-Type: text/plain; charset="iso-8859-1"; name="acpi_resource.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="acpi_resource.diff" Index: sys/dev/acpica/acpi_resource.c =================================================================== --- sys/dev/acpica/acpi_resource.c (revision 223372) +++ sys/dev/acpica/acpi_resource.c (working copy) @@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *cont if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", - name, min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)length)); set->set_memory(dev, arc->context, min, length); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, - min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name, + (uintmax_t)min, (uintmax_t)length)); set->set_ioport(dev, arc->context, min, length); } } else { if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, + (uintmax_t)max, (uintmax_t)length)); set->set_memoryrange(dev, arc->context, min, max, length, gran); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length)); set->set_iorange(dev, arc->context, min, max, length, gran); } } --Boundary-00=_lKQAOuKuA7Ph73B-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:47:04 2011 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 32978106572F; Tue, 21 Jun 2011 20:47:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22A878FC29; Tue, 21 Jun 2011 20:47: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 p5LKl4eb016224; Tue, 21 Jun 2011 20:47:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKl4jK016221; Tue, 21 Jun 2011 20:47:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212047.p5LKl4jK016221@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:47: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: r223377 - head/sys/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: Tue, 21 Jun 2011 20:47:04 -0000 Author: marius Date: Tue Jun 21 20:47:03 2011 New Revision: 223377 URL: http://svn.freebsd.org/changeset/base/223377 Log: On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space increase the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:44:06 2011 (r223376) +++ head/sys/sparc64/sparc64/pmap.c Tue Jun 21 20:47:03 2011 (r223377) @@ -384,11 +384,12 @@ pmap_bootstrap(u_int cpu_impl) * public documentation is available for these, the latter just might * not support it, yet. */ - virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) + cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) { tsb_kernel_ldd_phys = 1; - else { + virtsz = roundup(5 / 3 * physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); + } else { dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { data = dtlb_get_data(i); @@ -401,6 +402,8 @@ pmap_bootstrap(u_int cpu_impl) if (cpu_impl >= CPU_IMPL_ULTRASPARCI && cpu_impl < CPU_IMPL_ULTRASPARCIII) dtlb_slots_avail /= 2; + virtsz = roundup(physsz, PAGE_SIZE_4M << + (PAGE_SHIFT - TTE_SHIFT)); virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:48:14 2011 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 9DD151065696; Tue, 21 Jun 2011 20:48:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5858FC21; Tue, 21 Jun 2011 20:48: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 p5LKmEMR016293; Tue, 21 Jun 2011 20:48:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKmE3h016290; Tue, 21 Jun 2011 20:48:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212048.p5LKmE3h016290@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:48: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: r223378 - head/sys/sparc64/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: Tue, 21 Jun 2011 20:48:14 -0000 Author: marius Date: Tue Jun 21 20:48:14 2011 New Revision: 223378 URL: http://svn.freebsd.org/changeset/base/223378 Log: On machines where we don't need to lock the kernel TSB into the dTLB and thus may basically use the entire 64-bit kernel address space reduce VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory. Modified: head/sys/sparc64/include/tsb.h head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/tsb.h ============================================================================== --- head/sys/sparc64/include/tsb.h Tue Jun 21 20:47:03 2011 (r223377) +++ head/sys/sparc64/include/tsb.h Tue Jun 21 20:48:14 2011 (r223378) @@ -50,7 +50,6 @@ extern struct tte *tsb_kernel; extern vm_size_t tsb_kernel_mask; extern vm_size_t tsb_kernel_size; extern vm_paddr_t tsb_kernel_phys; -extern u_int tsb_kernel_ldd_phys; static __inline struct tte * tsb_vpntobucket(pmap_t pm, vm_offset_t vpn) Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Jun 21 20:47:03 2011 (r223377) +++ head/sys/sparc64/include/vmparam.h Tue Jun 21 20:48:14 2011 (r223378) @@ -218,7 +218,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (3) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) #endif /* @@ -238,6 +238,7 @@ #define UMA_MD_SMALL_ALLOC +extern u_int tsb_kernel_ldd_phys; extern vm_offset_t vm_max_kernel_address; /* From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:50:55 2011 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 C92AD1065689; Tue, 21 Jun 2011 20:50:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B99868FC1F; Tue, 21 Jun 2011 20:50: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 p5LKotR5016411; Tue, 21 Jun 2011 20:50:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKot08016409; Tue, 21 Jun 2011 20:50:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106212050.p5LKot08016409@svn.freebsd.org> From: Marius Strobl Date: Tue, 21 Jun 2011 20:50: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: r223379 - head/sys/sparc64/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: Tue, 21 Jun 2011 20:50:55 -0000 Author: marius Date: Tue Jun 21 20:50:55 2011 New Revision: 223379 URL: http://svn.freebsd.org/changeset/base/223379 Log: Fix whitespace Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue Jun 21 20:48:14 2011 (r223378) +++ head/sys/sparc64/include/vmparam.h Tue Jun 21 20:50:55 2011 (r223379) @@ -70,7 +70,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -136,13 +136,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:51:10 2011 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 03D2A1065692; Tue, 21 Jun 2011 20:51:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E89A78FC0C; Tue, 21 Jun 2011 20:51: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 p5LKp9A0016462; Tue, 21 Jun 2011 20:51:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKp9xX016460; Tue, 21 Jun 2011 20:51:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212051.p5LKp9xX016460@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 20:51: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: r223380 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:51:10 -0000 Author: imp Date: Tue Jun 21 20:51:09 2011 New Revision: 223380 URL: http://svn.freebsd.org/changeset/base/223380 Log: Supress warning that command didn't complete when the parent bus thinks the card is gone. Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 20:50:55 2011 (r223379) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 20:51:09 2011 (r223380) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. + * to make it a function. Spress warning when card gone. */ static void xl_wait(struct xl_softc *sc) @@ -346,7 +346,7 @@ xl_wait(struct xl_softc *sc) break; } - if (i == XL_TIMEOUT) + if (i == XL_TIMEOUT && bus_child_present(sc->xl_dev)) device_printf(sc->xl_dev, "command never completed!\n"); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:52:55 2011 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 9225510656D8; Tue, 21 Jun 2011 20:52:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82E4A8FC1E; Tue, 21 Jun 2011 20: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 p5LKqtGB016553; Tue, 21 Jun 2011 20:52:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LKqtEF016551; Tue, 21 Jun 2011 20:52:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212052.p5LKqtEF016551@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 20: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: r223381 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:52:55 -0000 Author: imp Date: Tue Jun 21 20:52:55 2011 New Revision: 223381 URL: http://svn.freebsd.org/changeset/base/223381 Log: Supress command completion failure warning when the card isn't present. Only call the bus to check if we actually do timeout so we don't affect the normal case (since this case needn't be optimized and this guards against all races). Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Tue Jun 21 20:51:09 2011 (r223380) +++ head/sys/dev/dc/if_dc.c Tue Jun 21 20:52:55 2011 (r223381) @@ -1385,7 +1385,7 @@ dc_netcfg_wait(struct dc_softc *sc) break; DELAY(10); } - if (i == DC_TIMEOUT) { + if (i == DC_TIMEOUT && bus_child_present(sc->dc_dev)) { if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc)) device_printf(sc->dc_dev, "%s: failed to force tx to idle state\n", __func__); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:54:26 2011 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 55F7E106566C; Tue, 21 Jun 2011 20:54:26 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id DF4468FC1F; Tue, 21 Jun 2011 20:54:25 +0000 (UTC) Received: by yic13 with SMTP id 13so98629yic.13 for ; Tue, 21 Jun 2011 13:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+CEzp/x7ZaBWGZ09K2qD+B8vr5VFEcAT4e3qVHSuhmA=; b=rQeVwbZg3Bukvu599oVHHm1FhtL+lxboJEHoN9W6wiU4B4+f5huzF1A9KCJP4EFe+l +vKwnecT5uLmU7ZKPucID15fgKYn1bhhB/oZtzJ4qn4xmbX9/i3M54H2ud/KbJreheEM UvaJDUHYFveruKZQy7kRp88aclbKyChh3wvUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lUrE6iLPbL3K2v6Ws5a/SJbuGHe9iFVSENsJzqjMxtOEu6IufHotE1F0gALz5aSRtj KFIblNJHabNgfmyYIDM4/9LhCr2C+kOgKYYEoSv8YfAbusqkJ4b6SFaY8jOJAQpwmRI+ AomNs+E31yO6xSeZRusnDQgpHUxbLNhXtKiq0= MIME-Version: 1.0 Received: by 10.236.153.34 with SMTP id e22mr6434574yhk.31.1308689665040; Tue, 21 Jun 2011 13:54:25 -0700 (PDT) Received: by 10.236.108.1 with HTTP; Tue, 21 Jun 2011 13:54:24 -0700 (PDT) In-Reply-To: <201106212051.p5LKp9xX016460@svn.freebsd.org> References: <201106212051.p5LKp9xX016460@svn.freebsd.org> Date: Tue, 21 Jun 2011 16:54:24 -0400 Message-ID: From: Ben Kaduk To: Warner Losh 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 Subject: Re: svn commit: r223380 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 20:54:26 -0000 On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh wrote: > Author: imp > Date: Tue Jun 21 20:51:09 2011 > New Revision: 223380 > URL: http://svn.freebsd.org/changeset/base/223380 > > --- head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:50:55 2011 =A0 =A0 =A0 = =A0(r223379) > +++ head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:51:09 2011 =A0 =A0 =A0 = =A0(r223380) > @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme > =A0* only a finite amount of time to avoid getting caught in an > =A0* infinite loop. Normally this delay routine would be a macro, > =A0* but it isn't called during normal operation so we can afford > - * to make it a function. > + * to make it a function. =A0Spress warning when card gone. ^^^u -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 20:58:15 2011 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 11A6B10656B2; Tue, 21 Jun 2011 20:58:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6198FC08; Tue, 21 Jun 2011 20:58:14 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LKwBT2009775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 06:58:12 +1000 Date: Wed, 22 Jun 2011 06:58:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Bjoern A. Zeeb" In-Reply-To: Message-ID: <20110622063258.D2275@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 20:58:15 -0000 On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > Hi Alan, > >> Author: alc >> Date: Sun Jun 19 19:13:24 2011 >> New Revision: 223307 >> URL: http://svn.freebsd.org/changeset/base/223307 >> >> Log: >> Precisely document the synchronization rules for the page's dirty field. >> (Saying that the lock on the object that the page belongs to must be held >> only represents one aspect of the rules.) >> >> Eliminate the use of the page queues lock for atomically performing read- >> modify-write operations on the dirty field when the underlying architecture >> supports atomic operations on char and short types. >> >> Document the fact that 32KB pages aren't really supported. > > contrary to the tinderbox I'd like to point out that all mips kernels built by universe are broken with a SVN HEAD from earlier today. Could you please check and see if you can fix it? The errors I get are: > > vm_page.o: In function `vm_page_clear_dirty': > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > vm_page.o: In function `vm_page_set_validclean': > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' Atomic types shorter than int cannot be used in MI code, since they might not exist. Apparently they don't exist on mips. jake@ fixed all their old uses for sparc4 in ~Y2K. >> Modified: head/sys/vm/vm_fault.c >> ============================================================================== >> --- head/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 (r223307) >> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, >> * caller's changes may go unnoticed because they are >> * performed through an unmanaged mapping or by a DMA >> * operation. >> + * >> + * The object lock is not held here. Therefore, like >> + * a pmap operation, the page queues lock may be >> + * required in order to call vm_page_dirty(). See >> + * vm_page_clear_dirty_mask(). >> */ >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ >> + defined(__mips__) >> + vm_page_dirty(*mp); >> +#else >> vm_page_lock_queues(); >> vm_page_dirty(*mp); >> vm_page_unlock_queues(); >> +#endif Apparently, it used to work by using a global lock, so it didn't need to use atomic ops that don't exist because the data sizes are too small. >> Modified: head/sys/vm/vm_page.c >> ============================================================================== >> --- head/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 (r223307) >> ... >> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in >> /* >> * If the object is locked and the page is neither VPO_BUSY nor >> * PG_WRITEABLE, then the page's dirty field cannot possibly be >> - * modified by a concurrent pmap operation. >> + * set by a concurrent pmap operation. >> */ >> VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); >> if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) >> m->dirty &= ~pagebits; >> else { >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ >> + defined(__mips__) >> + /* >> + * On the aforementioned architectures, the page queues lock >> + * is not required by the following read-modify-write >> + * operation. The combination of the object's lock and an >> + * atomic operation suffice. Moreover, the pmap layer on >> + * these architectures can call vm_page_dirty() without >> + * holding the page queues lock. >> + */ >> +#if PAGE_SIZE == 4096 >> + atomic_clear_char(&m->dirty, pagebits); Cannot do that in MI code, though it might work accidentally because all archies with PAGE_SIZE == 4096 might support it. >> +#elif PAGE_SIZE == 8192 >> + atomic_clear_short(&m->dirty, pagebits); Cannot do that... >> +#elif PAGE_SIZE == 16384 >> + atomic_clear_int(&m->dirty, pagebits); >> +#else >> +#error "PAGE_SIZE is not supported." >> +#endif >> +#else >> + /* >> + * Otherwise, the page queues lock is required to ensure that >> + * a concurrent pmap operation does not set the page's dirty >> + * field during the following read-modify-write operation. >> + */ >> vm_page_lock_queues(); >> m->dirty &= ~pagebits; >> vm_page_unlock_queues(); >> +#endif >> } >> } >> >> >> Modified: head/sys/vm/vm_page.h >> ============================================================================== >> --- head/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 (r223306) >> +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 (r223307) >> @@ -120,18 +136,19 @@ struct vm_page { >> u_char busy; /* page busy count (O) */ >> /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ >> /* so, on normal X86 kernels, they must be at least 8 bits wide */ >> + /* In reality, support for 32KB pages is not fully implemented. */ >> #if PAGE_SIZE == 4096 >> u_char valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */ A small size may be good for space efficiency, but the struct is not very well packed, so perhaps the size can be increased without further loss. Must be >= 8 bits, and u_char guarantees this. u_char might be larger than 8 bits anyway, but POSIX requires 8-bit chars. >> #elif PAGE_SIZE == 8192 >> u_short valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 16 bits. I'm not sure if POSIX requires exactly 16. >> #elif PAGE_SIZE == 16384 >> u_int valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 32 bits. POSIX requires >= 32, but C doesn't. I'm not sure if POSIX requires exactly 16. >> #elif PAGE_SIZE == 32768 >> u_long valid; /* map of valid DEV_BSIZE chunks (O) */ >> - u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */ >> + u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */ Must be >= 64 bits. u_long certainly doesn't guarantees this, but does in practice on all arches that support this page size, since no arches support this page size :-). Should use uintN_t for this if not the others. uintN_t is more clearly unportable. It only exists for all the usual N because arches are not very variant, and then even then only for non-atomic ops. >> #endif >> }; Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 21:07:33 2011 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 77E2D1065672; Tue, 21 Jun 2011 21:07:33 +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 4E8318FC13; Tue, 21 Jun 2011 21:07: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 p5LL7XI9017054; Tue, 21 Jun 2011 21:07:33 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LL7X07017052; Tue, 21 Jun 2011 21:07:33 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106212107.p5LL7X07017052@svn.freebsd.org> From: Rick Macklem Date: Tue, 21 Jun 2011 21:07: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: r223382 - head/usr.sbin/nfsuserd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 21:07:33 -0000 Author: rmacklem Date: Tue Jun 21 21:07:33 2011 New Revision: 223382 URL: http://svn.freebsd.org/changeset/base/223382 Log: Change the NFSv4 nfsuserd(8) daemon so that it doesn't preload the uid<->username mapping cache with an entry when another entry for that uid is already loaded. This fixes a case where the mapping of "toor" would replace "root" when the daemon was started, resulting in no mapping for "root" until the cache entry for "toor" timed out. The algorithm is inefficient, but since it is only done once when the daemon is started up, I don't think that's an issue. MFC after: 2 weeks Modified: head/usr.sbin/nfsuserd/nfsuserd.c Modified: head/usr.sbin/nfsuserd/nfsuserd.c ============================================================================== --- head/usr.sbin/nfsuserd/nfsuserd.c Tue Jun 21 20:52:55 2011 (r223381) +++ head/usr.sbin/nfsuserd/nfsuserd.c Tue Jun 21 21:07:33 2011 (r223382) @@ -76,6 +76,8 @@ static bool_t xdr_retval(XDR *, caddr_t) #define MAXNAME 1024 #define MAXNFSUSERD 20 #define DEFNFSUSERD 4 +#define MAXUSERMAX 100000 +#define MINUSERMAX 10 #define DEFUSERMAX 200 #define DEFUSERTIMEOUT (1 * 60) struct info { @@ -96,8 +98,8 @@ pid_t slaves[MAXNFSUSERD]; int main(int argc, char *argv[]) { - int i; - int error, len, mustfreeai = 0; + int i, j; + int error, fnd_dup, len, mustfreeai = 0, start_uidpos; struct nfsd_idargs nid; struct passwd *pwd; struct group *grp; @@ -107,6 +109,7 @@ main(int argc, char *argv[]) sigset_t signew; char hostname[MAXHOSTNAMELEN + 1], *cp; struct addrinfo *aip, hints; + static uid_t check_dups[MAXUSERMAX]; if (modfind("nfscommon") < 0) { /* Not present in kernel, try loading it */ @@ -163,9 +166,10 @@ main(int argc, char *argv[]) argc--; argv++; i = atoi(*argv); - if (i < 10 || i > 100000) { + if (i < MINUSERMAX || i > MAXUSERMAX) { fprintf(stderr, - "usermax %d out of range 10<->100000\n", i); + "usermax %d out of range %d<->%d\n", i, + MINUSERMAX, MAXUSERMAX); usage(); } nid.nid_usermax = i; @@ -326,8 +330,25 @@ main(int argc, char *argv[]) /* * Loop around adding all users. */ + start_uidpos = i; setpwent(); while (i < nid.nid_usermax && (pwd = getpwent())) { + fnd_dup = 0; + /* + * Yes, this is inefficient, but it is only done once when + * the daemon is started and will run in a fraction of a second + * for nid_usermax at 10000. If nid_usermax is cranked up to + * 100000, it will take several seconds, depending on the CPU. + */ + for (j = 0; j < (i - start_uidpos); j++) + if (check_dups[j] == pwd->pw_uid) { + /* Found another entry for uid, so skip it */ + fnd_dup = 1; + break; + } + if (fnd_dup != 0) + continue; + check_dups[i - start_uidpos] = pwd->pw_uid; nid.nid_uid = pwd->pw_uid; nid.nid_name = pwd->pw_name; nid.nid_namelen = strlen(pwd->pw_name); From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 21:09:25 2011 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 3CE871065709; Tue, 21 Jun 2011 21:09:25 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id AA7DE8FC15; Tue, 21 Jun 2011 21:09:24 +0000 (UTC) Received: by yxl31 with SMTP id 31so107101yxl.13 for ; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0kcvhWknFn0WxyXfOUCTQ6nG5oMS47tgU93xI2Ph5nE=; b=GMdPhfYQBYgNyjTwE8Hw8A5HZ6er3SFC/qmV91eiEVoW19FDD8RpyWP2OHDB9vfFQp HCCbx74Xgaq05MH2xrcr2+JFLtXFqEeETh+yDxuL72ezO0/NQFhVNYBYGiYeTmlJYUbC Uv709I5uoGJCADH59S+jxtit4dtcj8RXV914g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=MZ55XIAtVn11UWMd1HeQuIML7LdJpoobExz8UOMPOpOpwtS+16jAbhLMyZk1QKY/nx pd6fK++cNqvQRaZtUexVKOTDmKbtOmyn27b+9yCGRQQrRvQJ1AgTSBDEJe/4GfHB7mTW RcKtweIXk7KBaI+PfpoNRXi9K8JObbggg/kdc= MIME-Version: 1.0 Received: by 10.236.111.20 with SMTP id v20mr11180680yhg.423.1308690563598; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Tue, 21 Jun 2011 14:09:23 -0700 (PDT) In-Reply-To: <20110622063258.D2275@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> Date: Tue, 21 Jun 2011 23:09:23 +0200 X-Google-Sender-Auth: zT2j_G6cUneQ3G84ny8EQ_6mKHc Message-ID: From: Attilio Rao To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 21:09:25 -0000 2011/6/21 Bruce Evans : > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > >> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >> >> Hi Alan, >> >>> Author: alc >>> Date: Sun Jun 19 19:13:24 2011 >>> New Revision: 223307 >>> URL: http://svn.freebsd.org/changeset/base/223307 >>> >>> Log: >>> =C2=A0Precisely document the synchronization rules for the page's dirty= field. >>> =C2=A0(Saying that the lock on the object that the page belongs to must= be >>> held >>> =C2=A0only represents one aspect of the rules.) >>> >>> =C2=A0Eliminate the use of the page queues lock for atomically performi= ng >>> read- >>> =C2=A0modify-write operations on the dirty field when the underlying >>> architecture >>> =C2=A0supports atomic operations on char and short types. >>> >>> =C2=A0Document the fact that 32KB pages aren't really supported. >> >> contrary to the tinderbox I'd like to point out that all mips kernels >> built by universe are broken with a SVN HEAD from earlier today. =C2=A0C= ould you >> please check and see if you can fix it? =C2=A0The errors I get are: >> >> vm_page.o: In function `vm_page_clear_dirty': >> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8= ' >> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >> against `atomic_clear_8' >> vm_page.o: In function `vm_page_set_validclean': >> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8= ' >> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >> against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed a= ll their > old uses for sparc4 in ~Y2K. I'm sure they do, they exist in support.S though and may not have the _8 form (they may just have the _char version). I may look at the code again to be sure. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 21:14:30 2011 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 AEF4E1065680; Tue, 21 Jun 2011 21:14:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 30C1E8FC17; Tue, 21 Jun 2011 21:14:29 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LLEPvv019219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 07:14:28 +1000 Date: Wed, 22 Jun 2011 07:14:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ben Kaduk In-Reply-To: Message-ID: <20110622071154.H2398@besplex.bde.org> References: <201106212051.p5LKp9xX016460@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1948960399-1308690865=:2398" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh Subject: Re: svn commit: r223380 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 21:14:30 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1948960399-1308690865=:2398 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 21 Jun 2011, Ben Kaduk wrote: > On Tue, Jun 21, 2011 at 4:51 PM, Warner Losh wrote: >> Author: imp >> Date: Tue Jun 21 20:51:09 2011 >> New Revision: 223380 >> URL: http://svn.freebsd.org/changeset/base/223380 >> >> --- head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:50:55 2011 =A0 =A0 =A0= =A0(r223379) >> +++ head/sys/dev/xl/if_xl.c =A0 =A0 Tue Jun 21 20:51:09 2011 =A0 =A0 =A0= =A0(r223380) >> @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme >> =A0* only a finite amount of time to avoid getting caught in an >> =A0* infinite loop. Normally this delay routine would be a macro, >> =A0* but it isn't called during normal operation so we can afford >> - * to make it a function. >> + * to make it a function. =A0Spress warning when card gone. > ^^^u Still a srrising selling :-). Bruce --0-1948960399-1308690865=:2398-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 21:30:21 2011 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 64362106568B; Tue, 21 Jun 2011 21:30:21 +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 547438FC14; Tue, 21 Jun 2011 21:30: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 p5LLULaf017819; Tue, 21 Jun 2011 21:30:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LLULgS017817; Tue, 21 Jun 2011 21:30:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106212130.p5LLULgS017817@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Jun 2011 21:30: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: r223383 - 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, 21 Jun 2011 21:30:21 -0000 Author: jhb Date: Tue Jun 21 21:30:20 2011 New Revision: 223383 URL: http://svn.freebsd.org/changeset/base/223383 Log: Fix build with ACPI_DEBUG defined. Submitted by: jkim Pointy hat to: jhb Modified: head/sys/dev/acpica/acpi_resource.c Modified: head/sys/dev/acpica/acpi_resource.c ============================================================================== --- head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:07:33 2011 (r223382) +++ head/sys/dev/acpica/acpi_resource.c Tue Jun 21 21:30:20 2011 (r223383) @@ -343,22 +343,23 @@ acpi_parse_resource(ACPI_RESOURCE *res, if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x/%d\n", - name, min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)length)); set->set_memory(dev, arc->context, min, length); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x/%d\n", name, - min, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx/%ju\n", name, + (uintmax_t)min, (uintmax_t)length)); set->set_ioport(dev, arc->context, min, length); } } else { if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/Memory 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, + "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, + (uintmax_t)max, (uintmax_t)length)); set->set_memoryrange(dev, arc->context, min, max, length, gran); } else { - ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%x-0x%x/%d\n", - name, min, max, length)); + ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", + name, (uintmax_t)min, (uintmax_t)max, (uintmax_t)length)); set->set_iorange(dev, arc->context, min, max, length, gran); } } From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 22:16:04 2011 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 AC89310656EC; Tue, 21 Jun 2011 22:16:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D14E8FC19; Tue, 21 Jun 2011 22:16: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 p5LMG40Y019255; Tue, 21 Jun 2011 22:16:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMG4wF019253; Tue, 21 Jun 2011 22:16:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212216.p5LMG4wF019253@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22:16: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: r223384 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 22:16:04 -0000 Author: imp Date: Tue Jun 21 22:16:04 2011 New Revision: 223384 URL: http://svn.freebsd.org/changeset/base/223384 Log: My broken 'u' key scks! Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 21:30:20 2011 (r223383) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011 (r223384) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. Spress warning when card gone. + * to make it a function. Supress warning when card gone. */ static void xl_wait(struct xl_softc *sc) From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 22:17:28 2011 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 B60DA106567B; Tue, 21 Jun 2011 22:17:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6C0D8FC15; Tue, 21 Jun 2011 22: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 p5LMHS2w019342; Tue, 21 Jun 2011 22:17:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMHSL4019340; Tue, 21 Jun 2011 22:17:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212217.p5LMHSL4019340@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22: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: r223385 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 22:17:28 -0000 Author: imp Date: Tue Jun 21 22:17:28 2011 New Revision: 223385 URL: http://svn.freebsd.org/changeset/base/223385 Log: Really spell suppress the right way Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Tue Jun 21 22:16:04 2011 (r223384) +++ head/sys/dev/xl/if_xl.c Tue Jun 21 22:17:28 2011 (r223385) @@ -334,7 +334,7 @@ xl_dma_map_addr(void *arg, bus_dma_segme * only a finite amount of time to avoid getting caught in an * infinite loop. Normally this delay routine would be a macro, * but it isn't called during normal operation so we can afford - * to make it a function. Supress warning when card gone. + * to make it a function. Suppress warning when card gone. */ static void xl_wait(struct xl_softc *sc) From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 22:19:36 2011 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 84664106566B; Tue, 21 Jun 2011 22:19:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 176788FC1C; Tue, 21 Jun 2011 22:19:36 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5LMC1MQ082589 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 16:12:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 21 Jun 2011 16:11:52 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <4A0467C1-258F-4D8D-91E0-9CD1795A49B6@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 16:12:03 -0600 (MDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 22:19:36 -0000 On Jun 21, 2011, at 2:30 PM, Bjoern A. Zeeb wrote: > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >=20 > Hi Alan, >=20 >> Author: alc >> Date: Sun Jun 19 19:13:24 2011 >> New Revision: 223307 >> URL: http://svn.freebsd.org/changeset/base/223307 >>=20 >> Log: >> Precisely document the synchronization rules for the page's dirty = field. >> (Saying that the lock on the object that the page belongs to must be = held >> only represents one aspect of the rules.) >>=20 >> Eliminate the use of the page queues lock for atomically performing = read- >> modify-write operations on the dirty field when the underlying = architecture >> supports atomic operations on char and short types. >>=20 >> Document the fact that 32KB pages aren't really supported. >>=20 >=20 > contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. Could = you please check and see if you can fix it? The errors I get are: >=20 > vm_page.o: In function `vm_page_clear_dirty': > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 against `atomic_clear_8' > vm_page.o: In function `vm_page_set_validclean': > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 against `atomic_clear_8' atomic_clear_8???? I only see atomic_clear_int, which should be = atomic_clear_4 in the mips impl. Warner > Thanks a lot! > /bz >=20 >=20 >> Reviewed by: attilio, kib >>=20 >> Modified: >> head/sys/vm/vm_fault.c >> head/sys/vm/vm_page.c >> head/sys/vm/vm_page.h >>=20 >> Modified: head/sys/vm/vm_fault.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/sys/vm/vm_fault.c Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_fault.c Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map,=20 >> * caller's changes may go unnoticed because = they are >> * performed through an unmanaged mapping or by = a DMA >> * operation. >> + * >> + * The object lock is not held here. Therefore, = like >> + * a pmap operation, the page queues lock may be >> + * required in order to call vm_page_dirty(). = See >> + * vm_page_clear_dirty_mask(). >> */ >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || = \ >> + defined(__mips__) >> + vm_page_dirty(*mp); >> +#else >> vm_page_lock_queues(); >> vm_page_dirty(*mp); >> vm_page_unlock_queues(); >> +#endif >> } >> } >> if (pmap_failed) { >>=20 >> Modified: head/sys/vm/vm_page.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/sys/vm/vm_page.c Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_page.c Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m >> /* >> * vm_page_dirty: >> * >> - * make page all dirty >> + * Set all bits in the page's dirty field. >> + * >> + * The object containing the specified page must be locked if the = call is >> + * made from the machine-independent layer. If, however, the call = is >> + * made from the pmap layer, then the page queues lock may be = required. >> + * See vm_page_clear_dirty_mask(). >> */ >> void >> vm_page_dirty(vm_page_t m) >> @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in >> /* >> * If the object is locked and the page is neither VPO_BUSY nor >> * PG_WRITEABLE, then the page's dirty field cannot possibly be >> - * modified by a concurrent pmap operation.=20 >> + * set by a concurrent pmap operation.=20 >> */ >> VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); >> if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRITEABLE) = =3D=3D 0) >> m->dirty &=3D ~pagebits; >> else { >> +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || = \ >> + defined(__mips__) >> + /* >> + * On the aforementioned architectures, the page queues = lock >> + * is not required by the following read-modify-write >> + * operation. The combination of the object's lock and = an >> + * atomic operation suffice. Moreover, the pmap layer = on >> + * these architectures can call vm_page_dirty() without >> + * holding the page queues lock. >> + */ >> +#if PAGE_SIZE =3D=3D 4096 >> + atomic_clear_char(&m->dirty, pagebits); >> +#elif PAGE_SIZE =3D=3D 8192 >> + atomic_clear_short(&m->dirty, pagebits); >> +#elif PAGE_SIZE =3D=3D 16384 >> + atomic_clear_int(&m->dirty, pagebits); >> +#else >> +#error "PAGE_SIZE is not supported." >> +#endif >> +#else >> + /* >> + * Otherwise, the page queues lock is required to ensure = that >> + * a concurrent pmap operation does not set the page's = dirty >> + * field during the following read-modify-write = operation. >> + */ >> vm_page_lock_queues(); >> m->dirty &=3D ~pagebits; >> vm_page_unlock_queues(); >> +#endif >> } >> } >>=20 >>=20 >> Modified: head/sys/vm/vm_page.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/sys/vm/vm_page.h Sun Jun 19 18:34:49 2011 = (r223306) >> +++ head/sys/vm/vm_page.h Sun Jun 19 19:13:24 2011 = (r223307) >> @@ -89,10 +89,26 @@ >> * and offset to which this page belongs (for pageout), >> * and sundry status bits. >> * >> - * Fields in this structure are locked either by the lock on the >> - * object that the page belongs to (O), its corresponding page lock = (P), >> - * or by the lock on the page queues (Q). >> - *=09 >> + * In general, operations on this structure's mutable fields are >> + * synchronized using either one of or a combination of the lock on = the >> + * object that the page belongs to (O), the pool lock for the page = (P), >> + * or the lock for either the free or paging queues (Q). If a = field is >> + * annotated below with two of these locks, then holding either = lock is >> + * sufficient for read access, but both locks are required for = write=20 >> + * access. >> + * >> + * In contrast, the synchronization of accesses to the page's dirty = field >> + * is machine dependent (M). In the machine-independent layer, the = lock >> + * on the object that the page belongs to must be held in order to >> + * operate on the field. However, the pmap layer is permitted to = set >> + * all bits within the field without holding that lock. Therefore, = if >> + * the underlying architecture does not support atomic = read-modify-write >> + * operations on the field's type, then the machine-independent = layer >> + * must also hold the page queues lock when performing = read-modify-write >> + * operations and the pmap layer must hold the page queues lock = when >> + * setting the field. In the machine-independent layer, the >> + * implementation of read-modify-write operations on the field is >> + * encapsulated in vm_page_clear_dirty_mask(). >> */ >>=20 >> TAILQ_HEAD(pglist, vm_page); >> @@ -120,18 +136,19 @@ struct vm_page { >> u_char busy; /* page busy count (O) */ >> /* NOTE that these must support one bit per DEV_BSIZE in a = page!!! */ >> /* so, on normal X86 kernels, they must be at least 8 bits wide = */ >> + /* In reality, support for 32KB pages is not fully implemented. = */ >> #if PAGE_SIZE =3D=3D 4096 >> u_char valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_char dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_char dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 8192 >> u_short valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_short dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_short dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 16384 >> u_int valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_int dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_int dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #elif PAGE_SIZE =3D=3D 32768 >> u_long valid; /* map of valid DEV_BSIZE chunks = (O) */ >> - u_long dirty; /* map of dirty DEV_BSIZE chunks = (O) */ >> + u_long dirty; /* map of dirty DEV_BSIZE chunks = (M) */ >> #endif >> }; >>=20 >=20 > --=20 > Bjoern A. Zeeb You have to have = visions! > Stop bit received. Insert coin for new address family. >=20 >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 22:45:31 2011 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 A718810656E2; Tue, 21 Jun 2011 22:45:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF208FC1A; Tue, 21 Jun 2011 22:45: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 p5LMjV2q020256; Tue, 21 Jun 2011 22:45:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5LMjVwT020254; Tue, 21 Jun 2011 22:45:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106212245.p5LMjVwT020254@svn.freebsd.org> From: Warner Losh Date: Tue, 21 Jun 2011 22:45: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: r223386 - head/sys/dev/cardbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2011 22:45:31 -0000 Author: imp Date: Tue Jun 21 22:45:31 2011 New Revision: 223386 URL: http://svn.freebsd.org/changeset/base/223386 Log: Minor cleanup: o Consider No CIS a normal event and stop whining about it so much (too many cards are like this, espeically usb/firewire cards). o Add comments to the cis reading code. o Made the read from config space a smidge easier to read and eliminate a loop that can be done mathematically. Modified: head/sys/dev/cardbus/cardbus_cis.c Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Tue Jun 21 22:17:28 2011 (r223385) +++ head/sys/dev/cardbus/cardbus_cis.c Tue Jun 21 22:45:31 2011 (r223386) @@ -369,6 +369,14 @@ decode_tuple_end(device_t cbdev, device_ * Functions to read the a tuple from the card */ +/* + * Read CIS bytes out of the config space. We have to read it 4 bytes at a + * time and do the usual mask and shift to return the bytes. The standard + * defines the byte order to be little endian. pci_read_config converts it to + * host byte order. This is why we have no endian conversion functions: the + * shifts wind up being endian neutral. This is also why we avoid the obvious + * memcpy optimization. + */ static int cardbus_read_tuple_conf(device_t cbdev, device_t child, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) @@ -379,12 +387,11 @@ cardbus_read_tuple_conf(device_t cbdev, loc = start + *off; - e = pci_read_config(child, loc - loc % 4, 4); - for (j = loc % 4; j > 0; j--) - e >>= 8; + e = pci_read_config(child, loc & ~0x3, 4); + e >>= 8 * (loc & 0x3); *len = 0; for (i = loc, j = -2; j < *len; j++, i++) { - if (i % 4 == 0) + if ((i & 0x3) == 0) e = pci_read_config(child, i, 4); if (j == -2) *tupleid = 0xff & e; @@ -398,6 +405,10 @@ cardbus_read_tuple_conf(device_t cbdev, return (0); } +/* + * Read the CIS data out of memroy. We indirect through the bus space + * routines to ensure proper byte ordering conversions when necessary. + */ static int cardbus_read_tuple_mem(device_t cbdev, struct resource *res, uint32_t start, uint32_t *off, int *tupleid, int *len, uint8_t *tupledata) @@ -580,7 +591,7 @@ cardbus_parse_cis(device_t cbdev, device expect_linktarget = TRUE; if ((start = pci_read_config(child, PCIR_CIS, 4)) == 0) { DEVPRINTF((cbdev, "Warning: CIS pointer is 0: (no CIS)\n")); - return (ENXIO); + return (0); } DEVPRINTF((cbdev, "CIS pointer is %#x\n", start)); off = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 23:29:36 2011 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 0EF74106567D; Tue, 21 Jun 2011 23:29:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 988088FC0C; Tue, 21 Jun 2011 23:29:35 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5LNTW7j026859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Jun 2011 09:29:33 +1000 Date: Wed, 22 Jun 2011 09:29:32 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao In-Reply-To: Message-ID: <20110622090856.A2727@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1048822986-1308698972=:2727" Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 23:29:36 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1048822986-1308698972=:2727 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 21 Jun 2011, Attilio Rao wrote: > 2011/6/21 Bruce Evans : >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_= 8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_2= 6 >>> against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_= 8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_2= 6 >>> against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they migh= t >> not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed = all their >> old uses for sparc4 in ~Y2K. > > I'm sure they do, they exist in support.S though and may not have the > _8 form (they may just have the _char version). I may look at the code > again to be sure. Perhaps more like the reverse. They are correctly spelled with _char form in the C code. This is needed to match the declarations of the variables literally. They are translated to the _8 form by but the _8 form doesn't exist. I think the acq and rel forms exist in . mips/support.S only has a limited set of atomics, including clear_16 but not including clear_8. Anyway, they shouldn't be used in either form. They certainly don't exist on sparc64, but sparc64 compiles because it is on the other half of the ifdef. sparc64 atomic support is actually 4 times smaller than mips atomic support, not just 2.5 times, since it doesn't have extras in support.S. Bruce --0-1048822986-1308698972=:2727-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 21 23:47:42 2011 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 CC57E1065692; Tue, 21 Jun 2011 23:47:42 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 93CA68FC17; Tue, 21 Jun 2011 23:47:42 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id CF92F2904BA; Tue, 21 Jun 2011 18:28:01 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id cN7jVm+5OI7v; Tue, 21 Jun 2011 18:28:01 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id E09552904B6; Tue, 21 Jun 2011 18:28:00 -0500 (CDT) Message-ID: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 18:27:59 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Attilio Rao References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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, 21 Jun 2011 23:47:43 -0000 On 06/21/2011 16:09, Attilio Rao wrote: > 2011/6/21 Bruce Evans: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >> >>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>> >>> Hi Alan, >>> >>>> Author: alc >>>> Date: Sun Jun 19 19:13:24 2011 >>>> New Revision: 223307 >>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>> >>>> Log: >>>> Precisely document the synchronization rules for the page's dirty field. >>>> (Saying that the lock on the object that the page belongs to must be >>>> held >>>> only represents one aspect of the rules.) >>>> >>>> Eliminate the use of the page queues lock for atomically performing >>>> read- >>>> modify-write operations on the dirty field when the underlying >>>> architecture >>>> supports atomic operations on char and short types. >>>> >>>> Document the fact that 32KB pages aren't really supported. >>> contrary to the tinderbox I'd like to point out that all mips kernels >>> built by universe are broken with a SVN HEAD from earlier today. Could you >>> please check and see if you can fix it? The errors I get are: >>> >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >>> against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >>> against `atomic_clear_8' >> Atomic types shorter than int cannot be used in MI code, since they might >> not exist. Apparently they don't exist on mips. jake@ fixed all their >> old uses for sparc4 in ~Y2K. > I'm sure they do, they exist in support.S though and may not have the > _8 form (they may just have the _char version). I may look at the code > again to be sure. > It appears that while mips/include/atomic.h declares the existence of atomic_clear_8, mips/mips/support.S doesn't implement it. In other words, only support for int's and short's is currently implemented, not char's: # grep atomic_clear mips/mips/support.S * atomic_clear_32(u_int32_t *a, u_int32_t b) LEAF(atomic_clear_32) END(atomic_clear_32) * atomic_clear_16(u_int16_t *a, u_int16_t b) LEAF(atomic_clear_16) END(atomic_clear_16) From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:16:41 2011 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 541A910656A4; Wed, 22 Jun 2011 00:16:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42E6C8FC08; Wed, 22 Jun 2011 00:16: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 p5M0GftG023047; Wed, 22 Jun 2011 00:16:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0Gf8h023044; Wed, 22 Jun 2011 00:16:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220016.p5M0Gf8h023044@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223387 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:16:41 -0000 Author: yongari Date: Wed Jun 22 00:16:40 2011 New Revision: 223387 URL: http://svn.freebsd.org/changeset/base/223387 Log: MFC r221818: Add initial BCM5719 support. TSO and jumbo frame was intentionally disabled for BCM5719 A0 revision due to known hardware errata. Many thanks to Broadcom for continuing support of FreeBSD. Submitted by: Geans Pin at Broadcom Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Tue Jun 21 22:45:31 2011 (r223386) +++ stable/8/sys/dev/bge/if_bge.c Wed Jun 22 00:16:40 2011 (r223387) @@ -171,6 +171,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, @@ -299,6 +300,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, + { BGE_CHIPID_BCM5719_A0, "BCM5719 A0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, @@ -346,6 +348,7 @@ static const struct bge_revision const b { BGE_ASICREV_BCM57765, "unknown BCM57765" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, + { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { 0, NULL } }; @@ -1481,6 +1484,14 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0) dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK; + /* + * Enable HW workaround for controllers that misinterpret + * a status tag update and leave interrupts permanently + * disabled. + */ + if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM57765) + dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1537,7 +1548,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t val; + uint32_t dmactl, val; int i, limit; /* @@ -1594,8 +1605,16 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10); /* Enable buffer manager */ - CSR_WRITE_4(sc, BGE_BMAN_MODE, - BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN); + val = BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN; + /* + * Change the arbitration algorithm of TXMBUF read request to + * round-robin instead of priority based for BCM5719. When + * TXFIFO is almost empty, RDMA will hold its request until + * TXFIFO is not almost empty. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + val |= BGE_BMANMODE_NO_TX_UNDERRUN; + CSR_WRITE_4(sc, BGE_BMAN_MODE, val); /* Poll for buffer manager start indication */ for (i = 0; i < BGE_TIMEOUT; i++) { @@ -1692,7 +1711,8 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_STD_RX_RINGS; @@ -1724,7 +1744,8 @@ bge_blockinit(struct bge_softc *sc) BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; @@ -1812,7 +1833,8 @@ bge_blockinit(struct bge_softc *sc) BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717); else RCB_WRITE_4(sc, vrcb, bge_nicaddr, @@ -1825,7 +1847,8 @@ bge_blockinit(struct bge_softc *sc) * 'ring diabled' bit in the flags field of all the receive * return ring control blocks, located in NIC memory. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { /* Should be 17, use 16 until we get an SRAM map. */ limit = 16; } else if (!BGE_IS_5705_PLUS(sc)) @@ -2029,15 +2052,35 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || BGE_IS_5717_PLUS(sc)) { + dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + /* + * Adjust tx margin to prevent TX data corruption and + * fix internal FIFO overflow. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | + BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | + BGE_RDMA_RSRVCTRL_TXMRGN_MASK); + dmactl |= BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K | + BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K | + BGE_RDMA_RSRVCTRL_TXMRGN_320B; + } /* * Enable fix for read DMA FIFO overruns. * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, - CSR_READ_4(sc, BGE_RDMA_RSRVCTRL) | + CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } + + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } + CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -2189,6 +2232,7 @@ bge_probe(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2712,6 +2756,7 @@ bge_attach(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: sc->bge_chipid = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2742,11 +2787,13 @@ bge_attach(device_t dev) * BCM57XX | 1 | X | X | X | * BCM5704 | 1 | X | 1 | X | * BCM5717 | 1 | 8 | 2 | 9 | + * BCM5719 | 1 | 8 | 2 | 9 | * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { f = pci_get_function(dev); if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & @@ -2754,7 +2801,7 @@ bge_attach(device_t dev) phy_addr = f + 8; else phy_addr = f + 1; - } else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) { + } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) phy_addr = f + 8; @@ -2780,11 +2827,17 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: sc->bge_flags |= BGE_FLAG_SHORT_DMA_BUG; case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | BGE_FLAG_JUMBO_FRAME; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* Jumbo frame on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + } break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: @@ -2832,6 +2885,7 @@ bge_attach(device_t dev) if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && sc->bge_asicrev != BGE_ASICREV_BCM57765 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { @@ -2914,6 +2968,11 @@ bge_attach(device_t dev) if (BGE_IS_5717_PLUS(sc)) { /* BCM5717 requires different TSO configuration. */ sc->bge_flags |= BGE_FLAG_TSO3; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* TSO on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_TSO3; + } } else if (BGE_IS_5755_PLUS(sc)) { /* * BCM5754 and BCM5787 shares the same ASIC id so @@ -2936,7 +2995,9 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - if (pci_get_max_read_req(dev) != 4096) + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + pci_set_max_read_req(dev, 2048); + else if (pci_get_max_read_req(dev) != 4096) pci_set_max_read_req(dev, 4096); } else { /* Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Tue Jun 21 22:45:31 2011 (r223386) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jun 22 00:16:40 2011 (r223387) @@ -319,6 +319,7 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM57765_A0 0x57785000 #define BGE_CHIPID_BCM57765_B0 0x57785100 @@ -342,6 +343,7 @@ #define BGE_ASICREV_USE_PRODID_REG 0x0f /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ #define BGE_ASICREV_BCM5717 0x5717 +#define BGE_ASICREV_BCM5719 0x5719 #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 @@ -385,6 +387,7 @@ #define BGE_PCIDMARWCTL_RD_CMD_SHIFT(x) ((x) << 24) #define BGE_PCIDMARWCTL_WR_CMD_SHIFT(x) ((x) << 28) +#define BGE_PCIDMARWCTL_TAGGED_STATUS_WA 0x00000080 #define BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK 0x00000380 #define BGE_PCI_READ_BNDRY_DISABLE 0x00000000 @@ -1494,6 +1497,7 @@ #define BGE_BMANMODE_ATTN 0x00000004 #define BGE_BMANMODE_TESTMODE 0x00000008 #define BGE_BMANMODE_LOMBUF_ATTN 0x00000010 +#define BGE_BMANMODE_NO_TX_UNDERRUN 0x80000000 /* Buffer manager status register */ #define BGE_BMANSTAT_ERRO 0x00000004 @@ -1506,6 +1510,7 @@ #define BGE_RDMA_MODE 0x4800 #define BGE_RDMA_STATUS 0x4804 #define BGE_RDMA_RSRVCTRL 0x4900 +#define BGE_RDMA_LSO_CRPTEN_CTRL 0x4910 /* Read DMA mode register */ #define BGE_RDMAMODE_RESET 0x00000001 @@ -1540,6 +1545,15 @@ /* Read DMA Reserved Control register */ #define BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000C00 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000C0000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000FF0 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 + +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 /* * Write DMA control registers @@ -2261,6 +2275,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5715S 0x1679 #define BCOM_DEVICEID_BCM5717 0x1655 #define BCOM_DEVICEID_BCM5718 0x1656 +#define BCOM_DEVICEID_BCM5719 0x1657 #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:17:48 2011 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 CE0A0106567F; Wed, 22 Jun 2011 00:17:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCFBF8FC1D; Wed, 22 Jun 2011 00:17: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 p5M0HmtL023116; Wed, 22 Jun 2011 00:17:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0HmKX023113; Wed, 22 Jun 2011 00:17:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220017.p5M0HmKX023113@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:17:48 +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: r223388 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:17:48 -0000 Author: yongari Date: Wed Jun 22 00:17:48 2011 New Revision: 223388 URL: http://svn.freebsd.org/changeset/base/223388 Log: MFC r221818: Add initial BCM5719 support. TSO and jumbo frame was intentionally disabled for BCM5719 A0 revision due to known hardware errata. Many thanks to Broadcom for continuing support of FreeBSD. Submitted by: Geans Pin at Broadcom Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jun 22 00:16:40 2011 (r223387) +++ stable/7/sys/dev/bge/if_bge.c Wed Jun 22 00:17:48 2011 (r223388) @@ -171,6 +171,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, @@ -299,6 +300,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, + { BGE_CHIPID_BCM5719_A0, "BCM5719 A0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, @@ -346,6 +348,7 @@ static const struct bge_revision const b { BGE_ASICREV_BCM57765, "unknown BCM57765" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, + { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { 0, NULL } }; @@ -1481,6 +1484,14 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0) dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK; + /* + * Enable HW workaround for controllers that misinterpret + * a status tag update and leave interrupts permanently + * disabled. + */ + if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM57765) + dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1537,7 +1548,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t val; + uint32_t dmactl, val; int i, limit; /* @@ -1594,8 +1605,16 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10); /* Enable buffer manager */ - CSR_WRITE_4(sc, BGE_BMAN_MODE, - BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN); + val = BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN; + /* + * Change the arbitration algorithm of TXMBUF read request to + * round-robin instead of priority based for BCM5719. When + * TXFIFO is almost empty, RDMA will hold its request until + * TXFIFO is not almost empty. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + val |= BGE_BMANMODE_NO_TX_UNDERRUN; + CSR_WRITE_4(sc, BGE_BMAN_MODE, val); /* Poll for buffer manager start indication */ for (i = 0; i < BGE_TIMEOUT; i++) { @@ -1692,7 +1711,8 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_STD_RX_RINGS; @@ -1724,7 +1744,8 @@ bge_blockinit(struct bge_softc *sc) BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; @@ -1812,7 +1833,8 @@ bge_blockinit(struct bge_softc *sc) BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717); else RCB_WRITE_4(sc, vrcb, bge_nicaddr, @@ -1825,7 +1847,8 @@ bge_blockinit(struct bge_softc *sc) * 'ring diabled' bit in the flags field of all the receive * return ring control blocks, located in NIC memory. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { /* Should be 17, use 16 until we get an SRAM map. */ limit = 16; } else if (!BGE_IS_5705_PLUS(sc)) @@ -2029,15 +2052,35 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || BGE_IS_5717_PLUS(sc)) { + dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + /* + * Adjust tx margin to prevent TX data corruption and + * fix internal FIFO overflow. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | + BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | + BGE_RDMA_RSRVCTRL_TXMRGN_MASK); + dmactl |= BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K | + BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K | + BGE_RDMA_RSRVCTRL_TXMRGN_320B; + } /* * Enable fix for read DMA FIFO overruns. * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, - CSR_READ_4(sc, BGE_RDMA_RSRVCTRL) | + CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } + + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } + CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -2189,6 +2232,7 @@ bge_probe(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2712,6 +2756,7 @@ bge_attach(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: sc->bge_chipid = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2742,11 +2787,13 @@ bge_attach(device_t dev) * BCM57XX | 1 | X | X | X | * BCM5704 | 1 | X | 1 | X | * BCM5717 | 1 | 8 | 2 | 9 | + * BCM5719 | 1 | 8 | 2 | 9 | * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { f = pci_get_function(dev); if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & @@ -2754,7 +2801,7 @@ bge_attach(device_t dev) phy_addr = f + 8; else phy_addr = f + 1; - } else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) { + } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) phy_addr = f + 8; @@ -2780,11 +2827,17 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: sc->bge_flags |= BGE_FLAG_SHORT_DMA_BUG; case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | BGE_FLAG_JUMBO_FRAME; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* Jumbo frame on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + } break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: @@ -2832,6 +2885,7 @@ bge_attach(device_t dev) if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && sc->bge_asicrev != BGE_ASICREV_BCM57765 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { @@ -2914,6 +2968,11 @@ bge_attach(device_t dev) if (BGE_IS_5717_PLUS(sc)) { /* BCM5717 requires different TSO configuration. */ sc->bge_flags |= BGE_FLAG_TSO3; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* TSO on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_TSO3; + } } else if (BGE_IS_5755_PLUS(sc)) { /* * BCM5754 and BCM5787 shares the same ASIC id so @@ -2936,7 +2995,9 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - if (pci_get_max_read_req(dev) != 4096) + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + pci_set_max_read_req(dev, 2048); + else if (pci_get_max_read_req(dev) != 4096) pci_set_max_read_req(dev, 4096); } else { /* Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jun 22 00:16:40 2011 (r223387) +++ stable/7/sys/dev/bge/if_bgereg.h Wed Jun 22 00:17:48 2011 (r223388) @@ -319,6 +319,7 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM57765_A0 0x57785000 #define BGE_CHIPID_BCM57765_B0 0x57785100 @@ -342,6 +343,7 @@ #define BGE_ASICREV_USE_PRODID_REG 0x0f /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ #define BGE_ASICREV_BCM5717 0x5717 +#define BGE_ASICREV_BCM5719 0x5719 #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 @@ -385,6 +387,7 @@ #define BGE_PCIDMARWCTL_RD_CMD_SHIFT(x) ((x) << 24) #define BGE_PCIDMARWCTL_WR_CMD_SHIFT(x) ((x) << 28) +#define BGE_PCIDMARWCTL_TAGGED_STATUS_WA 0x00000080 #define BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK 0x00000380 #define BGE_PCI_READ_BNDRY_DISABLE 0x00000000 @@ -1494,6 +1497,7 @@ #define BGE_BMANMODE_ATTN 0x00000004 #define BGE_BMANMODE_TESTMODE 0x00000008 #define BGE_BMANMODE_LOMBUF_ATTN 0x00000010 +#define BGE_BMANMODE_NO_TX_UNDERRUN 0x80000000 /* Buffer manager status register */ #define BGE_BMANSTAT_ERRO 0x00000004 @@ -1506,6 +1510,7 @@ #define BGE_RDMA_MODE 0x4800 #define BGE_RDMA_STATUS 0x4804 #define BGE_RDMA_RSRVCTRL 0x4900 +#define BGE_RDMA_LSO_CRPTEN_CTRL 0x4910 /* Read DMA mode register */ #define BGE_RDMAMODE_RESET 0x00000001 @@ -1540,6 +1545,15 @@ /* Read DMA Reserved Control register */ #define BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000C00 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000C0000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000FF0 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 + +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 /* * Write DMA control registers @@ -2261,6 +2275,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5715S 0x1679 #define BCOM_DEVICEID_BCM5717 0x1655 #define BCOM_DEVICEID_BCM5718 0x1656 +#define BCOM_DEVICEID_BCM5719 0x1657 #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:21:20 2011 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 463211065676; Wed, 22 Jun 2011 00:21:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35F0B8FC08; Wed, 22 Jun 2011 00:21: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 p5M0LKAI023277; Wed, 22 Jun 2011 00:21:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0LKeE023275; Wed, 22 Jun 2011 00:21:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220021.p5M0LKeE023275@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223389 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:21:20 -0000 Author: yongari Date: Wed Jun 22 00:21:19 2011 New Revision: 223389 URL: http://svn.freebsd.org/changeset/base/223389 Log: MFC r221974: Correctly disable jumbo frame support for BCM5719 A0. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jun 22 00:17:48 2011 (r223388) +++ stable/8/sys/dev/bge/if_bge.c Wed Jun 22 00:21:19 2011 (r223389) @@ -2836,7 +2836,7 @@ bge_attach(device_t dev) if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { /* Jumbo frame on BCM5719 A0 does not work. */ - sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + sc->bge_flags &= ~BGE_FLAG_JUMBO; } break; case BGE_ASICREV_BCM5755: From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:22:26 2011 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 7B43210656E9; Wed, 22 Jun 2011 00:22:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3338FC18; Wed, 22 Jun 2011 00:22: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 p5M0MQPH023352; Wed, 22 Jun 2011 00:22:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0MQrD023350; Wed, 22 Jun 2011 00:22:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220022.p5M0MQrD023350@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:22:26 +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: r223390 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:22:26 -0000 Author: yongari Date: Wed Jun 22 00:22:26 2011 New Revision: 223390 URL: http://svn.freebsd.org/changeset/base/223390 Log: MFC r221974: Correctly disable jumbo frame support for BCM5719 A0. Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jun 22 00:21:19 2011 (r223389) +++ stable/7/sys/dev/bge/if_bge.c Wed Jun 22 00:22:26 2011 (r223390) @@ -2836,7 +2836,7 @@ bge_attach(device_t dev) if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { /* Jumbo frame on BCM5719 A0 does not work. */ - sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + sc->bge_flags &= ~BGE_FLAG_JUMBO; } break; case BGE_ASICREV_BCM5755: From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:35:43 2011 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 29BBB1065787; Wed, 22 Jun 2011 00:35:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3FAD8FC08; Wed, 22 Jun 2011 00:35: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 p5M0Zg0N023758; Wed, 22 Jun 2011 00:35:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0ZgUG023756; Wed, 22 Jun 2011 00:35:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220035.p5M0ZgUG023756@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223391 - stable/8/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: Wed, 22 Jun 2011 00:35:43 -0000 Author: yongari Date: Wed Jun 22 00:35:42 2011 New Revision: 223391 URL: http://svn.freebsd.org/changeset/base/223391 Log: MFC r222581: Poke correct GPIO pins for newer axe(4) controllers with Marvell PHY. Newer models seem to use different LED mode that requires enabling both GPIO1 and GPIO2. Modified: stable/8/sys/dev/usb/net/if_axe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Wed Jun 22 00:22:26 2011 (r223390) +++ stable/8/sys/dev/usb/net/if_axe.c Wed Jun 22 00:35:42 2011 (r223391) @@ -517,7 +517,7 @@ static void axe_ax88178_init(struct axe_softc *sc) { struct usb_ether *ue; - int gpio0, phymode; + int gpio0, ledmode, phymode; uint16_t eeprom, val; ue = &sc->sc_ue; @@ -531,9 +531,11 @@ axe_ax88178_init(struct axe_softc *sc) if (eeprom == 0xffff) { phymode = AXE_PHY_MODE_MARVELL; gpio0 = 1; + ledmode = 0; } else { phymode = eeprom & 0x7f; gpio0 = (eeprom & 0x80) ? 0 : 1; + ledmode = eeprom >> 8; } if (bootverbose) @@ -551,9 +553,22 @@ axe_ax88178_init(struct axe_softc *sc) AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2_EN, hz / 4); AXE_GPIO_WRITE(AXE_GPIO0_EN | AXE_GPIO2 | AXE_GPIO2_EN, hz / 32); - } else + } else { AXE_GPIO_WRITE(AXE_GPIO_RELOAD_EEPROM | AXE_GPIO1 | - AXE_GPIO1_EN, hz / 32); + AXE_GPIO1_EN, hz / 3); + if (ledmode == 1) { + AXE_GPIO_WRITE(AXE_GPIO1_EN, hz / 3); + AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN, + hz / 3); + } else { + AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN | + AXE_GPIO2 | AXE_GPIO2_EN, hz / 32); + AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN | + AXE_GPIO2_EN, hz / 4); + AXE_GPIO_WRITE(AXE_GPIO1 | AXE_GPIO1_EN | + AXE_GPIO2 | AXE_GPIO2_EN, hz / 32); + } + } break; case AXE_PHY_MODE_CICADA: case AXE_PHY_MODE_CICADA_V2: From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:38:26 2011 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 60596106567C; Wed, 22 Jun 2011 00:38:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5060D8FC08; Wed, 22 Jun 2011 00:38: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 p5M0cQjx023893; Wed, 22 Jun 2011 00:38:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0cQ3u023891; Wed, 22 Jun 2011 00:38:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220038.p5M0cQ3u023891@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223392 - stable/8/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:38:26 -0000 Author: yongari Date: Wed Jun 22 00:38:25 2011 New Revision: 223392 URL: http://svn.freebsd.org/changeset/base/223392 Log: MFC r222542: If driver is not running, disable interrupts and do not try to process received frames. Previously it was possible to handle RX interrupts even if controller is not fully initialized. This resulted in non-working driver after system is up and running. Reported by: hselasky Tested by: hselasky Modified: stable/8/sys/dev/nfe/if_nfe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Wed Jun 22 00:35:42 2011 (r223391) +++ stable/8/sys/dev/nfe/if_nfe.c Wed Jun 22 00:38:25 2011 (r223392) @@ -1889,7 +1889,7 @@ nfe_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { NFE_UNLOCK(sc); - nfe_enable_intr(sc); + nfe_disable_intr(sc); return; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:39:36 2011 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 C9D48106577C; Wed, 22 Jun 2011 00:39:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9ACA8FC08; Wed, 22 Jun 2011 00:39: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 p5M0daXv023959; Wed, 22 Jun 2011 00:39:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0da6h023957; Wed, 22 Jun 2011 00:39:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220039.p5M0da6h023957@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:39:36 +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: r223393 - stable/7/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:39:36 -0000 Author: yongari Date: Wed Jun 22 00:39:36 2011 New Revision: 223393 URL: http://svn.freebsd.org/changeset/base/223393 Log: MFC r222542: If driver is not running, disable interrupts and do not try to process received frames. Previously it was possible to handle RX interrupts even if controller is not fully initialized. This resulted in non-working driver after system is up and running. Reported by: hselasky Tested by: hselasky Modified: stable/7/sys/dev/nfe/if_nfe.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Wed Jun 22 00:38:25 2011 (r223392) +++ stable/7/sys/dev/nfe/if_nfe.c Wed Jun 22 00:39:36 2011 (r223393) @@ -1888,7 +1888,7 @@ nfe_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { NFE_UNLOCK(sc); - nfe_enable_intr(sc); + nfe_disable_intr(sc); return; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:48:14 2011 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 4669D1065678; Wed, 22 Jun 2011 00:48:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3584E8FC1B; Wed, 22 Jun 2011 00:48: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 p5M0mEV9024288; Wed, 22 Jun 2011 00:48:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0mEct024285; Wed, 22 Jun 2011 00:48:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220048.p5M0mEct024285@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223394 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:48:14 -0000 Author: yongari Date: Wed Jun 22 00:48:13 2011 New Revision: 223394 URL: http://svn.freebsd.org/changeset/base/223394 Log: MFC r205091,216860: r205091: Implement Rx checksum offloading for Yukon EC, Yukon Ultra, Yukon FE and Yukon Ultra2. These controllers provide very simple checksum computation mechanism and it requires additional pseudo header checksum computation in upper stack. Even though I couldn't see much performance difference with/without Rx checksum offloading it may help notebook based controllers. Actually controller can compute two checksum value by giving different starting position of checksum computation on received frame. However, for long time, Marvell's checksum offloading engine have been known to have several silicon bugs so don't blindly trust computed partial checksum value. Instead, compute partial checksum twice by giving the same checksum computation position and compare the result. If the value is different it's clear indication of hardware bug. This configuration lose IP checksum offloading capability but I think it's better to take safe route. Note, Rx checksum offloading for Yukon XL was still disabled due to known silicon bug. r216860: Fix endianness bug introduced in r205091. After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Wed Jun 22 00:39:36 2011 (r223393) +++ stable/8/sys/dev/msk/if_msk.c Wed Jun 22 00:48:13 2011 (r223394) @@ -270,6 +270,7 @@ static void msk_intr_hwerr(struct msk_so #ifndef __NO_STRICT_ALIGNMENT static __inline void msk_fixup_rx(struct mbuf *); #endif +static __inline void msk_rxcsum(struct msk_if_softc *, uint32_t, struct mbuf *); static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); @@ -294,6 +295,7 @@ static int msk_txrx_dma_alloc(struct msk static int msk_rx_dma_jalloc(struct msk_if_softc *); static void msk_txrx_dma_free(struct msk_if_softc *); static void msk_rx_dma_jfree(struct msk_if_softc *); +static int msk_rx_fill(struct msk_if_softc *, int); static int msk_init_rx_ring(struct msk_if_softc *); static int msk_init_jumbo_rx_ring(struct msk_if_softc *); static void msk_init_tx_ring(struct msk_if_softc *); @@ -642,6 +644,54 @@ msk_setvlan(struct msk_if_softc *sc_if, } static int +msk_rx_fill(struct msk_if_softc *sc_if, int jumbo) +{ + uint16_t idx; + int i; + + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + /* Wait until controller executes OP_TCPSTART command. */ + for (i = 10; i > 0; i--) { + DELAY(10); + idx = CSR_READ_2(sc_if->msk_softc, + Y2_PREF_Q_ADDR(sc_if->msk_rxq, + PREF_UNIT_GET_IDX_REG)); + if (idx != 0) + break; + } + if (i == 0) { + device_printf(sc_if->msk_if_dev, + "prefetch unit stuck?\n"); + return (ETIMEDOUT); + } + /* + * Fill consumed LE with free buffer. This can be done + * in Rx handler but we don't want to add special code + * in fast handler. + */ + if (jumbo > 0) { + if (msk_jumbo_newbuf(sc_if, 0) != 0) + return (ENOBUFS); + bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + sc_if->msk_cdata.msk_jumbo_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } else { + if (msk_newbuf(sc_if, 0) != 0) + return (ENOBUFS); + bus_dmamap_sync(sc_if->msk_cdata.msk_rx_ring_tag, + sc_if->msk_cdata.msk_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + sc_if->msk_cdata.msk_rx_prod = 0; + CSR_WRITE_2(sc_if->msk_softc, + Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), + sc_if->msk_cdata.msk_rx_prod); + } + return (0); +} + +static int msk_init_rx_ring(struct msk_if_softc *sc_if) { struct msk_ring_data *rd; @@ -657,7 +707,21 @@ msk_init_rx_ring(struct msk_if_softc *sc rd = &sc_if->msk_rdata; bzero(rd->msk_rx_ring, sizeof(struct msk_rx_desc) * MSK_RX_RING_CNT); prod = sc_if->msk_cdata.msk_rx_prod; - for (i = 0; i < MSK_RX_RING_CNT; i++) { + i = 0; + /* Have controller know how to compute Rx checksum. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); + i++; + } + for (; i < MSK_RX_RING_CNT; i++) { rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_rx_ring[prod]; @@ -675,7 +739,8 @@ msk_init_rx_ring(struct msk_if_softc *sc CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), sc_if->msk_cdata.msk_rx_prod); - + if (msk_rx_fill(sc_if, 0) != 0) + return (ENOBUFS); return (0); } @@ -696,7 +761,21 @@ msk_init_jumbo_rx_ring(struct msk_if_sof bzero(rd->msk_jumbo_rx_ring, sizeof(struct msk_rx_desc) * MSK_JUMBO_RX_RING_CNT); prod = sc_if->msk_cdata.msk_rx_prod; - for (i = 0; i < MSK_JUMBO_RX_RING_CNT; i++) { + i = 0; + /* Have controller know how to compute Rx checksum. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); + i++; + } + for (; i < MSK_JUMBO_RX_RING_CNT; i++) { rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; @@ -713,7 +792,8 @@ msk_init_jumbo_rx_ring(struct msk_if_sof CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), sc_if->msk_cdata.msk_rx_prod); - + if (msk_rx_fill(sc_if, 1) != 0) + return (ENOBUFS); return (0); } @@ -922,7 +1002,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm struct msk_if_softc *sc_if; struct ifreq *ifr; struct mii_data *mii; - int error, mask; + int error, mask, reinit; sc_if = ifp->if_softc; ifr = (struct ifreq *)data; @@ -981,6 +1061,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + reinit = 0; MSK_IF_LOCK(sc_if); mask = ifr->ifr_reqcap ^ ifp->if_capenable; if ((mask & IFCAP_TXCSUM) != 0 && @@ -992,8 +1073,11 @@ msk_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } if ((mask & IFCAP_RXCSUM) != 0 && - (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_RXCSUM; + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0) + reinit = 1; + } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -1021,8 +1105,11 @@ msk_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } - VLAN_CAPABILITIES(ifp); + if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } MSK_IF_UNLOCK(sc_if); break; default: @@ -1485,23 +1572,14 @@ msk_attach(device_t dev) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - /* - * IFCAP_RXCSUM capability is intentionally disabled as the hardware - * has serious bug in Rx checksum offload for all Yukon II family - * hardware. It seems there is a workaround to make it work somtimes. - * However, the workaround also have to check OP code sequences to - * verify whether the OP code is correct. Sometimes it should compute - * IP/TCP/UDP checksum in driver in order to verify correctness of - * checksum computed by hardware. If you have to compute checksum - * with software to verify the hardware's checksum why have hardware - * compute the checksum? I think there is no reason to spend time to - * make Rx checksum offload work on Yukon II hardware. - */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; /* - * Enable Rx checksum offloading if controller support new - * descriptor format. + * Enable Rx checksum offloading if controller supports + * new descriptor formant and controller is not Yukon XL. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + sc->msk_hw_id != CHIP_ID_YUKON_XL) + ifp->if_capabilities |= IFCAP_RXCSUM; if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_RXCSUM; @@ -2919,6 +2997,96 @@ msk_fixup_rx(struct mbuf *m) } #endif +static __inline void +msk_rxcsum(struct msk_if_softc *sc_if, uint32_t control, struct mbuf *m) +{ + struct ether_header *eh; + struct ip *ip; + struct udphdr *uh; + int32_t hlen, len, pktlen, temp32; + uint16_t csum, *opts; + + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) { + if ((control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } + return; + } + /* + * Marvell Yukon controllers that support OP_RXCHKS has known + * to have various Rx checksum offloading bugs. These + * controllers can be configured to compute simple checksum + * at two different positions. So we can compute IP and TCP/UDP + * checksum at the same time. We intentionally have controller + * compute TCP/UDP checksum twice by specifying the same + * checksum start position and compare the result. If the value + * is different it would indicate the hardware logic was wrong. + */ + if ((sc_if->msk_csum & 0xFFFF) != (sc_if->msk_csum >> 16)) { + if (bootverbose) + device_printf(sc_if->msk_if_dev, + "Rx checksum value mismatch!\n"); + return; + } + pktlen = m->m_pkthdr.len; + if (pktlen < sizeof(struct ether_header) + sizeof(struct ip)) + return; + eh = mtod(m, struct ether_header *); + if (eh->ether_type != htons(ETHERTYPE_IP)) + return; + ip = (struct ip *)(eh + 1); + if (ip->ip_v != IPVERSION) + return; + + hlen = ip->ip_hl << 2; + pktlen -= sizeof(struct ether_header); + if (hlen < sizeof(struct ip)) + return; + if (ntohs(ip->ip_len) < hlen) + return; + if (ntohs(ip->ip_len) != pktlen) + return; + if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) + return; /* can't handle fragmented packet. */ + + switch (ip->ip_p) { + case IPPROTO_TCP: + if (pktlen < (hlen + sizeof(struct tcphdr))) + return; + break; + case IPPROTO_UDP: + if (pktlen < (hlen + sizeof(struct udphdr))) + return; + uh = (struct udphdr *)((caddr_t)ip + hlen); + if (uh->uh_sum == 0) + return; /* no checksum */ + break; + default: + return; + } + csum = bswap16(sc_if->msk_csum & 0xFFFF); + /* Checksum fixup for IP options. */ + len = hlen - sizeof(struct ip); + if (len > 0) { + opts = (uint16_t *)(ip + 1); + for (; len > 0; len -= sizeof(uint16_t), opts++) { + temp32 = csum - *opts; + temp32 = (temp32 >> 16) + (temp32 & 65535); + csum = temp32 & 65535; + } + } + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + m->m_pkthdr.csum_data = csum; +} + static void msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, int len) @@ -2973,18 +3141,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_fixup_rx(m); #endif ifp->if_ipackets++; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && - (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((control & CSS_IPV4_CSUM_OK) != 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - if ((control & (CSS_TCP | CSS_UDP)) != 0 && - (control & (CSS_TCPUDP_CSUM_OK)) != 0) { - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } - } + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3043,18 +3201,8 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_fixup_rx(m); #endif ifp->if_ipackets++; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && - (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((control & CSS_IPV4_CSUM_OK) != 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - if ((control & (CSS_TCP | CSS_UDP)) != 0 && - (control & (CSS_TCPUDP_CSUM_OK)) != 0) { - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } - } + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3371,6 +3519,9 @@ msk_handle_events(struct msk_softc *sc) break; case OP_RXCHKSVLAN: sc_if->msk_vtag = ntohs(len); + /* FALLTHROUGH */ + case OP_RXCHKS: + sc_if->msk_csum = status; break; case OP_RXSTAT: if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING)) @@ -3758,8 +3909,13 @@ msk_init_locked(struct msk_if_softc *sc_ msk_init_tx_ring(sc_if); /* Disable Rx checksum offload and RSS hash. */ - CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_rxq, Q_CSR), - BMU_DIS_RX_CHKSUM | BMU_DIS_RX_RSS_HASH); + reg = BMU_DIS_RX_RSS_HASH; + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (ifp->if_capenable & IFCAP_RXCSUM) != 0) + reg |= BMU_ENA_RX_CHKSUM; + else + reg |= BMU_DIS_RX_CHKSUM; + CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_rxq, Q_CSR), reg); if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) { msk_set_prefetch(sc, sc_if->msk_rxq, sc_if->msk_rdata.msk_jumbo_rx_ring_paddr, Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 00:39:36 2011 (r223393) +++ stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 00:48:13 2011 (r223394) @@ -2555,6 +2555,7 @@ struct msk_if_softc { struct msk_hw_stats msk_stats; int msk_if_flags; uint16_t msk_vtag; /* VLAN tag id. */ + uint32_t msk_csum; }; #define MSK_TIMEOUT 1000 From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 00:49:24 2011 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 BC8B5106575A; Wed, 22 Jun 2011 00:49:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB9238FC08; Wed, 22 Jun 2011 00:49: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 p5M0nOFi024356; Wed, 22 Jun 2011 00:49:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M0nOmH024353; Wed, 22 Jun 2011 00:49:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220049.p5M0nOmH024353@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 00:49:24 +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: r223395 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 00:49:24 -0000 Author: yongari Date: Wed Jun 22 00:49:24 2011 New Revision: 223395 URL: http://svn.freebsd.org/changeset/base/223395 Log: MFC r205091,216860: r205091: Implement Rx checksum offloading for Yukon EC, Yukon Ultra, Yukon FE and Yukon Ultra2. These controllers provide very simple checksum computation mechanism and it requires additional pseudo header checksum computation in upper stack. Even though I couldn't see much performance difference with/without Rx checksum offloading it may help notebook based controllers. Actually controller can compute two checksum value by giving different starting position of checksum computation on received frame. However, for long time, Marvell's checksum offloading engine have been known to have several silicon bugs so don't blindly trust computed partial checksum value. Instead, compute partial checksum twice by giving the same checksum computation position and compare the result. If the value is different it's clear indication of hardware bug. This configuration lose IP checksum offloading capability but I think it's better to take safe route. Note, Rx checksum offloading for Yukon XL was still disabled due to known silicon bug. r216860: Fix endianness bug introduced in r205091. After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Jun 22 00:48:13 2011 (r223394) +++ stable/7/sys/dev/msk/if_msk.c Wed Jun 22 00:49:24 2011 (r223395) @@ -270,6 +270,7 @@ static void msk_intr_hwerr(struct msk_so #ifndef __NO_STRICT_ALIGNMENT static __inline void msk_fixup_rx(struct mbuf *); #endif +static __inline void msk_rxcsum(struct msk_if_softc *, uint32_t, struct mbuf *); static void msk_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_jumbo_rxeof(struct msk_if_softc *, uint32_t, uint32_t, int); static void msk_txeof(struct msk_if_softc *, int); @@ -294,6 +295,7 @@ static int msk_txrx_dma_alloc(struct msk static int msk_rx_dma_jalloc(struct msk_if_softc *); static void msk_txrx_dma_free(struct msk_if_softc *); static void msk_rx_dma_jfree(struct msk_if_softc *); +static int msk_rx_fill(struct msk_if_softc *, int); static int msk_init_rx_ring(struct msk_if_softc *); static int msk_init_jumbo_rx_ring(struct msk_if_softc *); static void msk_init_tx_ring(struct msk_if_softc *); @@ -642,6 +644,54 @@ msk_setvlan(struct msk_if_softc *sc_if, } static int +msk_rx_fill(struct msk_if_softc *sc_if, int jumbo) +{ + uint16_t idx; + int i; + + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + /* Wait until controller executes OP_TCPSTART command. */ + for (i = 10; i > 0; i--) { + DELAY(10); + idx = CSR_READ_2(sc_if->msk_softc, + Y2_PREF_Q_ADDR(sc_if->msk_rxq, + PREF_UNIT_GET_IDX_REG)); + if (idx != 0) + break; + } + if (i == 0) { + device_printf(sc_if->msk_if_dev, + "prefetch unit stuck?\n"); + return (ETIMEDOUT); + } + /* + * Fill consumed LE with free buffer. This can be done + * in Rx handler but we don't want to add special code + * in fast handler. + */ + if (jumbo > 0) { + if (msk_jumbo_newbuf(sc_if, 0) != 0) + return (ENOBUFS); + bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, + sc_if->msk_cdata.msk_jumbo_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } else { + if (msk_newbuf(sc_if, 0) != 0) + return (ENOBUFS); + bus_dmamap_sync(sc_if->msk_cdata.msk_rx_ring_tag, + sc_if->msk_cdata.msk_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + sc_if->msk_cdata.msk_rx_prod = 0; + CSR_WRITE_2(sc_if->msk_softc, + Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), + sc_if->msk_cdata.msk_rx_prod); + } + return (0); +} + +static int msk_init_rx_ring(struct msk_if_softc *sc_if) { struct msk_ring_data *rd; @@ -657,7 +707,21 @@ msk_init_rx_ring(struct msk_if_softc *sc rd = &sc_if->msk_rdata; bzero(rd->msk_rx_ring, sizeof(struct msk_rx_desc) * MSK_RX_RING_CNT); prod = sc_if->msk_cdata.msk_rx_prod; - for (i = 0; i < MSK_RX_RING_CNT; i++) { + i = 0; + /* Have controller know how to compute Rx checksum. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); + i++; + } + for (; i < MSK_RX_RING_CNT; i++) { rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_rx_ring[prod]; @@ -675,7 +739,8 @@ msk_init_rx_ring(struct msk_if_softc *sc CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), sc_if->msk_cdata.msk_rx_prod); - + if (msk_rx_fill(sc_if, 0) != 0) + return (ENOBUFS); return (0); } @@ -696,7 +761,21 @@ msk_init_jumbo_rx_ring(struct msk_if_sof bzero(rd->msk_jumbo_rx_ring, sizeof(struct msk_rx_desc) * MSK_JUMBO_RX_RING_CNT); prod = sc_if->msk_cdata.msk_rx_prod; - for (i = 0; i < MSK_JUMBO_RX_RING_CNT; i++) { + i = 0; + /* Have controller know how to compute Rx checksum. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { + rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); + i++; + } + for (; i < MSK_JUMBO_RX_RING_CNT; i++) { rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; @@ -713,7 +792,8 @@ msk_init_jumbo_rx_ring(struct msk_if_sof CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), sc_if->msk_cdata.msk_rx_prod); - + if (msk_rx_fill(sc_if, 1) != 0) + return (ENOBUFS); return (0); } @@ -922,7 +1002,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm struct msk_if_softc *sc_if; struct ifreq *ifr; struct mii_data *mii; - int error, mask; + int error, mask, reinit; sc_if = ifp->if_softc; ifr = (struct ifreq *)data; @@ -981,6 +1061,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + reinit = 0; MSK_IF_LOCK(sc_if); mask = ifr->ifr_reqcap ^ ifp->if_capenable; if ((mask & IFCAP_TXCSUM) != 0 && @@ -992,8 +1073,11 @@ msk_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist &= ~MSK_CSUM_FEATURES; } if ((mask & IFCAP_RXCSUM) != 0 && - (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) { ifp->if_capenable ^= IFCAP_RXCSUM; + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0) + reinit = 1; + } if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (IFCAP_VLAN_HWCSUM & ifp->if_capabilities) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -1021,8 +1105,11 @@ msk_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist &= ~(MSK_CSUM_FEATURES | CSUM_TSO); ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } - VLAN_CAPABILITIES(ifp); + if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } MSK_IF_UNLOCK(sc_if); break; default: @@ -1485,23 +1572,14 @@ msk_attach(device_t dev) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - /* - * IFCAP_RXCSUM capability is intentionally disabled as the hardware - * has serious bug in Rx checksum offload for all Yukon II family - * hardware. It seems there is a workaround to make it work somtimes. - * However, the workaround also have to check OP code sequences to - * verify whether the OP code is correct. Sometimes it should compute - * IP/TCP/UDP checksum in driver in order to verify correctness of - * checksum computed by hardware. If you have to compute checksum - * with software to verify the hardware's checksum why have hardware - * compute the checksum? I think there is no reason to spend time to - * make Rx checksum offload work on Yukon II hardware. - */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_TSO4; /* - * Enable Rx checksum offloading if controller support new - * descriptor format. + * Enable Rx checksum offloading if controller supports + * new descriptor formant and controller is not Yukon XL. */ + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + sc->msk_hw_id != CHIP_ID_YUKON_XL) + ifp->if_capabilities |= IFCAP_RXCSUM; if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0 && (sc_if->msk_flags & MSK_FLAG_NORX_CSUM) == 0) ifp->if_capabilities |= IFCAP_RXCSUM; @@ -2919,6 +2997,96 @@ msk_fixup_rx(struct mbuf *m) } #endif +static __inline void +msk_rxcsum(struct msk_if_softc *sc_if, uint32_t control, struct mbuf *m) +{ + struct ether_header *eh; + struct ip *ip; + struct udphdr *uh; + int32_t hlen, len, pktlen, temp32; + uint16_t csum, *opts; + + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) != 0) { + if ((control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; + if ((control & CSS_IPV4_CSUM_OK) != 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((control & (CSS_TCP | CSS_UDP)) != 0 && + (control & (CSS_TCPUDP_CSUM_OK)) != 0) { + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | + CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } + return; + } + /* + * Marvell Yukon controllers that support OP_RXCHKS has known + * to have various Rx checksum offloading bugs. These + * controllers can be configured to compute simple checksum + * at two different positions. So we can compute IP and TCP/UDP + * checksum at the same time. We intentionally have controller + * compute TCP/UDP checksum twice by specifying the same + * checksum start position and compare the result. If the value + * is different it would indicate the hardware logic was wrong. + */ + if ((sc_if->msk_csum & 0xFFFF) != (sc_if->msk_csum >> 16)) { + if (bootverbose) + device_printf(sc_if->msk_if_dev, + "Rx checksum value mismatch!\n"); + return; + } + pktlen = m->m_pkthdr.len; + if (pktlen < sizeof(struct ether_header) + sizeof(struct ip)) + return; + eh = mtod(m, struct ether_header *); + if (eh->ether_type != htons(ETHERTYPE_IP)) + return; + ip = (struct ip *)(eh + 1); + if (ip->ip_v != IPVERSION) + return; + + hlen = ip->ip_hl << 2; + pktlen -= sizeof(struct ether_header); + if (hlen < sizeof(struct ip)) + return; + if (ntohs(ip->ip_len) < hlen) + return; + if (ntohs(ip->ip_len) != pktlen) + return; + if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) + return; /* can't handle fragmented packet. */ + + switch (ip->ip_p) { + case IPPROTO_TCP: + if (pktlen < (hlen + sizeof(struct tcphdr))) + return; + break; + case IPPROTO_UDP: + if (pktlen < (hlen + sizeof(struct udphdr))) + return; + uh = (struct udphdr *)((caddr_t)ip + hlen); + if (uh->uh_sum == 0) + return; /* no checksum */ + break; + default: + return; + } + csum = bswap16(sc_if->msk_csum & 0xFFFF); + /* Checksum fixup for IP options. */ + len = hlen - sizeof(struct ip); + if (len > 0) { + opts = (uint16_t *)(ip + 1); + for (; len > 0; len -= sizeof(uint16_t), opts++) { + temp32 = csum - *opts; + temp32 = (temp32 >> 16) + (temp32 & 65535); + csum = temp32 & 65535; + } + } + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + m->m_pkthdr.csum_data = csum; +} + static void msk_rxeof(struct msk_if_softc *sc_if, uint32_t status, uint32_t control, int len) @@ -2973,18 +3141,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_fixup_rx(m); #endif ifp->if_ipackets++; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && - (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((control & CSS_IPV4_CSUM_OK) != 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - if ((control & (CSS_TCP | CSS_UDP)) != 0 && - (control & (CSS_TCPUDP_CSUM_OK)) != 0) { - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } - } + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3043,18 +3201,8 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_fixup_rx(m); #endif ifp->if_ipackets++; - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 && - (control & (CSS_IPV4 | CSS_IPFRAG)) == CSS_IPV4) { - m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; - if ((control & CSS_IPV4_CSUM_OK) != 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - if ((control & (CSS_TCP | CSS_UDP)) != 0 && - (control & (CSS_TCPUDP_CSUM_OK)) != 0) { - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } - } + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) + msk_rxcsum(sc_if, control, m); /* Check for VLAN tagged packets. */ if ((status & GMR_FS_VLAN) != 0 && (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { @@ -3371,6 +3519,9 @@ msk_handle_events(struct msk_softc *sc) break; case OP_RXCHKSVLAN: sc_if->msk_vtag = ntohs(len); + /* FALLTHROUGH */ + case OP_RXCHKS: + sc_if->msk_csum = status; break; case OP_RXSTAT: if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING)) @@ -3758,8 +3909,13 @@ msk_init_locked(struct msk_if_softc *sc_ msk_init_tx_ring(sc_if); /* Disable Rx checksum offload and RSS hash. */ - CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_rxq, Q_CSR), - BMU_DIS_RX_CHKSUM | BMU_DIS_RX_RSS_HASH); + reg = BMU_DIS_RX_RSS_HASH; + if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && + (ifp->if_capenable & IFCAP_RXCSUM) != 0) + reg |= BMU_ENA_RX_CHKSUM; + else + reg |= BMU_DIS_RX_CHKSUM; + CSR_WRITE_4(sc, Q_ADDR(sc_if->msk_rxq, Q_CSR), reg); if (sc_if->msk_framesize > (MCLBYTES - MSK_RX_BUF_ALIGN)) { msk_set_prefetch(sc, sc_if->msk_rxq, sc_if->msk_rdata.msk_jumbo_rx_ring_paddr, Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 00:48:13 2011 (r223394) +++ stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 00:49:24 2011 (r223395) @@ -2555,6 +2555,7 @@ struct msk_if_softc { struct msk_hw_stats msk_stats; int msk_if_flags; uint16_t msk_vtag; /* VLAN tag id. */ + uint32_t msk_csum; }; #define MSK_TIMEOUT 1000 From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:42:53 2011 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 2CB961065751; Wed, 22 Jun 2011 01:42:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4CB8FC15; Wed, 22 Jun 2011 01: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 p5M1gqgL026121; Wed, 22 Jun 2011 01:42:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1gqdu026118; Wed, 22 Jun 2011 01:42:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220142.p5M1gqdu026118@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:42: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: r223396 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:42:53 -0000 Author: yongari Date: Wed Jun 22 01:42:52 2011 New Revision: 223396 URL: http://svn.freebsd.org/changeset/base/223396 Log: MFC r222219,222221,222223,222226-222227,222231,222516: Merge all relevant changes from HEAD to fix long standing instability issues of msk(4). To get desired effect of this merge, cold restarting is required because incorrectly programmed registers are not reset to default value. PR: kern/114631, kern/116853, kern/139093, kern/144206, kern/147824, kern/151169, kern/154591, kern/155636, kern/156493 r222219: Do not blindly clear entire GPHY control register. It seems some bits of the register is used for other purposes such that clearing these bits resulted in unexpected results such as corrupted RX frames or missing LE status updates. For old controllers like Yukon EC it had no effect but it caused all kind of troubles on Yukon Supreme. This change shall improve stability of controllers like Yukon Ultra, Ultra2, Extreme, Optima and Supreme. r222221: Rework store and forward configuration of TX MAC FIFO. Basically it enables store and forward mode except for jumbo frame on Yukon Ultra. r222223: Do not configure RAM registers for controllers that do not have them. These registers are defined only for Yukon XL, Yukon EC and Yukon FE. r222226: Make sure to enable all clocks before accessing registers. Releasing PHY from power down/COMA is done after enabling all clocks. While I'm here remove unnecessary controller reset. r222227: Do not touch ASF related register for controllers that do not have these registers. Also disable Watchdog of ASF microcontroller. r222231: When MTU is changed, check whether driver should be reinitialized or not. If reinitialized is required, clear driver running flag. r222516: Correctly check MAC running status before disabling TX/RX MACs. Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Wed Jun 22 00:49:24 2011 (r223395) +++ stable/8/sys/dev/msk/if_msk.c Wed Jun 22 01:42:52 2011 (r223396) @@ -562,7 +562,7 @@ msk_miibus_statchg(device_t dev) msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0); /* Disable Rx/Tx MAC. */ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); - if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) { + if ((gmac & (GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)) != 0) { gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); /* Read again to ensure writing. */ @@ -1030,7 +1030,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm } } ifp->if_mtu = ifr->ifr_mtu; - msk_init_locked(sc_if); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } } MSK_IF_UNLOCK(sc_if); break; @@ -1212,37 +1215,30 @@ msk_phy_power(struct msk_softc *sc, int */ CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val); - val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); - val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); + our &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ - val |= PCI_Y2_PHY1_COMA; + our |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) - val |= PCI_Y2_PHY2_COMA; + our |= PCI_Y2_PHY2_COMA; } } - /* Release PHY from PowerDown/COMA mode. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EC_U: - case CHIP_ID_YUKON_EX: - case CHIP_ID_YUKON_FE_P: - case CHIP_ID_YUKON_UL_2: - case CHIP_ID_YUKON_OPT: - CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); - - /* Enable all clocks. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); - our &= (PCI_FORCE_ASPM_REQUEST|PCI_ASPM_GPHY_LINK_DOWN| - PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); + if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U || + sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id >= CHIP_ID_YUKON_FE_P) { + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); + val &= (PCI_FORCE_ASPM_REQUEST | + PCI_ASPM_GPHY_LINK_DOWN | PCI_ASPM_INT_FIFO_EMPTY | + PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, our); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); - our &= PCI_CTL_TIM_VMAIN_AV_MSK; - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, our); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, val); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); + val &= PCI_CTL_TIM_VMAIN_AV_MSK; + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, val); CSR_PCI_WRITE_4(sc, PCI_CFG_REG_1, 0); + CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_ON); /* * Disable status race, workaround for * Yukon EC Ultra & Yukon EX. @@ -1251,10 +1247,10 @@ msk_phy_power(struct msk_softc *sc, int val |= GLB_GPIO_STAT_RACE_DIS; CSR_WRITE_4(sc, B2_GP_IO, val); CSR_READ_4(sc, B2_GP_IO); - break; - default: - break; } + /* Release PHY from PowerDown/COMA mode. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, our); + for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1300,28 +1296,33 @@ mskc_reset(struct msk_softc *sc) bus_addr_t addr; uint16_t status; uint32_t val; - int i; - - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + int i, initram; /* Disable ASF. */ - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { - status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); - /* Clear AHB bridge & microcontroller reset. */ - status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | - Y2_ASF_HCU_CCSR_CPU_RST_MODE); - /* Clear ASF microcontroller state. */ - status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; - CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); - } else - CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - - /* - * Since we disabled ASF, S/W reset is required for Power Management. - */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + if (sc->msk_hw_id >= CHIP_ID_YUKON_XL && + sc->msk_hw_id <= CHIP_ID_YUKON_SUPR) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~Y2_ASF_HCU_CCSR_UC_STATE_MSK; + status &= ~Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* + * Since we disabled ASF, S/W reset is required for + * Power Management. + */ + CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + } /* Clear all error bits in the PCI status register. */ status = pci_read_config(sc->msk_dev, PCIR_STATUS, 2); @@ -1362,8 +1363,8 @@ mskc_reset(struct msk_softc *sc) /* Reset GPHY/GMAC Control */ for (i = 0; i < sc->msk_num_port; i++) { /* GPHY Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); /* GMAC Control reset. */ CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); @@ -1396,8 +1397,14 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_STOP); CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); + initram = 0; + if (sc->msk_hw_id == CHIP_ID_YUKON_XL || + sc->msk_hw_id == CHIP_ID_YUKON_EC || + sc->msk_hw_id == CHIP_ID_YUKON_FE) + initram++; + /* Configure timeout values. */ - for (i = 0; i < sc->msk_num_port; i++) { + for (i = 0; initram > 0 && i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_SET); CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_CLR); CSR_WRITE_1(sc, SELECT_RAM_BUFFER(i, B3_RI_WTO_R1), @@ -1708,6 +1715,9 @@ mskc_attach(device_t dev) } } + /* Enable all clocks before accessing any registers. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_hw_id = CSR_READ_1(sc, B2_CHIP_ID); sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; @@ -1748,9 +1758,6 @@ mskc_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "int_holdoff", &sc->msk_int_holdoff); - /* Soft reset. */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); /* Check number of MACs. */ sc->msk_num_port = 1; @@ -2964,6 +2971,7 @@ mskc_resume(device_t dev) MSK_LOCK(sc); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); mskc_reset(sc); for (i = 0; i < sc->msk_num_port; i++) { if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && @@ -3655,37 +3663,24 @@ msk_set_tx_stfwd(struct msk_if_softc *sc ifp = sc_if->msk_ifp; sc = sc_if->msk_softc; - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EX: - if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) - goto yukon_ex_workaround; - if (ifp->if_mtu > ETHERMTU) - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_ENA); - else - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - break; - default: -yukon_ex_workaround: + if ((sc->msk_hw_id == CHIP_ID_YUKON_EX && + sc->msk_hw_rev != CHIP_REV_YU_EX_A0) || + sc->msk_hw_id >= CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); + } else { if (ifp->if_mtu > ETHERMTU) { /* Set Tx GMAC FIFO Almost Empty Threshold. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_DIS); } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); } - break; } } Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 00:49:24 2011 (r223395) +++ stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 01:42:52 2011 (r223396) @@ -677,6 +677,7 @@ /* ASF Subsystem Registers (Yukon-2 only) */ #define B28_Y2_SMB_CONFIG 0x0e40 /* 32 bit ASF SMBus Config Register */ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ +#define B28_Y2_CPU_WDOG 0x0e48 /* 32 bit Watchdog Register */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ #define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:44:09 2011 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 8418F1065778; Wed, 22 Jun 2011 01:44:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72D538FC19; Wed, 22 Jun 2011 01:44: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 p5M1i90c026206; Wed, 22 Jun 2011 01:44:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1i91T026203; Wed, 22 Jun 2011 01:44:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220144.p5M1i91T026203@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:44:09 +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: r223397 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:44:09 -0000 Author: yongari Date: Wed Jun 22 01:44:09 2011 New Revision: 223397 URL: http://svn.freebsd.org/changeset/base/223397 Log: MFC r222219,222221,222223,222226-222227,222231,222516: Merge all relevant changes from HEAD to fix long standing instability issues of msk(4). To get desired effect of this merge, cold restarting is required because incorrectly programmed registers are not reset to default value. PR: kern/114631, kern/116853, kern/139093, kern/144206, kern/147824, kern/151169, kern/154591, kern/155636, kern/156493 r222219: Do not blindly clear entire GPHY control register. It seems some bits of the register is used for other purposes such that clearing these bits resulted in unexpected results such as corrupted RX frames or missing LE status updates. For old controllers like Yukon EC it had no effect but it caused all kind of troubles on Yukon Supreme. This change shall improve stability of controllers like Yukon Ultra, Ultra2, Extreme, Optima and Supreme. r222221: Rework store and forward configuration of TX MAC FIFO. Basically it enables store and forward mode except for jumbo frame on Yukon Ultra. r222223: Do not configure RAM registers for controllers that do not have them. These registers are defined only for Yukon XL, Yukon EC and Yukon FE. r222226: Make sure to enable all clocks before accessing registers. Releasing PHY from power down/COMA is done after enabling all clocks. While I'm here remove unnecessary controller reset. r222227: Do not touch ASF related register for controllers that do not have these registers. Also disable Watchdog of ASF microcontroller. r222231: When MTU is changed, check whether driver should be reinitialized or not. If reinitialized is required, clear driver running flag. r222516: Correctly check MAC running status before disabling TX/RX MACs. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:42:52 2011 (r223396) +++ stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:44:09 2011 (r223397) @@ -562,7 +562,7 @@ msk_miibus_statchg(device_t dev) msk_phy_writereg(sc_if, PHY_ADDR_MARV, PHY_MARV_INT_MASK, 0); /* Disable Rx/Tx MAC. */ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); - if ((GM_GPCR_RX_ENA | GM_GPCR_TX_ENA) != 0) { + if ((gmac & (GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)) != 0) { gmac &= ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA); GMAC_WRITE_2(sc, sc_if->msk_port, GM_GP_CTRL, gmac); /* Read again to ensure writing. */ @@ -1030,7 +1030,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm } } ifp->if_mtu = ifr->ifr_mtu; - msk_init_locked(sc_if); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } } MSK_IF_UNLOCK(sc_if); break; @@ -1212,37 +1215,30 @@ msk_phy_power(struct msk_softc *sc, int */ CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val); - val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); - val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); + our &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ - val |= PCI_Y2_PHY1_COMA; + our |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) - val |= PCI_Y2_PHY2_COMA; + our |= PCI_Y2_PHY2_COMA; } } - /* Release PHY from PowerDown/COMA mode. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EC_U: - case CHIP_ID_YUKON_EX: - case CHIP_ID_YUKON_FE_P: - case CHIP_ID_YUKON_UL_2: - case CHIP_ID_YUKON_OPT: - CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); - - /* Enable all clocks. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); - our &= (PCI_FORCE_ASPM_REQUEST|PCI_ASPM_GPHY_LINK_DOWN| - PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); + if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U || + sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id >= CHIP_ID_YUKON_FE_P) { + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); + val &= (PCI_FORCE_ASPM_REQUEST | + PCI_ASPM_GPHY_LINK_DOWN | PCI_ASPM_INT_FIFO_EMPTY | + PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, our); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); - our &= PCI_CTL_TIM_VMAIN_AV_MSK; - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, our); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, val); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); + val &= PCI_CTL_TIM_VMAIN_AV_MSK; + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, val); CSR_PCI_WRITE_4(sc, PCI_CFG_REG_1, 0); + CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_ON); /* * Disable status race, workaround for * Yukon EC Ultra & Yukon EX. @@ -1251,10 +1247,10 @@ msk_phy_power(struct msk_softc *sc, int val |= GLB_GPIO_STAT_RACE_DIS; CSR_WRITE_4(sc, B2_GP_IO, val); CSR_READ_4(sc, B2_GP_IO); - break; - default: - break; } + /* Release PHY from PowerDown/COMA mode. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, our); + for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1300,28 +1296,33 @@ mskc_reset(struct msk_softc *sc) bus_addr_t addr; uint16_t status; uint32_t val; - int i; - - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + int i, initram; /* Disable ASF. */ - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { - status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); - /* Clear AHB bridge & microcontroller reset. */ - status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | - Y2_ASF_HCU_CCSR_CPU_RST_MODE); - /* Clear ASF microcontroller state. */ - status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; - CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); - } else - CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - - /* - * Since we disabled ASF, S/W reset is required for Power Management. - */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + if (sc->msk_hw_id >= CHIP_ID_YUKON_XL && + sc->msk_hw_id <= CHIP_ID_YUKON_SUPR) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~Y2_ASF_HCU_CCSR_UC_STATE_MSK; + status &= ~Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* + * Since we disabled ASF, S/W reset is required for + * Power Management. + */ + CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + } /* Clear all error bits in the PCI status register. */ status = pci_read_config(sc->msk_dev, PCIR_STATUS, 2); @@ -1362,8 +1363,8 @@ mskc_reset(struct msk_softc *sc) /* Reset GPHY/GMAC Control */ for (i = 0; i < sc->msk_num_port; i++) { /* GPHY Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); /* GMAC Control reset. */ CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); @@ -1396,8 +1397,14 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_STOP); CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); + initram = 0; + if (sc->msk_hw_id == CHIP_ID_YUKON_XL || + sc->msk_hw_id == CHIP_ID_YUKON_EC || + sc->msk_hw_id == CHIP_ID_YUKON_FE) + initram++; + /* Configure timeout values. */ - for (i = 0; i < sc->msk_num_port; i++) { + for (i = 0; initram > 0 && i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_SET); CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_CLR); CSR_WRITE_1(sc, SELECT_RAM_BUFFER(i, B3_RI_WTO_R1), @@ -1708,6 +1715,9 @@ mskc_attach(device_t dev) } } + /* Enable all clocks before accessing any registers. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_hw_id = CSR_READ_1(sc, B2_CHIP_ID); sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; @@ -1748,9 +1758,6 @@ mskc_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "int_holdoff", &sc->msk_int_holdoff); - /* Soft reset. */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); /* Check number of MACs. */ sc->msk_num_port = 1; @@ -2964,6 +2971,7 @@ mskc_resume(device_t dev) MSK_LOCK(sc); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); mskc_reset(sc); for (i = 0; i < sc->msk_num_port; i++) { if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && @@ -3655,37 +3663,24 @@ msk_set_tx_stfwd(struct msk_if_softc *sc ifp = sc_if->msk_ifp; sc = sc_if->msk_softc; - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EX: - if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) - goto yukon_ex_workaround; - if (ifp->if_mtu > ETHERMTU) - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_ENA); - else - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - break; - default: -yukon_ex_workaround: + if ((sc->msk_hw_id == CHIP_ID_YUKON_EX && + sc->msk_hw_rev != CHIP_REV_YU_EX_A0) || + sc->msk_hw_id >= CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); + } else { if (ifp->if_mtu > ETHERMTU) { /* Set Tx GMAC FIFO Almost Empty Threshold. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_DIS); } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); } - break; } } Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 01:42:52 2011 (r223396) +++ stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 01:44:09 2011 (r223397) @@ -677,6 +677,7 @@ /* ASF Subsystem Registers (Yukon-2 only) */ #define B28_Y2_SMB_CONFIG 0x0e40 /* 32 bit ASF SMBus Config Register */ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ +#define B28_Y2_CPU_WDOG 0x0e48 /* 32 bit Watchdog Register */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ #define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:47:23 2011 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 6B3041065723; Wed, 22 Jun 2011 01:47:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AEA68FC12; Wed, 22 Jun 2011 01:47: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 p5M1lNAt026364; Wed, 22 Jun 2011 01:47:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1lNdd026361; Wed, 22 Jun 2011 01:47:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220147.p5M1lNdd026361@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223398 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:47:23 -0000 Author: yongari Date: Wed Jun 22 01:47:23 2011 New Revision: 223398 URL: http://svn.freebsd.org/changeset/base/223398 Log: MFC r222230: Add initial support for Marvell 88E8055/88E8075 Yukon Supreme. Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Wed Jun 22 01:44:09 2011 (r223397) +++ stable/8/sys/dev/msk/if_msk.c Wed Jun 22 01:47:23 2011 (r223398) @@ -221,6 +221,10 @@ static struct msk_product { "Marvell Yukon 88E8071 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436C, "Marvell Yukon 88E8072 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436D, + "Marvell Yukon 88E8055 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4370, + "Marvell Yukon 88E8075 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4380, "Marvell Yukon 88E8057 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4381, @@ -1369,11 +1373,16 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); } + + if (sc->msk_hw_id == CHIP_ID_YUKON_SUPR && + sc->msk_hw_rev > CHIP_REV_YU_SU_B0) + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, PCI_CLK_MACSEC_DIS); if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) { /* Disable PCIe PHY powerdown(reg 0x80, bit7). */ CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080); @@ -1724,7 +1733,6 @@ mskc_attach(device_t dev) /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || sc->msk_hw_id > CHIP_ID_YUKON_OPT || - sc->msk_hw_id == CHIP_ID_YUKON_SUPR || sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); @@ -1831,6 +1839,11 @@ mskc_attach(device_t dev) sc->msk_clock = 156; /* 156 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_SUPR: + sc->msk_clock = 125; /* 125 MHz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + break; case CHIP_ID_YUKON_UL_2: sc->msk_clock = 125; /* 125 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; @@ -3733,7 +3746,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); @@ -3928,7 +3942,8 @@ msk_init_locked(struct msk_if_softc *sc_ msk_stop(sc_if); return; } - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { /* Disable flushing of non-ASF packets. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RX_MACSEC_FLUSH_OFF); Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 01:44:09 2011 (r223397) +++ stable/8/sys/dev/msk/if_mskreg.h Wed Jun 22 01:47:23 2011 (r223398) @@ -144,6 +144,8 @@ #define DEVICEID_MRVL_436A 0x436A #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C +#define DEVICEID_MRVL_436D 0x436D +#define DEVICEID_MRVL_4370 0x4370 #define DEVICEID_MRVL_4380 0x4380 #define DEVICEID_MRVL_4381 0x4381 @@ -321,6 +323,9 @@ #define PCI_OS_SPD_X100 2 /* PCI-X 100MHz Bus */ #define PCI_OS_SPD_X133 3 /* PCI-X 133MHz Bus */ +/* PCI_OUR_REG_3 32 bit Our Register 3 (Yukon-ECU only) */ +#define PCI_CLK_MACSEC_DIS BIT_17 /* Disable Clock MACSec. */ + /* PCI_OUR_REG_4 32 bit Our Register 4 (Yukon-ECU only) */ #define PCI_TIMER_VALUE_MSK (0xff<<16) /* Bit 23..16: Timer Value Mask */ #define PCI_FORCE_ASPM_REQUEST BIT_15 /* Force ASPM Request (A1 only) */ @@ -919,6 +924,10 @@ #define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ #define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ +#define CHIP_REV_YU_SU_A0 0 /* Chip Rev. for Yukon-2 SUPR A0 */ +#define CHIP_REV_YU_SU_B0 1 /* Chip Rev. for Yukon-2 SUPR B0 */ +#define CHIP_REV_YU_SU_B1 3 /* Chip Rev. for Yukon-2 SUPR B1 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:48:42 2011 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 2A3B5106568D; Wed, 22 Jun 2011 01:48:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A05A8FC17; Wed, 22 Jun 2011 01:48: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 p5M1mfH9026441; Wed, 22 Jun 2011 01:48:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1mf8p026438; Wed, 22 Jun 2011 01:48:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220148.p5M1mf8p026438@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:48:41 +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: r223399 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:48:42 -0000 Author: yongari Date: Wed Jun 22 01:48:41 2011 New Revision: 223399 URL: http://svn.freebsd.org/changeset/base/223399 Log: MFC r222230: Add initial support for Marvell 88E8055/88E8075 Yukon Supreme. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:47:23 2011 (r223398) +++ stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:48:41 2011 (r223399) @@ -221,6 +221,10 @@ static struct msk_product { "Marvell Yukon 88E8071 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436C, "Marvell Yukon 88E8072 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436D, + "Marvell Yukon 88E8055 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4370, + "Marvell Yukon 88E8075 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4380, "Marvell Yukon 88E8057 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4381, @@ -1369,11 +1373,16 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); } + + if (sc->msk_hw_id == CHIP_ID_YUKON_SUPR && + sc->msk_hw_rev > CHIP_REV_YU_SU_B0) + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, PCI_CLK_MACSEC_DIS); if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) { /* Disable PCIe PHY powerdown(reg 0x80, bit7). */ CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080); @@ -1724,7 +1733,6 @@ mskc_attach(device_t dev) /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || sc->msk_hw_id > CHIP_ID_YUKON_OPT || - sc->msk_hw_id == CHIP_ID_YUKON_SUPR || sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); @@ -1831,6 +1839,11 @@ mskc_attach(device_t dev) sc->msk_clock = 156; /* 156 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_SUPR: + sc->msk_clock = 125; /* 125 MHz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + break; case CHIP_ID_YUKON_UL_2: sc->msk_clock = 125; /* 125 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; @@ -3733,7 +3746,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); @@ -3928,7 +3942,8 @@ msk_init_locked(struct msk_if_softc *sc_ msk_stop(sc_if); return; } - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { /* Disable flushing of non-ASF packets. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RX_MACSEC_FLUSH_OFF); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 01:47:23 2011 (r223398) +++ stable/7/sys/dev/msk/if_mskreg.h Wed Jun 22 01:48:41 2011 (r223399) @@ -144,6 +144,8 @@ #define DEVICEID_MRVL_436A 0x436A #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C +#define DEVICEID_MRVL_436D 0x436D +#define DEVICEID_MRVL_4370 0x4370 #define DEVICEID_MRVL_4380 0x4380 #define DEVICEID_MRVL_4381 0x4381 @@ -321,6 +323,9 @@ #define PCI_OS_SPD_X100 2 /* PCI-X 100MHz Bus */ #define PCI_OS_SPD_X133 3 /* PCI-X 133MHz Bus */ +/* PCI_OUR_REG_3 32 bit Our Register 3 (Yukon-ECU only) */ +#define PCI_CLK_MACSEC_DIS BIT_17 /* Disable Clock MACSec. */ + /* PCI_OUR_REG_4 32 bit Our Register 4 (Yukon-ECU only) */ #define PCI_TIMER_VALUE_MSK (0xff<<16) /* Bit 23..16: Timer Value Mask */ #define PCI_FORCE_ASPM_REQUEST BIT_15 /* Force ASPM Request (A1 only) */ @@ -919,6 +924,10 @@ #define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ #define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ +#define CHIP_REV_YU_SU_A0 0 /* Chip Rev. for Yukon-2 SUPR A0 */ +#define CHIP_REV_YU_SU_B0 1 /* Chip Rev. for Yukon-2 SUPR B0 */ +#define CHIP_REV_YU_SU_B1 3 /* Chip Rev. for Yukon-2 SUPR B1 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:54:49 2011 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 8F99E10656F3; Wed, 22 Jun 2011 01:54:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76D298FC14; Wed, 22 Jun 2011 01: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 p5M1snCd026673; Wed, 22 Jun 2011 01:54:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1snBq026671; Wed, 22 Jun 2011 01:54:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220154.p5M1snBq026671@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223400 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:54:49 -0000 Author: yongari Date: Wed Jun 22 01:54:49 2011 New Revision: 223400 URL: http://svn.freebsd.org/changeset/base/223400 Log: MFC r222269: style(9) Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Wed Jun 22 01:48:41 2011 (r223399) +++ stable/8/sys/dev/msk/if_msk.c Wed Jun 22 01:54:49 2011 (r223400) @@ -1018,7 +1018,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) error = EINVAL; else if (ifp->if_mtu != ifr->ifr_mtu) { - if (ifr->ifr_mtu > ETHERMTU) { + if (ifr->ifr_mtu > ETHERMTU) { if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) { error = EINVAL; MSK_IF_UNLOCK(sc_if); @@ -1638,7 +1638,7 @@ msk_attach(device_t dev) * this workaround does not work so disable checksum offload * for VLAN interface. */ - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; /* * Enable Rx checksum offloading for VLAN tagged frames * if controller support new descriptor format. @@ -1923,7 +1923,8 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | + M_ZERO); if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_B\n"); @@ -1932,9 +1933,9 @@ mskc_attach(device_t dev) } mmd->port = MSK_PORT_B; mmd->pmd = sc->msk_pmd; - if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') mmd->mii_flags |= MIIF_HAVEFIBER; - if (sc->msk_pmd == 'P') + if (sc->msk_pmd == 'P') mmd->mii_flags |= MIIF_HAVEFIBER | MIIF_MACPRIV0; device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd); } @@ -3742,10 +3743,10 @@ msk_init_locked(struct msk_if_softc *sc_ ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } - /* GMAC Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + /* GMAC Control reset. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); if (sc->msk_hw_id == CHIP_ID_YUKON_EX || sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), @@ -3855,13 +3856,13 @@ msk_init_locked(struct msk_if_softc *sc_ msk_set_tx_stfwd(sc_if); } - if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && - sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { - /* Disable dynamic watermark - from Linux. */ - reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA)); - reg &= ~0x03; - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg); - } + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && + sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { + /* Disable dynamic watermark - from Linux. */ + reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA)); + reg &= ~0x03; + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg); + } /* * Disable Force Sync bit and Alloc bit in Tx RAM interface From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:55:48 2011 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 099F0106577C; Wed, 22 Jun 2011 01:55:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDE808FC1F; Wed, 22 Jun 2011 01:55: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 p5M1tlRg026750; Wed, 22 Jun 2011 01:55:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1tlEk026748; Wed, 22 Jun 2011 01:55:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220155.p5M1tlEk026748@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:55:47 +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: r223401 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 01:55:48 -0000 Author: yongari Date: Wed Jun 22 01:55:47 2011 New Revision: 223401 URL: http://svn.freebsd.org/changeset/base/223401 Log: MFC r222269: style(9) Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:54:49 2011 (r223400) +++ stable/7/sys/dev/msk/if_msk.c Wed Jun 22 01:55:47 2011 (r223401) @@ -1018,7 +1018,7 @@ msk_ioctl(struct ifnet *ifp, u_long comm if (ifr->ifr_mtu > MSK_JUMBO_MTU || ifr->ifr_mtu < ETHERMIN) error = EINVAL; else if (ifp->if_mtu != ifr->ifr_mtu) { - if (ifr->ifr_mtu > ETHERMTU) { + if (ifr->ifr_mtu > ETHERMTU) { if ((sc_if->msk_flags & MSK_FLAG_JUMBO) == 0) { error = EINVAL; MSK_IF_UNLOCK(sc_if); @@ -1638,7 +1638,7 @@ msk_attach(device_t dev) * this workaround does not work so disable checksum offload * for VLAN interface. */ - ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; + ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO; /* * Enable Rx checksum offloading for VLAN taggedd frames * if controller support new descriptor format. @@ -1923,7 +1923,8 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | + M_ZERO); if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_B\n"); @@ -1932,9 +1933,9 @@ mskc_attach(device_t dev) } mmd->port = MSK_PORT_B; mmd->pmd = sc->msk_pmd; - if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') mmd->mii_flags |= MIIF_HAVEFIBER; - if (sc->msk_pmd == 'P') + if (sc->msk_pmd == 'P') mmd->mii_flags |= MIIF_HAVEFIBER | MIIF_MACPRIV0; device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd); } @@ -3742,10 +3743,10 @@ msk_init_locked(struct msk_if_softc *sc_ ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_TXCSUM); } - /* GMAC Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); + /* GMAC Control reset. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); if (sc->msk_hw_id == CHIP_ID_YUKON_EX || sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), @@ -3855,13 +3856,13 @@ msk_init_locked(struct msk_if_softc *sc_ msk_set_tx_stfwd(sc_if); } - if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && - sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { - /* Disable dynamic watermark - from Linux. */ - reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA)); - reg &= ~0x03; - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg); - } + if (sc->msk_hw_id == CHIP_ID_YUKON_FE_P && + sc->msk_hw_rev == CHIP_REV_YU_FE_P_A0) { + /* Disable dynamic watermark - from Linux. */ + reg = CSR_READ_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA)); + reg &= ~0x03; + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_EA), reg); + } /* * Disable Force Sync bit and Alloc bit in Tx RAM interface From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:57:32 2011 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 53965106571A; Wed, 22 Jun 2011 01:57:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43F318FC08; Wed, 22 Jun 2011 01: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 p5M1vWvs026863; Wed, 22 Jun 2011 01:57:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1vWXW026861; Wed, 22 Jun 2011 01:57:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220157.p5M1vWXW026861@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01: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: r223402 - 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: Wed, 22 Jun 2011 01:57:32 -0000 Author: yongari Date: Wed Jun 22 01:57:31 2011 New Revision: 223402 URL: http://svn.freebsd.org/changeset/base/223402 Log: MFC r222232: Add 88E8075 Yukon Supreme to the list of supported hardware list. Modified: stable/8/share/man/man4/msk.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/msk.4 ============================================================================== --- stable/8/share/man/man4/msk.4 Wed Jun 22 01:55:47 2011 (r223401) +++ stable/8/share/man/man4/msk.4 Wed Jun 22 01:57:31 2011 (r223402) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd May 23, 2011 .Dt MSK 4 .Os .Sh NAME @@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet .It Marvell Yukon 88E8072 Gigabit Ethernet .It +Marvell Yukon 88E8075 Gigabit Ethernet +.It SysKonnect SK-9Sxx Gigabit Ethernet .It SysKonnect SK-9Exx Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 01:57:46 2011 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 4D5C0106570F; Wed, 22 Jun 2011 01:57:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB6D8FC13; Wed, 22 Jun 2011 01:57: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 p5M1vk2o026906; Wed, 22 Jun 2011 01:57:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M1vkd3026904; Wed, 22 Jun 2011 01:57:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220157.p5M1vkd3026904@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 01:57:46 +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: r223403 - stable/7/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, 22 Jun 2011 01:57:46 -0000 Author: yongari Date: Wed Jun 22 01:57:45 2011 New Revision: 223403 URL: http://svn.freebsd.org/changeset/base/223403 Log: MFC r222232: Add 88E8075 Yukon Supreme to the list of supported hardware list. Modified: stable/7/share/man/man4/msk.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Wed Jun 22 01:57:31 2011 (r223402) +++ stable/7/share/man/man4/msk.4 Wed Jun 22 01:57:45 2011 (r223403) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd May 23, 2011 .Dt MSK 4 .Os .Sh NAME @@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet .It Marvell Yukon 88E8072 Gigabit Ethernet .It +Marvell Yukon 88E8075 Gigabit Ethernet +.It SysKonnect SK-9Sxx Gigabit Ethernet .It SysKonnect SK-9Exx Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:09:51 2011 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 4AA14106578C; Wed, 22 Jun 2011 02:09:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DCA118FC0C; Wed, 22 Jun 2011 02:09:50 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M234Z7084313 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:03:04 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 From: Warner Losh In-Reply-To: <20110622090856.A2727@besplex.bde.org> Date: Tue, 21 Jun 2011 20:02:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <5AD3FA55-7A8D-49A2-9A49-A0D9EDF41DCF@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <20110622090856.A2727@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:03:04 -0600 (MDT) Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 02:09:51 -0000 On Jun 21, 2011, at 5:29 PM, Bruce Evans wrote: > On Tue, 21 Jun 2011, Attilio Rao wrote: >=20 >> 2011/6/21 Bruce Evans : >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>=20 >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. =C2 Apparently they don't exist on mips. =C2 jake@ fixed = all their >>> old uses for sparc4 in ~Y2K. >>=20 >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >=20 > Perhaps more like the reverse. They are correctly spelled with _char > form in the C code. This is needed to match the declarations of the > variables literally. They are translated to the _8 form by > but the _8 form doesn't exist. I think the acq and > rel forms exist in . mips/support.S only has a = limited > set of atomics, including clear_16 but not including clear_8. Yup. > Anyway, they shouldn't be used in either form. They certainly don't > exist on sparc64, but sparc64 compiles because it is on the other half > of the ifdef. sparc64 atomic support is actually 4 times smaller than > mips atomic support, not just 2.5 times, since it doesn't have extras > in support.S. I'm not sure what you are saying... Warner From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:10:14 2011 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 04A1B1065672; Wed, 22 Jun 2011 02:10:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8CA4C8FC0C; Wed, 22 Jun 2011 02:10:13 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M21hbL084287 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:01:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 20:01:38 -0600 Message-Id: <37980F43-13C5-4C0E-8DB6-9871FD95598C@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:01:44 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 02:10:14 -0000 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > On 06/21/2011 16:09, Attilio Rao wrote: >> 2011/6/21 Bruce Evans: >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>=20 >>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>=20 >>>> Hi Alan, >>>>=20 >>>>> Author: alc >>>>> Date: Sun Jun 19 19:13:24 2011 >>>>> New Revision: 223307 >>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>=20 >>>>> Log: >>>>> Precisely document the synchronization rules for the page's dirty = field. >>>>> (Saying that the lock on the object that the page belongs to must = be >>>>> held >>>>> only represents one aspect of the rules.) >>>>>=20 >>>>> Eliminate the use of the page queues lock for atomically = performing >>>>> read- >>>>> modify-write operations on the dirty field when the underlying >>>>> architecture >>>>> supports atomic operations on char and short types. >>>>>=20 >>>>> Document the fact that 32KB pages aren't really supported. >>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>> please check and see if you can fix it? The errors I get are: >>>>=20 >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>> old uses for sparc4 in ~Y2K. >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >>=20 >=20 > It appears that while mips/include/atomic.h declares the existence of = atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >=20 > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16 Doh! I was confused. I thought _8 was '64 bits' given the bus_space = convention. I'll look at implementing the _8 version tonight. Warner From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:11:42 2011 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 C940210657A5; Wed, 22 Jun 2011 02:11:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA2C18FC08; Wed, 22 Jun 2011 02:11: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 p5M2BgnI027358; Wed, 22 Jun 2011 02:11:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2BgXn027356; Wed, 22 Jun 2011 02:11:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106220211.p5M2BgXn027356@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 22 Jun 2011 02:11: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: r223404 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 02:11:42 -0000 Author: nwhitehorn Date: Wed Jun 22 02:11:42 2011 New Revision: 223404 URL: http://svn.freebsd.org/changeset/base/223404 Log: The IOMMU is not involved for the storage bus. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 01:57:45 2011 (r223403) +++ head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:11:42 2011 (r223404) @@ -631,8 +631,7 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && - dinfo->bustype != PS3_BUSTYPE_STORAGE) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:18:46 2011 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 4D1741065772; Wed, 22 Jun 2011 02:18:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DC688FC1B; Wed, 22 Jun 2011 02:18: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 p5M2IkrG027582; Wed, 22 Jun 2011 02:18:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2IkHa027579; Wed, 22 Jun 2011 02:18:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201106220218.p5M2IkHa027579@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 22 Jun 2011 02:18: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: r223405 - head/sys/dev/vr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 02:18:46 -0000 Author: yongari Date: Wed Jun 22 02:18:45 2011 New Revision: 223405 URL: http://svn.freebsd.org/changeset/base/223405 Log: Remove link state change callback handler. There is no need to register both status change and link state change callbacks. Implement checking valid link in state change callback and poll active link state in vr_tick(). This allows immediate detection of lost link as well as protecting driver from frequent link flips during link renegotiation. taskq implementation was removed because driver now needs to poll link state in vr_tick(). While I'm here do not report current link state if interface is not running. Tested by: n_hibma MFC after: 1 week Modified: head/sys/dev/vr/if_vr.c head/sys/dev/vr/if_vrreg.h Modified: head/sys/dev/vr/if_vr.c ============================================================================== --- head/sys/dev/vr/if_vr.c Wed Jun 22 02:11:42 2011 (r223404) +++ head/sys/dev/vr/if_vr.c Wed Jun 22 02:18:45 2011 (r223405) @@ -185,7 +185,6 @@ static int vr_miibus_readreg(device_t, i static int vr_miibus_writereg(device_t, int, int, int); static void vr_miibus_statchg(device_t); -static void vr_link_task(void *, int); static void vr_cam_mask(struct vr_softc *, uint32_t, int); static int vr_cam_data(struct vr_softc *, int, int, uint8_t *); static void vr_set_filter(struct vr_softc *); @@ -226,7 +225,6 @@ static device_method_t vr_methods[] = { DEVMETHOD(miibus_readreg, vr_miibus_readreg), DEVMETHOD(miibus_writereg, vr_miibus_writereg), DEVMETHOD(miibus_statchg, vr_miibus_statchg), - DEVMETHOD(miibus_linkchg, vr_miibus_statchg), { NULL, NULL } }; @@ -290,22 +288,13 @@ vr_miibus_writereg(device_t dev, int phy return (0); } -static void -vr_miibus_statchg(device_t dev) -{ - struct vr_softc *sc; - - sc = device_get_softc(dev); - taskqueue_enqueue(taskqueue_swi, &sc->vr_link_task); -} - /* * In order to fiddle with the * 'full-duplex' and '100Mbps' bits in the netconfig register, we * first have to put the transmit and/or receive logic in the idle state. */ static void -vr_link_task(void *arg, int pending) +vr_miibus_statchg(device_t dev) { struct vr_softc *sc; struct mii_data *mii; @@ -313,22 +302,25 @@ vr_link_task(void *arg, int pending) int lfdx, mfdx; uint8_t cr0, cr1, fc; - sc = (struct vr_softc *)arg; - - VR_LOCK(sc); + sc = device_get_softc(dev); mii = device_get_softc(sc->vr_miibus); ifp = sc->vr_ifp; if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - VR_UNLOCK(sc); + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - } - if (mii->mii_media_status & IFM_ACTIVE) { - if (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) + sc->vr_link = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: sc->vr_link = 1; - } else - sc->vr_link = 0; + break; + default: + break; + } + } if (sc->vr_link != 0) { cr0 = CSR_READ_1(sc, VR_CR0); @@ -384,11 +376,8 @@ vr_link_task(void *arg, int pending) "%s: Tx/Rx shutdown error -- resetting\n", __func__); sc->vr_flags |= VR_F_RESTART; - VR_UNLOCK(sc); - return; } } - VR_UNLOCK(sc); } @@ -621,7 +610,6 @@ vr_attach(device_t dev) mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->vr_stat_callout, &sc->vr_mtx, 0); - TASK_INIT(&sc->vr_link_task, 0, vr_link_task, sc); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, @@ -841,7 +829,6 @@ vr_detach(device_t dev) vr_stop(sc); VR_UNLOCK(sc); callout_drain(&sc->vr_stat_callout); - taskqueue_drain(taskqueue_swi, &sc->vr_link_task); ether_ifdetach(ifp); } if (sc->vr_miibus) @@ -1559,6 +1546,8 @@ vr_tick(void *xsc) mii = device_get_softc(sc->vr_miibus); mii_tick(mii); + if (sc->vr_link == 0) + vr_miibus_statchg(sc->vr_dev); vr_watchdog(sc); callout_reset(&sc->vr_stat_callout, hz, vr_tick, sc); } @@ -2161,6 +2150,10 @@ vr_ifmedia_sts(struct ifnet *ifp, struct sc = ifp->if_softc; mii = device_get_softc(sc->vr_miibus); VR_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VR_UNLOCK(sc); + return; + } mii_pollstat(mii); VR_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; Modified: head/sys/dev/vr/if_vrreg.h ============================================================================== --- head/sys/dev/vr/if_vrreg.h Wed Jun 22 02:11:42 2011 (r223404) +++ head/sys/dev/vr/if_vrreg.h Wed Jun 22 02:18:45 2011 (r223405) @@ -723,7 +723,6 @@ struct vr_softc { uint8_t vr_flags; /* See VR_F_* below */ #define VR_F_RESTART 0x01 /* Restart unit on next tick */ int vr_if_flags; - struct task vr_link_task; struct vr_chain_data vr_cdata; struct vr_ring_data vr_rdata; struct vr_statistics vr_stat; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:23:19 2011 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 F32551065679; Wed, 22 Jun 2011 02:23:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E41BC8FC0C; Wed, 22 Jun 2011 02:23: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 p5M2NI7S027756; Wed, 22 Jun 2011 02:23:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M2NI11027754; Wed, 22 Jun 2011 02:23:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106220223.p5M2NI11027754@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 22 Jun 2011 02:23: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: r223406 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 02:23:19 -0000 Author: nwhitehorn Date: Wed Jun 22 02:23:18 2011 New Revision: 223406 URL: http://svn.freebsd.org/changeset/base/223406 Log: This is more complicated than I expected. Storage devices need the IOMMU set up, but must not use it. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:18:45 2011 (r223405) +++ head/sys/powerpc/ps3/ps3bus.c Wed Jun 22 02:23:18 2011 (r223406) @@ -631,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_ struct ps3bus_softc *sc = device_get_softc(dev); int i, err, flags; - if (dinfo->bustype != PS3_BUSTYPE_SYSBUS) + if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && + dinfo->bustype != PS3_BUSTYPE_STORAGE) return (bus_get_dma_tag(dev)); mtx_lock(&dinfo->iommu_mtx); @@ -671,7 +672,15 @@ ps3bus_get_dma_tag(device_t dev, device_ NULL, NULL, BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE, 0, NULL, NULL, &dinfo->dma_tag); - bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); + /* + * Note: storage devices have IOMMU mappings set up by the hypervisor, + * but use physical, non-translated addresses. The above IOMMU + * initialization is necessary for the hypervisor to be able to set up + * the mappings, but actual DMA mappings should not use the IOMMU + * routines. + */ + if (dinfo->bustype != PS3_BUSTYPE_STORAGE) + bus_dma_tag_set_iommu(dinfo->dma_tag, dev, dinfo); fail: mtx_unlock(&dinfo->iommu_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:30:08 2011 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 6183010656B2; Wed, 22 Jun 2011 02:30:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 48EC48FC08; Wed, 22 Jun 2011 02:30:05 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M2RGIj084486 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 20:27:21 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E0128FF.6020804@rice.edu> Date: Tue, 21 Jun 2011 20:27:03 -0600 Message-Id: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 20:27:21 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 02:30:08 -0000 On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > On 06/21/2011 16:09, Attilio Rao wrote: >> 2011/6/21 Bruce Evans: >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>=20 >>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>=20 >>>> Hi Alan, >>>>=20 >>>>> Author: alc >>>>> Date: Sun Jun 19 19:13:24 2011 >>>>> New Revision: 223307 >>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>=20 >>>>> Log: >>>>> Precisely document the synchronization rules for the page's dirty = field. >>>>> (Saying that the lock on the object that the page belongs to must = be >>>>> held >>>>> only represents one aspect of the rules.) >>>>>=20 >>>>> Eliminate the use of the page queues lock for atomically = performing >>>>> read- >>>>> modify-write operations on the dirty field when the underlying >>>>> architecture >>>>> supports atomic operations on char and short types. >>>>>=20 >>>>> Document the fact that 32KB pages aren't really supported. >>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>> please check and see if you can fix it? The errors I get are: >>>>=20 >>>> vm_page.o: In function `vm_page_clear_dirty': >>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>>> vm_page.o: In function `vm_page_set_validclean': >>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>> against `atomic_clear_8' >>> Atomic types shorter than int cannot be used in MI code, since they = might >>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>> old uses for sparc4 in ~Y2K. >> I'm sure they do, they exist in support.S though and may not have the >> _8 form (they may just have the _char version). I may look at the = code >> again to be sure. >>=20 >=20 > It appears that while mips/include/atomic.h declares the existence of = atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >=20 > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16) The current crop of atomic*16 and atomic*8 functions have the = restriction that the address must be 32-bit aligned (and it forces this = by aligning to 32-bits silently and then operates on the low 8 or 16 = bits in that word!) I'm guessing that this is likely just wrong. Comments? Warner From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 02:41:18 2011 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 BC02310657C3; Wed, 22 Jun 2011 02:41:18 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC2D8FC18; Wed, 22 Jun 2011 02:41:18 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 98BC82904C1; Tue, 21 Jun 2011 21:41:17 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id kwz8tdPEGGuM; Tue, 21 Jun 2011 21:41:17 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id 6232C2904A6; Tue, 21 Jun 2011 21:41:16 -0500 (CDT) Message-ID: <4E01564B.70507@rice.edu> Date: Tue, 21 Jun 2011 21:41:15 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Warner Losh References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> 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: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 02:41:18 -0000 On 06/21/2011 21:27, Warner Losh wrote: > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > >> On 06/21/2011 16:09, Attilio Rao wrote: >>> 2011/6/21 Bruce Evans>> >: >>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>> >>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>> >>>>> Hi Alan, >>>>> >>>>>> Author: alc >>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>> New Revision: 223307 >>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>> >>>>>> Log: >>>>>> Precisely document the synchronization rules for the page's >>>>>> dirty field. >>>>>> (Saying that the lock on the object that the page belongs to must be >>>>>> held >>>>>> only represents one aspect of the rules.) >>>>>> >>>>>> Eliminate the use of the page queues lock for atomically performing >>>>>> read- >>>>>> modify-write operations on the dirty field when the underlying >>>>>> architecture >>>>>> supports atomic operations on char and short types. >>>>>> >>>>>> Document the fact that 32KB pages aren't really supported. >>>>> contrary to the tinderbox I'd like to point out that all mips kernels >>>>> built by universe are broken with a SVN HEAD from earlier today. >>>>> Could you >>>>> please check and see if you can fix it? The errors I get are: >>>>> >>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>>> vm_page.o: In function `vm_page_set_validclean': >>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>> Atomic types shorter than int cannot be used in MI code, since they >>>> might >>>> not exist. Apparently they don't exist on mips. jake@ fixed all their >>>> old uses for sparc4 in ~Y2K. >>> I'm sure they do, they exist in support.S though and may not have the >>> _8 form (they may just have the _char version). I may look at the code >>> again to be sure. >>> >> >> It appears that while mips/include/atomic.h declares the existence of >> atomic_clear_8, mips/mips/support.S doesn't implement it. In other >> words, only support for int's and short's is currently implemented, >> not char's: >> >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the > restriction that the address must be 32-bit aligned (and it forces > this by aligning to 32-bits silently and then operates on the low 8 or > 16 bits in that word!) > > I'm guessing that this is likely just wrong. Comments? Yes, that would be wrong. Alan From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 03:27:53 2011 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 C6B511065679; Wed, 22 Jun 2011 03:27:53 +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 9040D8FC26; Wed, 22 Jun 2011 03:27:53 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p5M3RW1L020349 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 21 Jun 2011 20:27:34 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E01612F.4080007@freebsd.org> Date: Tue, 21 Jun 2011 20:27:43 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Warner Losh References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> 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: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 03:27:53 -0000 On 6/21/11 7:27 PM, Warner Losh wrote: > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > >> On 06/21/2011 16:09, Attilio Rao wrote: >>> 2011/6/21 Bruce Evans>> >: >>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>> >>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>> >>>>> Hi Alan, >>>>> >>>>>> Author: alc >>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>> New Revision: 223307 >>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>> >>>>>> Log: >>>>>> Precisely document the synchronization rules for the page's >>>>>> dirty field. >>>>>> (Saying that the lock on the object that the page belongs to >>>>>> must be >>>>>> held >>>>>> only represents one aspect of the rules.) >>>>>> >>>>>> Eliminate the use of the page queues lock for atomically >>>>>> performing >>>>>> read- >>>>>> modify-write operations on the dirty field when the underlying >>>>>> architecture >>>>>> supports atomic operations on char and short types. >>>>>> >>>>>> Document the fact that 32KB pages aren't really supported. >>>>> contrary to the tinderbox I'd like to point out that all mips >>>>> kernels >>>>> built by universe are broken with a SVN HEAD from earlier today. >>>>> Could you >>>>> please check and see if you can fix it? The errors I get are: >>>>> >>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>>> vm_page.o: In function `vm_page_set_validclean': >>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to >>>>> `atomic_clear_8' >>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: >>>>> R_MIPS_26 >>>>> against `atomic_clear_8' >>>> Atomic types shorter than int cannot be used in MI code, since >>>> they might >>>> not exist. Apparently they don't exist on mips. jake@ fixed all >>>> their >>>> old uses for sparc4 in ~Y2K. >>> I'm sure they do, they exist in support.S though and may not have the >>> _8 form (they may just have the _char version). I may look at the code >>> again to be sure. >>> >> >> It appears that while mips/include/atomic.h declares the existence >> of atomic_clear_8, mips/mips/support.S doesn't implement it. In >> other words, only support for int's and short's is currently >> implemented, not char's: >> >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the > restriction that the address must be 32-bit aligned (and it forces > this by aligning to 32-bits silently and then operates on the low 8 > or 16 bits in that word!) > > I'm guessing that this is likely just wrong. Comments? I'm guessing it depends on whether the hardware supports atomic sub-wordline accesses. (mind you it's getting really hard to work out what a wordline means these days) > > Warner > From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 03:48:39 2011 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 B19B610657A0; Wed, 22 Jun 2011 03:48:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 143B68FC0A; Wed, 22 Jun 2011 03:48:38 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5M3kYRq085097 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 21 Jun 2011 21:46:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) From: Warner Losh In-Reply-To: <4E01612F.4080007@freebsd.org> Date: Tue, 21 Jun 2011 21:46:30 -0600 Message-Id: <3B90907F-0CC4-4C2F-9386-6BF12E750F6C@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> <4E01612F.4080007@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 21 Jun 2011 21:46:34 -0600 (MDT) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 03:48:39 -0000 On Jun 21, 2011, at 9:27 PM, Julian Elischer wrote: > On 6/21/11 7:27 PM, Warner Losh wrote: >>=20 >>=20 >> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>=20 >>> On 06/21/2011 16:09, Attilio Rao wrote: >>>> 2011/6/21 Bruce Evans: >>>>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>>>>=20 >>>>>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>>>>>=20 >>>>>> Hi Alan, >>>>>>=20 >>>>>>> Author: alc >>>>>>> Date: Sun Jun 19 19:13:24 2011 >>>>>>> New Revision: 223307 >>>>>>> URL: http://svn.freebsd.org/changeset/base/223307 >>>>>>>=20 >>>>>>> Log: >>>>>>> Precisely document the synchronization rules for the page's = dirty field. >>>>>>> (Saying that the lock on the object that the page belongs to = must be >>>>>>> held >>>>>>> only represents one aspect of the rules.) >>>>>>>=20 >>>>>>> Eliminate the use of the page queues lock for atomically = performing >>>>>>> read- >>>>>>> modify-write operations on the dirty field when the underlying >>>>>>> architecture >>>>>>> supports atomic operations on char and short types. >>>>>>>=20 >>>>>>> Document the fact that 32KB pages aren't really supported. >>>>>> contrary to the tinderbox I'd like to point out that all mips = kernels >>>>>> built by universe are broken with a SVN HEAD from earlier today. = Could you >>>>>> please check and see if you can fix it? The errors I get are: >>>>>>=20 >>>>>> vm_page.o: In function `vm_page_clear_dirty': >>>>>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>>>>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>>>>> against `atomic_clear_8' >>>>>> vm_page.o: In function `vm_page_set_validclean': >>>>>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>>>>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>>>>> against `atomic_clear_8' >>>>> Atomic types shorter than int cannot be used in MI code, since = they might >>>>> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>>>> old uses for sparc4 in ~Y2K. >>>> I'm sure they do, they exist in support.S though and may not have = the >>>> _8 form (they may just have the _char version). I may look at the = code >>>> again to be sure. >>>>=20 >>>=20 >>> It appears that while mips/include/atomic.h declares the existence = of atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, only support for int's and short's is currently implemented, not = char's: >>>=20 >>> # grep atomic_clear mips/mips/support.S >>> * atomic_clear_32(u_int32_t *a, u_int32_t b) >>> LEAF(atomic_clear_32) >>> END(atomic_clear_32) >>> * atomic_clear_16(u_int16_t *a, u_int16_t b) >>> LEAF(atomic_clear_16) >>> END(atomic_clear_16) >>=20 >> The current crop of atomic*16 and atomic*8 functions have the = restriction that the address must be 32-bit aligned (and it forces this = by aligning to 32-bits silently and then operates on the low 8 or 16 = bits in that word!) >>=20 >> I'm guessing that this is likely just wrong. Comments? >=20 > I'm guessing it depends on whether the hardware supports atomic = sub-wordline accesses. > (mind you it's getting really hard to work out what a wordline means = these days) Generally, they don't. ll and lld are for 4 and 8 byte values. You're = supposed to load the word or doubleword with the instruction, mask off = the byte you want to change, change it, and then write it back with the = sc or scd insturction. That will only succeed of none of the bytes in = that word could have changed (yes, weasel words usually meaning anything = in the cache line, but really can mean anything). I know that some cores do support special instructions to do this, but = they are with extensions to the ISA... Warner= From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 06:27:33 2011 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 2BC901065751; Wed, 22 Jun 2011 06:27:33 +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 03B1B8FC0A; Wed, 22 Jun 2011 06:27: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 p5M6RWxl035315; Wed, 22 Jun 2011 06:27:32 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M6RWZM035313; Wed, 22 Jun 2011 06:27:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106220627.p5M6RWZM035313@svn.freebsd.org> From: Doug Barton Date: Wed, 22 Jun 2011 06:27: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: r223408 - head/etc/rc.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, 22 Jun 2011 06:27:33 -0000 Author: dougb Date: Wed Jun 22 06:27:32 2011 New Revision: 223408 URL: http://svn.freebsd.org/changeset/base/223408 Log: I knew there was something funny about this line Modified: head/etc/rc.d/netwait Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Wed Jun 22 04:11:27 2011 (r223407) +++ head/etc/rc.d/netwait Wed Jun 22 06:27:32 2011 (r223408) @@ -14,7 +14,8 @@ . /etc/rc.subr name="netwait" -rc_var=`set_rcvar` +rcvar=`set_rcvar` + start_cmd="${name}_start" stop_cmd=":" From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 06:45:35 2011 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 54CDA106570D; Wed, 22 Jun 2011 06:45: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 39B1A8FC18; Wed, 22 Jun 2011 06:45: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 p5M6jZTj035893; Wed, 22 Jun 2011 06:45:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M6jZZB035890; Wed, 22 Jun 2011 06:45:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106220645.p5M6jZZB035890@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jun 2011 06:45: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: r223409 - in stable/8: share/man/man4 sys/dev/amdsbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 06:45:35 -0000 Author: avg Date: Wed Jun 22 06:45:34 2011 New Revision: 223409 URL: http://svn.freebsd.org/changeset/base/223409 Log: MFC r222805: amdsbwd: update to support SB8xx southbridges PR: kern/157568 Modified: stable/8/share/man/man4/amdsbwd.4 stable/8/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man4/amdsbwd.4 ============================================================================== --- stable/8/share/man/man4/amdsbwd.4 Wed Jun 22 06:27:32 2011 (r223408) +++ stable/8/share/man/man4/amdsbwd.4 Wed Jun 22 06:45:34 2011 (r223409) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2009 +.Dd June 7, 2011 .Dt AMDSBWD 4 .Os .Sh NAME .Nm amdsbwd -.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer +.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600 and SB7xx south bridge chips. +AMD SB600, SB7xx and SB8xx southbridges. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/8/sys/dev/amdsbwd/amdsbwd.c Wed Jun 22 06:27:32 2011 (r223408) +++ stable/8/sys/dev/amdsbwd/amdsbwd.c Wed Jun 22 06:45:34 2011 (r223409) @@ -25,8 +25,8 @@ */ /* - * This is a driver for watchdog timer present in AMD SB600/SB7xx - * south bridges and other watchdog timers advertised via WDRT ACPI table. + * This is a driver for watchdog timer present in AMD SB600/SB7xx/SB8xx + * southbridges. * Please see the following specifications for the descriptions of the * registers and flags: * - AMD SB600 Register Reference Guide, Public Version, Rev. 3.03 (SB600 RRG) @@ -35,11 +35,13 @@ * http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf * - AMD SB700/710/750 Register Programming Requirements (RPR) * http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf + * - AMD SB800-Series Southbridges Register Reference Guide (RRG) + * http://support.amd.com/us/Embedded_TechDocs/45482.pdf * Please see the following for Watchdog Resource Table specification: * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT) * http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx - * AMD SB600/SB7xx watchdog hardware seems to conform to the above, - * but my system doesn't provide the table. + * AMD SB600/SB7xx/SB8xx watchdog hardware seems to conform to the above + * specifications, but the table hasn't been spotted in the wild yet. */ #include @@ -59,15 +61,15 @@ __FBSDID("$FreeBSD$"); #include #include -/* RRG 2.3.3.1.1, page 161. */ +/* SB7xx RRG 2.3.3.1.1. */ #define AMDSB_PMIO_INDEX 0xcd6 #define AMDSB_PMIO_DATA (PMIO_INDEX + 1) #define AMDSB_PMIO_WIDTH 2 -/* RRG 2.3.3.2, page 181. */ +/* SB7xx RRG 2.3.3.2. */ #define AMDSB_PM_RESET_STATUS0 0x44 #define AMDSB_PM_RESET_STATUS1 0x45 #define AMDSB_WD_RST_STS 0x02 -/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */ +/* SB7xx RRG 2.3.3.2, RPR 2.36. */ #define AMDSB_PM_WDT_CTRL 0x69 #define AMDSB_WDT_DISABLE 0x01 #define AMDSB_WDT_RES_MASK (0x02 | 0x04) @@ -77,7 +79,18 @@ __FBSDID("$FreeBSD$"); #define AMDSB_WDT_RES_1S 0x06 #define AMDSB_PM_WDT_BASE_LSB 0x6c #define AMDSB_PM_WDT_BASE_MSB 0x6f -/* RRG 2.3.4, page 223, WDRT. */ +/* SB8xx RRG 2.3.3. */ +#define AMDSB8_PM_WDT_EN 0x48 +#define AMDSB8_WDT_DEC_EN 0x01 +#define AMDSB8_WDT_DISABLE 0x02 +#define AMDSB8_PM_WDT_CTRL 0x4c +#define AMDSB8_WDT_32KHZ 0x00 +#define AMDSB8_WDT_1HZ 0x03 +#define AMDSB8_WDT_RES_MASK 0x03 +#define AMDSB8_PM_RESET_STATUS0 0xC0 +#define AMDSB8_PM_RESET_STATUS1 0xC1 +#define AMDSB8_WD_RST_STS 0x20 +/* SB7xx RRG 2.3.4, WDRT. */ #define AMDSB_WD_CTRL 0x00 #define AMDSB_WD_RUN 0x01 #define AMDSB_WD_FIRED 0x02 @@ -90,8 +103,9 @@ __FBSDID("$FreeBSD$"); #define AMDSB_WDIO_REG_WIDTH 4 /* WDRT */ #define MAXCOUNT_MIN_VALUE 511 -/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page 97. */ -#define AMDSB7xx_SMBUS_DEVID 0x43851002 +/* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */ +#define AMDSB_SMBUS_DEVID 0x43851002 +#define AMDSB8_SMBUS_REVID 0x40 #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -265,7 +279,7 @@ amdsbwd_identify(driver_t *driver, devic smb_dev = pci_find_bsf(0, 20, 0); if (smb_dev == NULL) return; - if (pci_get_devid(smb_dev) != AMDSB7xx_SMBUS_DEVID) + if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID) return; child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); @@ -273,15 +287,102 @@ amdsbwd_identify(driver_t *driver, devic device_printf(parent, "add amdsbwd child failed\n"); } + +static void +amdsbwd_probe_sb7xx(device_t dev, struct resource *pmres, uint32_t *addr) +{ + uint32_t val; + int i; + + /* Report cause of previous reset for user's convenience. */ + val = pmio_read(pmres, AMDSB_PM_RESET_STATUS0); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); + val = pmio_read(pmres, AMDSB_PM_RESET_STATUS1); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + if ((val & AMDSB_WD_RST_STS) != 0) + device_printf(dev, "Previous Reset was caused by Watchdog\n"); + + /* Find base address of memory mapped WDT registers. */ + for (*addr = 0, i = 0; i < 4; i++) { + *addr <<= 8; + *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); + } + /* Set watchdog timer tick to 1s. */ + val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_RES_MASK; + val |= AMDSB_WDT_RES_10MS; + pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); + + /* Enable watchdog device (in stopped state). */ + val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_DISABLE; + pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); + + /* + * XXX TODO: Ensure that watchdog decode is enabled + * (register 0x41, bit 3). + */ + device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer"); +} + +static void +amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr) +{ + uint32_t val; + int i; + + /* Report cause of previous reset for user's convenience. */ + val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); + val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + if ((val & AMDSB8_WD_RST_STS) != 0) + device_printf(dev, "Previous Reset was caused by Watchdog\n"); + + /* Find base address of memory mapped WDT registers. */ + for (*addr = 0, i = 0; i < 4; i++) { + *addr <<= 8; + *addr |= pmio_read(pmres, AMDSB8_PM_WDT_EN + 3 - i); + } + *addr &= ~0x07u; + + /* Set watchdog timer tick to 1s. */ + val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL); + val &= ~AMDSB8_WDT_RES_MASK; + val |= AMDSB8_WDT_1HZ; + pmio_write(pmres, AMDSB8_PM_WDT_CTRL, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL); + amdsbwd_verbose_printf(dev, "AMDSB8_PM_WDT_CTRL value = %#02x\n", val); +#endif + + /* + * Enable watchdog device (in stopped state) + * and decoding of its address. + */ + val = pmio_read(pmres, AMDSB8_PM_WDT_EN); + val &= ~AMDSB8_WDT_DISABLE; + val |= AMDSB8_WDT_DEC_EN; + pmio_write(pmres, AMDSB8_PM_WDT_EN, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDSB8_PM_WDT_EN); + device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); +#endif + device_set_desc(dev, "AMD SB8xx Watchdog Timer"); +} + static int amdsbwd_probe(device_t dev) { struct resource *res; + device_t smb_dev; uint32_t addr; - uint32_t val; int rid; int rc; - int i; /* Do not claim some ISA PnP device by accident. */ if (isa_get_logicalid(dev) != 0) @@ -301,21 +402,16 @@ amdsbwd_probe(device_t dev) return (ENXIO); } - /* Report cause of previous reset for user's convenience. */ - val = pmio_read(res, AMDSB_PM_RESET_STATUS0); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); - val = pmio_read(res, AMDSB_PM_RESET_STATUS1); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); - if ((val & AMDSB_WD_RST_STS) != 0) - device_printf(dev, "Previous Reset was caused by Watchdog\n"); + smb_dev = pci_find_bsf(0, 20, 0); + KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); + if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + amdsbwd_probe_sb7xx(dev, res, &addr); + else + amdsbwd_probe_sb8xx(dev, res, &addr); + + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + bus_delete_resource(dev, SYS_RES_IOPORT, rid); - /* Find base address of memory mapped WDT registers. */ - for (addr = 0, i = 0; i < 4; i++) { - addr <<= 8; - addr |= pmio_read(res, AMDSB_PM_WDT_BASE_MSB - i); - } amdsbwd_verbose_printf(dev, "memory base address = %#010x\n", addr); rc = bus_set_resource(dev, SYS_RES_MEMORY, 0, addr + AMDSB_WD_CTRL, AMDSB_WDIO_REG_WIDTH); @@ -330,36 +426,25 @@ amdsbwd_probe(device_t dev) return (ENXIO); } - /* Set watchdog timer tick to 10ms. */ - val = pmio_read(res, AMDSB_PM_WDT_CTRL); - val &= ~AMDSB_WDT_RES_MASK; - val |= AMDSB_WDT_RES_10MS; - pmio_write(res, AMDSB_PM_WDT_CTRL, val); - - /* Enable watchdog device (in stopped state). */ - val = pmio_read(res, AMDSB_PM_WDT_CTRL); - val &= ~AMDSB_WDT_DISABLE; - pmio_write(res, AMDSB_PM_WDT_CTRL, val); - - /* - * XXX TODO: Ensure that watchdog decode is enabled - * (register 0x41, bit 3). - */ - bus_release_resource(dev, SYS_RES_IOPORT, rid, res); - bus_delete_resource(dev, SYS_RES_IOPORT, rid); - - device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer"); return (0); } static int amdsbwd_attach_sb(device_t dev, struct amdsbwd_softc *sc) { + device_t smb_dev; + sc->max_ticks = UINT16_MAX; - sc->ms_per_tick = 10; sc->rid_ctrl = 0; sc->rid_count = 1; + smb_dev = pci_find_bsf(0, 20, 0); + KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); + if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + sc->ms_per_tick = 10; + else + sc->ms_per_tick = 1000; + sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid_ctrl, RF_ACTIVE); if (sc->res_ctrl == NULL) { @@ -388,6 +473,11 @@ amdsbwd_attach(device_t dev) if (rc != 0) goto fail; +#ifdef AMDSBWD_DEBUG + device_printf(dev, "wd ctrl = %#04x\n", wdctrl_read(sc)); + device_printf(dev, "wd count = %#04x\n", wdcount_read(sc)); +#endif + /* Setup initial state of Watchdog Control. */ wdctrl_write(sc, AMDSB_WD_FIRED); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 06:58:42 2011 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 F1AB21065738; Wed, 22 Jun 2011 06:58:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D74E58FC1C; Wed, 22 Jun 2011 06:58: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 p5M6wgVx036315; Wed, 22 Jun 2011 06:58:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M6wgjV036312; Wed, 22 Jun 2011 06:58:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106220658.p5M6wgjV036312@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jun 2011 06:58:42 +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: r223410 - in stable/7: share/man/man4 sys/dev/amdsbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 06:58:43 -0000 Author: avg Date: Wed Jun 22 06:58:42 2011 New Revision: 223410 URL: http://svn.freebsd.org/changeset/base/223410 Log: MFC r222805: amdsbwd: update to support SB8xx southbridges PR: kern/157568 Modified: stable/7/share/man/man4/amdsbwd.4 stable/7/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/share/man/man4/amdsbwd.4 ============================================================================== --- stable/7/share/man/man4/amdsbwd.4 Wed Jun 22 06:45:34 2011 (r223409) +++ stable/7/share/man/man4/amdsbwd.4 Wed Jun 22 06:58:42 2011 (r223410) @@ -25,12 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2009 +.Dd June 7, 2011 .Dt AMDSBWD 4 .Os .Sh NAME .Nm amdsbwd -.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer +.Nd device driver for the AMD SB600/SB7xx/SB8xx watchdog timers .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -51,7 +51,7 @@ The driver provides .Xr watchdog 4 support for the watchdog timers present on -AMD SB600 and SB7xx south bridge chips. +AMD SB600, SB7xx and SB8xx southbridges. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , Modified: stable/7/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/7/sys/dev/amdsbwd/amdsbwd.c Wed Jun 22 06:45:34 2011 (r223409) +++ stable/7/sys/dev/amdsbwd/amdsbwd.c Wed Jun 22 06:58:42 2011 (r223410) @@ -25,8 +25,8 @@ */ /* - * This is a driver for watchdog timer present in AMD SB600/SB7xx - * south bridges and other watchdog timers advertised via WDRT ACPI table. + * This is a driver for watchdog timer present in AMD SB600/SB7xx/SB8xx + * southbridges. * Please see the following specifications for the descriptions of the * registers and flags: * - AMD SB600 Register Reference Guide, Public Version, Rev. 3.03 (SB600 RRG) @@ -35,11 +35,13 @@ * http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf * - AMD SB700/710/750 Register Programming Requirements (RPR) * http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf + * - AMD SB800-Series Southbridges Register Reference Guide (RRG) + * http://support.amd.com/us/Embedded_TechDocs/45482.pdf * Please see the following for Watchdog Resource Table specification: * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT) * http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx - * AMD SB600/SB7xx watchdog hardware seems to conform to the above, - * but my system doesn't provide the table. + * AMD SB600/SB7xx/SB8xx watchdog hardware seems to conform to the above + * specifications, but the table hasn't been spotted in the wild yet. */ #include @@ -59,15 +61,15 @@ __FBSDID("$FreeBSD$"); #include #include -/* RRG 2.3.3.1.1, page 161. */ +/* SB7xx RRG 2.3.3.1.1. */ #define AMDSB_PMIO_INDEX 0xcd6 #define AMDSB_PMIO_DATA (PMIO_INDEX + 1) #define AMDSB_PMIO_WIDTH 2 -/* RRG 2.3.3.2, page 181. */ +/* SB7xx RRG 2.3.3.2. */ #define AMDSB_PM_RESET_STATUS0 0x44 #define AMDSB_PM_RESET_STATUS1 0x45 #define AMDSB_WD_RST_STS 0x02 -/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */ +/* SB7xx RRG 2.3.3.2, RPR 2.36. */ #define AMDSB_PM_WDT_CTRL 0x69 #define AMDSB_WDT_DISABLE 0x01 #define AMDSB_WDT_RES_MASK (0x02 | 0x04) @@ -77,7 +79,18 @@ __FBSDID("$FreeBSD$"); #define AMDSB_WDT_RES_1S 0x06 #define AMDSB_PM_WDT_BASE_LSB 0x6c #define AMDSB_PM_WDT_BASE_MSB 0x6f -/* RRG 2.3.4, page 223, WDRT. */ +/* SB8xx RRG 2.3.3. */ +#define AMDSB8_PM_WDT_EN 0x48 +#define AMDSB8_WDT_DEC_EN 0x01 +#define AMDSB8_WDT_DISABLE 0x02 +#define AMDSB8_PM_WDT_CTRL 0x4c +#define AMDSB8_WDT_32KHZ 0x00 +#define AMDSB8_WDT_1HZ 0x03 +#define AMDSB8_WDT_RES_MASK 0x03 +#define AMDSB8_PM_RESET_STATUS0 0xC0 +#define AMDSB8_PM_RESET_STATUS1 0xC1 +#define AMDSB8_WD_RST_STS 0x20 +/* SB7xx RRG 2.3.4, WDRT. */ #define AMDSB_WD_CTRL 0x00 #define AMDSB_WD_RUN 0x01 #define AMDSB_WD_FIRED 0x02 @@ -90,8 +103,9 @@ __FBSDID("$FreeBSD$"); #define AMDSB_WDIO_REG_WIDTH 4 /* WDRT */ #define MAXCOUNT_MIN_VALUE 511 -/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page 97. */ -#define AMDSB7xx_SMBUS_DEVID 0x43851002 +/* SB7xx RRG 2.3.1.1, SB600 RRG 2.3.1.1, SB8xx RRG 2.3.1. */ +#define AMDSB_SMBUS_DEVID 0x43851002 +#define AMDSB8_SMBUS_REVID 0x40 #define amdsbwd_verbose_printf(dev, ...) \ do { \ @@ -265,7 +279,7 @@ amdsbwd_identify(driver_t *driver, devic smb_dev = pci_find_bsf(0, 20, 0); if (smb_dev == NULL) return; - if (pci_get_devid(smb_dev) != AMDSB7xx_SMBUS_DEVID) + if (pci_get_devid(smb_dev) != AMDSB_SMBUS_DEVID) return; child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); @@ -273,15 +287,102 @@ amdsbwd_identify(driver_t *driver, devic device_printf(parent, "add amdsbwd child failed\n"); } + +static void +amdsbwd_probe_sb7xx(device_t dev, struct resource *pmres, uint32_t *addr) +{ + uint32_t val; + int i; + + /* Report cause of previous reset for user's convenience. */ + val = pmio_read(pmres, AMDSB_PM_RESET_STATUS0); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); + val = pmio_read(pmres, AMDSB_PM_RESET_STATUS1); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + if ((val & AMDSB_WD_RST_STS) != 0) + device_printf(dev, "Previous Reset was caused by Watchdog\n"); + + /* Find base address of memory mapped WDT registers. */ + for (*addr = 0, i = 0; i < 4; i++) { + *addr <<= 8; + *addr |= pmio_read(pmres, AMDSB_PM_WDT_BASE_MSB - i); + } + /* Set watchdog timer tick to 1s. */ + val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_RES_MASK; + val |= AMDSB_WDT_RES_10MS; + pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); + + /* Enable watchdog device (in stopped state). */ + val = pmio_read(pmres, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_DISABLE; + pmio_write(pmres, AMDSB_PM_WDT_CTRL, val); + + /* + * XXX TODO: Ensure that watchdog decode is enabled + * (register 0x41, bit 3). + */ + device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer"); +} + +static void +amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr) +{ + uint32_t val; + int i; + + /* Report cause of previous reset for user's convenience. */ + val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); + val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + if ((val & AMDSB8_WD_RST_STS) != 0) + device_printf(dev, "Previous Reset was caused by Watchdog\n"); + + /* Find base address of memory mapped WDT registers. */ + for (*addr = 0, i = 0; i < 4; i++) { + *addr <<= 8; + *addr |= pmio_read(pmres, AMDSB8_PM_WDT_EN + 3 - i); + } + *addr &= ~0x07u; + + /* Set watchdog timer tick to 1s. */ + val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL); + val &= ~AMDSB8_WDT_RES_MASK; + val |= AMDSB8_WDT_1HZ; + pmio_write(pmres, AMDSB8_PM_WDT_CTRL, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDSB8_PM_WDT_CTRL); + amdsbwd_verbose_printf(dev, "AMDSB8_PM_WDT_CTRL value = %#02x\n", val); +#endif + + /* + * Enable watchdog device (in stopped state) + * and decoding of its address. + */ + val = pmio_read(pmres, AMDSB8_PM_WDT_EN); + val &= ~AMDSB8_WDT_DISABLE; + val |= AMDSB8_WDT_DEC_EN; + pmio_write(pmres, AMDSB8_PM_WDT_EN, val); +#ifdef AMDSBWD_DEBUG + val = pmio_read(pmres, AMDSB8_PM_WDT_EN); + device_printf(dev, "AMDSB8_PM_WDT_EN value = %#02x\n", val); +#endif + device_set_desc(dev, "AMD SB8xx Watchdog Timer"); +} + static int amdsbwd_probe(device_t dev) { struct resource *res; + device_t smb_dev; uint32_t addr; - uint32_t val; int rid; int rc; - int i; /* Do not claim some ISA PnP device by accident. */ if (isa_get_logicalid(dev) != 0) @@ -301,21 +402,16 @@ amdsbwd_probe(device_t dev) return (ENXIO); } - /* Report cause of previous reset for user's convenience. */ - val = pmio_read(res, AMDSB_PM_RESET_STATUS0); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); - val = pmio_read(res, AMDSB_PM_RESET_STATUS1); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); - if ((val & AMDSB_WD_RST_STS) != 0) - device_printf(dev, "Previous Reset was caused by Watchdog\n"); + smb_dev = pci_find_bsf(0, 20, 0); + KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); + if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + amdsbwd_probe_sb7xx(dev, res, &addr); + else + amdsbwd_probe_sb8xx(dev, res, &addr); + + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + bus_delete_resource(dev, SYS_RES_IOPORT, rid); - /* Find base address of memory mapped WDT registers. */ - for (addr = 0, i = 0; i < 4; i++) { - addr <<= 8; - addr |= pmio_read(res, AMDSB_PM_WDT_BASE_MSB - i); - } amdsbwd_verbose_printf(dev, "memory base address = %#010x\n", addr); rc = bus_set_resource(dev, SYS_RES_MEMORY, 0, addr + AMDSB_WD_CTRL, AMDSB_WDIO_REG_WIDTH); @@ -330,36 +426,25 @@ amdsbwd_probe(device_t dev) return (ENXIO); } - /* Set watchdog timer tick to 10ms. */ - val = pmio_read(res, AMDSB_PM_WDT_CTRL); - val &= ~AMDSB_WDT_RES_MASK; - val |= AMDSB_WDT_RES_10MS; - pmio_write(res, AMDSB_PM_WDT_CTRL, val); - - /* Enable watchdog device (in stopped state). */ - val = pmio_read(res, AMDSB_PM_WDT_CTRL); - val &= ~AMDSB_WDT_DISABLE; - pmio_write(res, AMDSB_PM_WDT_CTRL, val); - - /* - * XXX TODO: Ensure that watchdog decode is enabled - * (register 0x41, bit 3). - */ - bus_release_resource(dev, SYS_RES_IOPORT, rid, res); - bus_delete_resource(dev, SYS_RES_IOPORT, rid); - - device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer"); return (0); } static int amdsbwd_attach_sb(device_t dev, struct amdsbwd_softc *sc) { + device_t smb_dev; + sc->max_ticks = UINT16_MAX; - sc->ms_per_tick = 10; sc->rid_ctrl = 0; sc->rid_count = 1; + smb_dev = pci_find_bsf(0, 20, 0); + KASSERT(smb_dev != NULL, ("can't find SMBus PCI device\n")); + if (pci_get_revid(smb_dev) < AMDSB8_SMBUS_REVID) + sc->ms_per_tick = 10; + else + sc->ms_per_tick = 1000; + sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid_ctrl, RF_ACTIVE); if (sc->res_ctrl == NULL) { @@ -388,6 +473,11 @@ amdsbwd_attach(device_t dev) if (rc != 0) goto fail; +#ifdef AMDSBWD_DEBUG + device_printf(dev, "wd ctrl = %#04x\n", wdctrl_read(sc)); + device_printf(dev, "wd count = %#04x\n", wdcount_read(sc)); +#endif + /* Setup initial state of Watchdog Control. */ wdctrl_write(sc, AMDSB_WD_FIRED); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 07:08:44 2011 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 864F810657E6; Wed, 22 Jun 2011 07:08:44 +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 73D778FC20; Wed, 22 Jun 2011 07:08: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 p5M78iHu036682; Wed, 22 Jun 2011 07:08:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M78ipT036672; Wed, 22 Jun 2011 07:08:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106220708.p5M78ipT036672@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jun 2011 07:08: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: r223411 - in stable/8/sys: dev/sound/usb dev/usb dev/usb/input dev/usb/storage netgraph/bluetooth/drivers/ubt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 07:08:44 -0000 Author: avg Date: Wed Jun 22 07:08:44 2011 New Revision: 223411 URL: http://svn.freebsd.org/changeset/base/223411 Log: MFC r222051,222055: usb: change to one-pass probing of device drivers Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/usb/input/uhid.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/input/ums.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/storage/ustorage_fs.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usbdi.h stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Jun 22 07:08:44 2011 (r223411) @@ -539,9 +539,6 @@ uaudio_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - if (uaa->use_generic == 0) - return (ENXIO); - /* lookup non-standard device */ if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { @@ -555,7 +552,7 @@ uaudio_probe(device_t dev) if (usb_test_quirk(uaa, UQ_BAD_AUDIO)) return (ENXIO); else - return (0); + return (BUS_PROBE_GENERIC); } /* check for MIDI stream */ @@ -564,7 +561,7 @@ uaudio_probe(device_t dev) if (usb_test_quirk(uaa, UQ_BAD_MIDI)) return (ENXIO); else - return (0); + return (BUS_PROBE_GENERIC); } return (ENXIO); } Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/input/uhid.c Wed Jun 22 07:08:44 2011 (r223411) @@ -617,10 +617,6 @@ uhid_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give Mouse and Keyboard drivers a try first */ - return (ENXIO); - } if (uaa->info.bInterfaceClass != UICLASS_HID) { /* the Xbox 360 gamepad doesn't use the HID class */ Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/input/ukbd.c Wed Jun 22 07:08:44 2011 (r223411) @@ -771,7 +771,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) return (ENXIO); else - return (BUS_PROBE_GENERIC); + return (BUS_PROBE_DEFAULT); } error = usbd_req_get_hid_desc(uaa->device, NULL, @@ -793,7 +793,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) error = ENXIO; else - error = BUS_PROBE_GENERIC; + error = BUS_PROBE_DEFAULT; } else error = ENXIO; Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/input/ums.c Wed Jun 22 07:08:44 2011 (r223411) @@ -373,7 +373,7 @@ ums_probe(device_t dev) if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) - return (BUS_PROBE_GENERIC); + return (BUS_PROBE_DEFAULT); error = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -383,7 +383,7 @@ ums_probe(device_t dev) if (hid_is_collection(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) - error = BUS_PROBE_GENERIC; + error = BUS_PROBE_DEFAULT; else error = ENXIO; Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/storage/umass.c Wed Jun 22 07:08:44 2011 (r223411) @@ -782,6 +782,7 @@ umass_probe_proto(device_t dev, struct u uint32_t proto = umass_get_proto(uaa->iface); memset(&ret, 0, sizeof(ret)); + ret.error = BUS_PROBE_GENERIC; /* Search for protocol enforcement */ @@ -870,10 +871,6 @@ umass_probe(device_t dev) if (uaa->usb_mode != USB_MODE_HOST) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give other drivers a try first */ - return (ENXIO); - } temp = umass_probe_proto(dev, uaa); return (temp.error); Modified: stable/8/sys/dev/usb/storage/ustorage_fs.c ============================================================================== --- stable/8/sys/dev/usb/storage/ustorage_fs.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/storage/ustorage_fs.c Wed Jun 22 07:08:44 2011 (r223411) @@ -334,10 +334,6 @@ ustorage_fs_probe(device_t dev) if (uaa->usb_mode != USB_MODE_DEVICE) { return (ENXIO); } - if (uaa->use_generic == 0) { - /* give other drivers a try first */ - return (ENXIO); - } /* Check for a standards compliant device */ id = usbd_get_interface_descriptor(uaa->iface); if ((id == NULL) || @@ -346,7 +342,7 @@ ustorage_fs_probe(device_t dev) (id->bInterfaceProtocol != UIPROTO_MASS_BBB)) { return (ENXIO); } - return (0); + return (BUS_PROBE_GENERIC); } static int Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/usb_device.c Wed Jun 22 07:08:44 2011 (r223411) @@ -1334,7 +1334,6 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex = i; uaa.info.bIfaceNum = iface->idesc->bInterfaceNumber; - uaa.use_generic = 0; uaa.driver_info = 0; /* reset driver_info */ DPRINTFN(2, "iclass=%u/%u/%u iindex=%u/%u\n", @@ -1344,16 +1343,6 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex, uaa.info.bIfaceNum); - /* try specific interface drivers first */ - - if (usb_probe_and_attach_sub(udev, &uaa)) { - /* ignore */ - } - /* try generic interface drivers last */ - - uaa.use_generic = 1; - uaa.driver_info = 0; /* reset driver_info */ - if (usb_probe_and_attach_sub(udev, &uaa)) { /* ignore */ } Modified: stable/8/sys/dev/usb/usbdi.h ============================================================================== --- stable/8/sys/dev/usb/usbdi.h Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/dev/usb/usbdi.h Wed Jun 22 07:08:44 2011 (r223411) @@ -357,7 +357,6 @@ struct usb_attach_arg { struct usb_interface *iface; /* current interface */ enum usb_hc_mode usb_mode; /* host or device mode */ uint8_t port; - uint8_t use_generic; /* hint for generic drivers */ uint8_t dev_state; #define UAA_DEV_READY 0 #define UAA_DEV_DISABLED 1 Modified: stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Jun 22 06:58:42 2011 (r223410) +++ stable/8/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Wed Jun 22 07:08:44 2011 (r223411) @@ -409,6 +409,7 @@ static int ubt_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); @@ -416,14 +417,14 @@ ubt_probe(device_t dev) if (uaa->info.bIfaceIndex != 0) return (ENXIO); - if (uaa->use_generic == 0) - return (ENXIO); - if (usbd_lookup_id_by_uaa(ubt_ignore_devs, sizeof(ubt_ignore_devs), uaa) == 0) return (ENXIO); - return (usbd_lookup_id_by_uaa(ubt_devs, sizeof(ubt_devs), uaa)); + error = usbd_lookup_id_by_uaa(ubt_devs, sizeof(ubt_devs), uaa); + if (error == 0) + return (BUS_PROBE_GENERIC); + return (error); } /* ubt_probe */ /* From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 07:15:57 2011 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 98DB010657AD; Wed, 22 Jun 2011 07:15: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 6E9568FC12; Wed, 22 Jun 2011 07:15: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 p5M7FvqI036949; Wed, 22 Jun 2011 07:15:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M7Fvc8036946; Wed, 22 Jun 2011 07:15:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106220715.p5M7Fvc8036946@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jun 2011 07:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223412 - in stable/8/sys/cddl/compat/opensolaris: 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: Wed, 22 Jun 2011 07:15:57 -0000 Author: avg Date: Wed Jun 22 07:15:57 2011 New Revision: 223412 URL: http://svn.freebsd.org/changeset/base/223412 Log: MFC r222670: opensolaris compat / zfs: avoid early overflow in ddi_get_lbolt* Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris.c stable/8/sys/cddl/compat/opensolaris/sys/time.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris.c Wed Jun 22 07:08:44 2011 (r223411) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris.c Wed Jun 22 07:15:57 2011 (r223412) @@ -40,6 +40,7 @@ cpu_core_t cpu_core[MAXCPU]; kmutex_t cpu_lock; solaris_cpu_t solaris_cpu[MAXCPU]; +int nsec_per_tick; /* * OpenSolaris subsystem initialisation. @@ -60,6 +61,8 @@ opensolaris_load(void *dummy) } mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL); + + nsec_per_tick = NANOSEC / hz; } SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL); Modified: stable/8/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/time.h Wed Jun 22 07:08:44 2011 (r223411) +++ stable/8/sys/cddl/compat/opensolaris/sys/time.h Wed Jun 22 07:15:57 2011 (r223412) @@ -62,8 +62,21 @@ gethrtime(void) { #define gethrestime(ts) getnanotime(ts) #define gethrtime_waitfree() gethrtime() -#define ddi_get_lbolt() ((gethrtime() * hz) / NANOSEC) -#define ddi_get_lbolt64() (int64_t)((gethrtime() * hz) / NANOSEC) +extern int nsec_per_tick; /* nanoseconds per clock tick */ + +static __inline int64_t +ddi_get_lbolt64(void) +{ + + return (gethrtime() / nsec_per_tick); +} + +static __inline clock_t +ddi_get_lbolt(void) +{ + + return (ddi_get_lbolt64()); +} #else From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 07:18:15 2011 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 3E4CF1065672; Wed, 22 Jun 2011 07:18:15 +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 1432D8FC13; Wed, 22 Jun 2011 07:18: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 p5M7IEWX037072; Wed, 22 Jun 2011 07:18:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M7IEBj037069; Wed, 22 Jun 2011 07:18:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201106220718.p5M7IEBj037069@svn.freebsd.org> From: Andriy Gapon Date: Wed, 22 Jun 2011 07:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223413 - in stable/8/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: Wed, 22 Jun 2011 07:18:15 -0000 Author: avg Date: Wed Jun 22 07:18:14 2011 New Revision: 223413 URL: http://svn.freebsd.org/changeset/base/223413 Log: MFC r222756: don't use cpuid level 4 in x86 cpu topology detection if it's not supported Modified: stable/8/sys/amd64/amd64/mp_machdep.c stable/8/sys/i386/i386/mp_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/mp_machdep.c Wed Jun 22 07:15:57 2011 (r223412) +++ stable/8/sys/amd64/amd64/mp_machdep.c Wed Jun 22 07:18:14 2011 (r223413) @@ -234,8 +234,11 @@ topo_probe_0x4(void) * logical processors that belong to the same core * as BSP thus deducing number of threads per core. */ - cpuid_count(0x04, 0, p); - max_cores = ((p[0] >> 26) & 0x3f) + 1; + if (cpu_high >= 0x4) { + cpuid_count(0x04, 0, p); + max_cores = ((p[0] >> 26) & 0x3f) + 1; + } else + max_cores = 1; core_id_bits = mask_width(max_logical/max_cores); if (core_id_bits < 0) return; Modified: stable/8/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/8/sys/i386/i386/mp_machdep.c Wed Jun 22 07:15:57 2011 (r223412) +++ stable/8/sys/i386/i386/mp_machdep.c Wed Jun 22 07:18:14 2011 (r223413) @@ -288,8 +288,11 @@ topo_probe_0x4(void) * logical processors that belong to the same core * as BSP thus deducing number of threads per core. */ - cpuid_count(0x04, 0, p); - max_cores = ((p[0] >> 26) & 0x3f) + 1; + if (cpu_high >= 0x4) { + cpuid_count(0x04, 0, p); + max_cores = ((p[0] >> 26) & 0x3f) + 1; + } else + max_cores = 1; core_id_bits = mask_width(max_logical/max_cores); if (core_id_bits < 0) return; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 07:53:27 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id 4BE5C1065691; Wed, 22 Jun 2011 07:53:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Wed, 22 Jun 2011 07:56:04 +0000 From: Ruslan Ermilov To: Jilles Tjoelker Message-ID: <20110622075603.GA70438@lo0.su> References: <201106211934.p5LJYvsP013837@svn.freebsd.org> <20110621202802.GA28834@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110621202802.GA28834@stack.nl> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223372 - head/bin/realpath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 07:53:27 -0000 On Tue, Jun 21, 2011 at 10:28:03PM +0200, Jilles Tjoelker wrote: > On Tue, Jun 21, 2011 at 07:34:57PM +0000, Ruslan Ermilov wrote: > > Author: ru > > Date: Tue Jun 21 19:34:57 2011 > > New Revision: 223372 > > URL: http://svn.freebsd.org/changeset/base/223372 > > > Log: > > Make ``realpath'' behave like ``realpath .''. > > Is this being added for compatibility with something? > > If not, why do we need this non-standard extension if the shorter and > standard pwd -P already fulfills this function? I treat it as a convenient addition to a non-standard utility. realpath(1) was first added in FreeBSD in year 2000 by phk@, as a convenience utility. In r90523 the ability to call "realpath" without arguments (with a similar behavior but different implementation) was added by mike@. Ten months later, this syntax was removed by johan@ in r108034. I'm not aware of any standard and/or another non-FreeBSD based OS that also have this utility (only saw a mention of a patch that adds an utility of the same name into GNU shell-utils, but it seems to have never happened). We could emphasize this: Index: realpath.1 =================================================================== --- realpath.1 (revision 223372) +++ realpath.1 (working copy) @@ -69,6 +69,10 @@ fails. .Sh EXIT STATUS .Ex -std +.Sh COMPATIBILITY +The +.Nm +utility is non-standard and should not be used in portable scripts. .Sh SEE ALSO .Xr realpath 3 .Sh HISTORY Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:01:45 2011 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 06AF210657BB; Wed, 22 Jun 2011 08:01:45 +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 E8EFC8FC15; Wed, 22 Jun 2011 08:01: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 p5M81iKt038514; Wed, 22 Jun 2011 08:01:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M81ikp038505; Wed, 22 Jun 2011 08:01:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106220801.p5M81ikp038505@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Jun 2011 08:01: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: r223414 - stable/8/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: Wed, 22 Jun 2011 08:01:45 -0000 Author: hselasky Date: Wed Jun 22 08:01:44 2011 New Revision: 223414 URL: http://svn.freebsd.org/changeset/base/223414 Log: MFC r222786 and r222790: Improve enumeration of Low- and Full-speed devices connected through a High-speed USB HUB. Modified: stable/8/sys/dev/usb/usb_device.h stable/8/sys/dev/usb/usb_freebsd.h stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_request.h stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usbdi.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_device.h ============================================================================== --- stable/8/sys/dev/usb/usb_device.h Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_device.h Wed Jun 22 08:01:44 2011 (r223414) @@ -187,6 +187,8 @@ struct usb_device { struct usb_host_endpoint *linux_endpoint_end; uint16_t devnum; #endif + + uint32_t clear_stall_errors; /* number of clear-stall failures */ }; /* globals */ Modified: stable/8/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/8/sys/dev/usb/usb_freebsd.h Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_freebsd.h Wed Jun 22 08:01:44 2011 (r223414) @@ -58,6 +58,7 @@ #define USB_HUB_MAX_DEPTH 5 #define USB_EP0_BUFSIZE 1024 /* bytes */ +#define USB_CS_RESET_LIMIT 20 /* failures = 20 * 50 ms = 1sec */ typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_generic.c Wed Jun 22 08:01:44 2011 (r223414) @@ -966,10 +966,8 @@ ugen_re_enumerate(struct usb_fifo *f) /* ignore any errors */ DPRINTFN(6, "no FIFOs\n"); } - if (udev->re_enumerate_wait == 0) { - udev->re_enumerate_wait = 1; - usb_needs_explore(udev->bus, 0); - } + /* start re-enumeration of device */ + usbd_start_re_enumerate(udev); return (0); } Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_hub.c Wed Jun 22 08:01:44 2011 (r223414) @@ -242,9 +242,14 @@ uhub_explore_sub(struct uhub_softc *sc, if (child->flags.usb_mode == USB_MODE_HOST) { usbd_enum_lock(child); if (child->re_enumerate_wait) { - err = usbd_set_config_index(child, USB_UNCONFIG_INDEX); - if (err == 0) - err = usbd_req_re_enumerate(child, NULL); + err = usbd_set_config_index(child, + USB_UNCONFIG_INDEX); + if (err != 0) { + DPRINTF("Unconfigure failed: " + "%s: Ignored.\n", + usbd_errstr(err)); + } + err = usbd_req_re_enumerate(child, NULL); if (err == 0) err = usbd_set_config_index(child, 0); if (err == 0) { @@ -2471,3 +2476,19 @@ usbd_filter_power_mode(struct usb_device /* use fixed power mode given by hardware driver */ return (temp); } + +/*------------------------------------------------------------------------* + * usbd_start_re_enumerate + * + * This function starts re-enumeration of the given USB device. This + * function does not need to be called BUS-locked. This function does + * not wait until the re-enumeration is completed. + *------------------------------------------------------------------------*/ +void +usbd_start_re_enumerate(struct usb_device *udev) +{ + if (udev->re_enumerate_wait == 0) { + udev->re_enumerate_wait = 1; + usb_needs_explore(udev->bus, 0); + } +} Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_request.c Wed Jun 22 08:01:44 2011 (r223414) @@ -238,6 +238,10 @@ usb_do_clear_stall_callback(struct usb_x switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: + + /* reset error counter */ + udev->clear_stall_errors = 0; + if (ep == NULL) goto tr_setup; /* device was unconfigured */ if (ep->edesc && @@ -289,8 +293,23 @@ tr_setup: goto tr_setup; default: - if (xfer->error == USB_ERR_CANCELLED) { + if (error == USB_ERR_CANCELLED) break; + + DPRINTF("Clear stall failed.\n"); + if (udev->clear_stall_errors == USB_CS_RESET_LIMIT) + goto tr_setup; + + if (error == USB_ERR_TIMEOUT) { + udev->clear_stall_errors = USB_CS_RESET_LIMIT; + DPRINTF("Trying to re-enumerate.\n"); + usbd_start_re_enumerate(udev); + } else { + udev->clear_stall_errors++; + if (udev->clear_stall_errors == USB_CS_RESET_LIMIT) { + DPRINTF("Trying to re-enumerate.\n"); + usbd_start_re_enumerate(udev); + } } goto tr_setup; } @@ -1936,6 +1955,23 @@ usbd_req_re_enumerate(struct usb_device return (USB_ERR_INVAL); } retry: + /* + * Try to reset the High Speed parent HUB of a LOW- or FULL- + * speed device, if any. + */ + if (udev->parent_hs_hub != NULL && + udev->speed != USB_SPEED_HIGH) { + DPRINTF("Trying to reset parent High Speed TT.\n"); + err = usbd_req_reset_tt(udev->parent_hs_hub, NULL, + udev->hs_port_no); + if (err) { + DPRINTF("Resetting parent High " + "Speed TT failed (%s).\n", + usbd_errstr(err)); + } + } + + /* Try to reset the parent HUB port. */ err = usbd_req_reset_port(parent_hub, mtx, udev->port_no); if (err) { DPRINTFN(0, "addr=%d, port reset failed, %s\n", @@ -2033,3 +2069,65 @@ usbd_req_set_device_feature(struct usb_d USETW(req.wLength, 0); return (usbd_do_request(udev, mtx, &req, 0)); } + +/*------------------------------------------------------------------------* + * usbd_req_reset_tt + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb_error_t +usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx, + uint8_t port) +{ + struct usb_device_request req; + + /* For single TT HUBs the port should be 1 */ + + if (udev->ddesc.bDeviceClass == UDCLASS_HUB && + udev->ddesc.bDeviceProtocol == UDPROTO_HSHUBSTT) + port = 1; + + req.bmRequestType = UT_WRITE_CLASS_OTHER; + req.bRequest = UR_RESET_TT; + USETW(req.wValue, 0); + req.wIndex[0] = port; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + return (usbd_do_request(udev, mtx, &req, 0)); +} + +/*------------------------------------------------------------------------* + * usbd_req_clear_tt_buffer + * + * For single TT HUBs the port should be 1. + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb_error_t +usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx, + uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint) +{ + struct usb_device_request req; + uint16_t wValue; + + /* For single TT HUBs the port should be 1 */ + + if (udev->ddesc.bDeviceClass == UDCLASS_HUB && + udev->ddesc.bDeviceProtocol == UDPROTO_HSHUBSTT) + port = 1; + + wValue = (endpoint & 0xF) | ((addr & 0x7F) << 4) | + ((endpoint & 0x80) << 8) | ((type & 3) << 12); + + req.bmRequestType = UT_WRITE_CLASS_OTHER; + req.bRequest = UR_CLEAR_TT_BUFFER; + USETW(req.wValue, wValue); + req.wIndex[0] = port; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + return (usbd_do_request(udev, mtx, &req, 0)); +} Modified: stable/8/sys/dev/usb/usb_request.h ============================================================================== --- stable/8/sys/dev/usb/usb_request.h Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_request.h Wed Jun 22 08:01:44 2011 (r223414) @@ -85,5 +85,9 @@ usb_error_t usbd_req_set_hub_u2_timeout( struct mtx *mtx, uint8_t port, uint8_t timeout); usb_error_t usbd_req_set_hub_depth(struct usb_device *udev, struct mtx *mtx, uint16_t depth); +usb_error_t usbd_req_reset_tt(struct usb_device *udev, struct mtx *mtx, + uint8_t port); +usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx, + uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint); #endif /* _USB_REQUEST_H_ */ Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usb_transfer.c Wed Jun 22 08:01:44 2011 (r223414) @@ -2928,6 +2928,11 @@ repeat: usbd_transfer_unsetup(udev->ctrl_xfer, USB_CTRL_XFER_MAX); /* + * Reset clear stall error counter. + */ + udev->clear_stall_errors = 0; + + /* * Try to setup a new USB transfer for the * default control endpoint: */ Modified: stable/8/sys/dev/usb/usbdi.h ============================================================================== --- stable/8/sys/dev/usb/usbdi.h Wed Jun 22 07:18:14 2011 (r223413) +++ stable/8/sys/dev/usb/usbdi.h Wed Jun 22 08:01:44 2011 (r223414) @@ -542,6 +542,7 @@ void usbd_m_copy_in(struct usb_page_cach struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len); void usbd_frame_zero(struct usb_page_cache *cache, usb_frlength_t offset, usb_frlength_t len); +void usbd_start_re_enumerate(struct usb_device *udev); int usb_fifo_attach(struct usb_device *udev, void *priv_sc, struct mtx *priv_mtx, struct usb_fifo_methods *pm, From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:09:51 2011 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 435691065712; Wed, 22 Jun 2011 08:09:51 +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 323E08FC25; Wed, 22 Jun 2011 08:09: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 p5M89of2038812; Wed, 22 Jun 2011 08:09:50 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M89o1M038810; Wed, 22 Jun 2011 08:09:50 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106220809.p5M89o1M038810@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Jun 2011 08:09: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: r223415 - 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: Wed, 22 Jun 2011 08:09:51 -0000 Author: hselasky Date: Wed Jun 22 08:09:50 2011 New Revision: 223415 URL: http://svn.freebsd.org/changeset/base/223415 Log: MFC r219221: Remove dependency to ucom from ulpt. Modified: stable/8/sys/dev/usb/serial/ulpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/ulpt.c ============================================================================== --- stable/8/sys/dev/usb/serial/ulpt.c Wed Jun 22 08:01:44 2011 (r223414) +++ stable/8/sys/dev/usb/serial/ulpt.c Wed Jun 22 08:09:50 2011 (r223415) @@ -743,5 +743,4 @@ static driver_t ulpt_driver = { DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass, NULL, 0); MODULE_DEPEND(ulpt, usb, 1, 1, 1); -MODULE_DEPEND(ulpt, ucom, 1, 1, 1); MODULE_VERSION(ulpt, 1); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:20:02 2011 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 3676810656AD; Wed, 22 Jun 2011 08:20:02 +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 1B04A8FC13; Wed, 22 Jun 2011 08:20: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 p5M8K1Df039225; Wed, 22 Jun 2011 08:20:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M8K10v039224; Wed, 22 Jun 2011 08:20:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106220820.p5M8K10v039224@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 22 Jun 2011 08:20: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: r223416 - 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, 22 Jun 2011 08:20:02 -0000 Author: glebius Date: Wed Jun 22 08:20:01 2011 New Revision: 223416 URL: http://svn.freebsd.org/changeset/base/223416 Log: One more braino from me. Pointy hat to: glebius Submitted by: Alexander V. Chernikov Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Wed Jun 22 08:09:50 2011 (r223415) +++ head/sbin/ipfw/nat.c Wed Jun 22 08:20:01 2011 (r223416) @@ -785,8 +785,9 @@ ipfw_config_nat(int ac, char **av) len += estimate_redir_port(&ac1, &av1); av1 += 2; ac1 -= 2; /* Skip optional remoteIP/port */ - if (ac1 != 0 && isdigit(**av1)) + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; + } break; case TOK_REDIR_PROTO: if (ac1 < 2) @@ -795,10 +796,12 @@ ipfw_config_nat(int ac, char **av) len += sizeof(struct cfg_redir); av1 += 2; ac1 -= 2; /* Skip optional remoteIP/port */ - if (ac1 != 0 && isdigit(**av1)) + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; - if (ac1 != 0 && isdigit(**av1)) + } + if (ac1 != 0 && isdigit(**av1)) { av1++; ac1--; + } break; default: errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:22:29 2011 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 9D3CC1065760; Wed, 22 Jun 2011 08:22:29 +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 72B668FC08; Wed, 22 Jun 2011 08:22: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 p5M8MT28039357; Wed, 22 Jun 2011 08:22:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M8MTpV039354; Wed, 22 Jun 2011 08:22:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106220822.p5M8MTpV039354@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Jun 2011 08:22: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: r223417 - in stable/8/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: Wed, 22 Jun 2011 08:22:29 -0000 Author: hselasky Date: Wed Jun 22 08:22:29 2011 New Revision: 223417 URL: http://svn.freebsd.org/changeset/base/223417 Log: MFC r218864 and r223288. Add new USB ID's. Modified: stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Wed Jun 22 08:20:01 2011 (r223416) +++ stable/8/sys/dev/usb/net/if_udav.c Wed Jun 22 08:22:29 2011 (r223417) @@ -206,6 +206,11 @@ static const struct usb_device_id udav_d {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ST268, 0)}, /* Corega USB-TXC */ {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXC, 0)}, + /* ShanTou AMD8515 USB NIC */ + {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, + /* Kontron AG USB Ethernet */ + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, }; static void Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Jun 22 08:20:01 2011 (r223416) +++ stable/8/sys/dev/usb/usbdevs Wed Jun 22 08:22:29 2011 (r223417) @@ -551,6 +551,7 @@ vendor VTECH 0x0f88 VTech vendor FALCOM 0x0f94 Falcom Wireless Communications GmbH vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations +vendor KONTRON 0x0fe6 Kontron AG vendor QUALCOMM 0x1004 Qualcomm vendor APACER 0x1005 Apacer vendor MOTOROLA4 0x100d Motorola @@ -2009,6 +2010,10 @@ product KODAK DC290 0x0112 Digital Scie product KODAK DC240 0x0120 Digital Science DC240 product KODAK DC280 0x0130 Digital Science DC280 +/* Kontron AG products */ +product KONTRON DM9601 0x8101 USB Ethernet +product KONTRON JP1082 0x9700 USB Ethernet + /* Konica Corp. Products */ product KONICA CAMERA 0x0720 Digital Color Camera @@ -2858,6 +2863,7 @@ product SENAO RT3072_5 0x9801 RT3072 /* ShanTou products */ product SHANTOU ST268 0x0268 ST268 product SHANTOU DM9601 0x9601 DM 9601 +product SHANTOU ADM8515 0x8515 ADM8515 /* Shark products */ product SHARK PA 0x0400 Pocket Adapter From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:52:17 2011 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 17CFF106579D; Wed, 22 Jun 2011 08:52:17 +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 E1CE58FC08; Wed, 22 Jun 2011 08:52: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 p5M8qGpL040396; Wed, 22 Jun 2011 08:52:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M8qG5f040394; Wed, 22 Jun 2011 08:52:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106220852.p5M8qG5f040394@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Jun 2011 08:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223418 - stable/8/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: Wed, 22 Jun 2011 08:52:17 -0000 Author: hselasky Date: Wed Jun 22 08:52:16 2011 New Revision: 223418 URL: http://svn.freebsd.org/changeset/base/223418 Log: MFC r213852: - Add support for LibUSB in 32-bit compatibility mode. Modified: stable/8/sys/dev/usb/usb_ioctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_ioctl.h ============================================================================== --- stable/8/sys/dev/usb/usb_ioctl.h Wed Jun 22 08:22:29 2011 (r223417) +++ stable/8/sys/dev/usb/usb_ioctl.h Wed Jun 22 08:52:16 2011 (r223418) @@ -41,13 +41,21 @@ #define USB_GENERIC_NAME "ugen" struct usb_read_dir { +#ifdef COMPAT_32BIT + uint64_t urd_data; +#else void *urd_data; +#endif uint32_t urd_startentry; uint32_t urd_maxlen; }; struct usb_ctl_request { +#ifdef COMPAT_32BIT + uint64_t ucr_data; +#else void *ucr_data; +#endif uint16_t ucr_flags; uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ @@ -60,7 +68,11 @@ struct usb_alt_interface { }; struct usb_gen_descriptor { +#ifdef COMPAT_32BIT + uint64_t ugd_data; +#else void *ugd_data; +#endif uint16_t ugd_lang_id; uint16_t ugd_maxlen; uint16_t ugd_actlen; @@ -126,9 +138,14 @@ struct usb_fs_endpoint { * NOTE: isochronous USB transfer only use one buffer, but can have * multiple frame lengths ! */ +#ifdef COMPAT_32BIT + uint64_t ppBuffer; + uint64_t pLength; +#else void **ppBuffer; /* pointer to userland buffers */ uint32_t *pLength; /* pointer to frame lengths, updated * to actual length */ +#endif uint32_t nFrames; /* number of frames */ uint32_t aFrames; /* actual number of frames */ uint16_t flags; @@ -150,7 +167,11 @@ struct usb_fs_endpoint { struct usb_fs_init { /* userland pointer to endpoints structure */ +#ifdef COMPAT_32BIT + uint64_t pEndpoints; +#else struct usb_fs_endpoint *pEndpoints; +#endif /* maximum number of endpoints */ uint8_t ep_index_max; }; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 08:55:00 2011 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 A62551065719; Wed, 22 Jun 2011 08:55: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 8E38E8FC08; Wed, 22 Jun 2011 08:55: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 p5M8t0Op040508; Wed, 22 Jun 2011 08:55:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M8t0LD040500; Wed, 22 Jun 2011 08:55:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106220855.p5M8t0LD040500@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 22 Jun 2011 08:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223419 - stable/8/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 08:55:00 -0000 Author: hselasky Date: Wed Jun 22 08:55:00 2011 New Revision: 223419 URL: http://svn.freebsd.org/changeset/base/223419 Log: MFC r210823, r211397, r210933, r219101, r213852, r213849 and r208020: - Add support for LibUSB in 32-bit compatibility mode. - Some manpage related fixes. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb10_desc.c stable/8/lib/libusb/libusb10_io.c stable/8/lib/libusb/libusb20.3 stable/8/lib/libusb/libusb20.c stable/8/lib/libusb/libusb20_int.h stable/8/lib/libusb/libusb20_ugen20.c Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/Makefile Wed Jun 22 08:55:00 2011 (r223419) @@ -28,5 +28,180 @@ SRCS+= libusb10.c SRCS+= libusb10_desc.c SRCS+= libusb10_io.c +.if defined(COMPAT_32BIT) +CFLAGS+= -DCOMPAT_32BIT +.endif + .include +# LibUSB v1.0 +MLINKS += libusb.3 libusb_init.3 +MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_strerror.3 +MLINKS += libusb.3 libusb_set_debug.3 +MLINKS += libusb.3 libusb_get_device_list.3 +MLINKS += libusb.3 libusb_free_device_list.3 +MLINKS += libusb.3 libusb_get_bus_number.3 +MLINKS += libusb.3 libusb_get_device_address.3 +MLINKS += libusb.3 libusb_get_max_packet_size.3 +MLINKS += libusb.3 libusb_ref_device.3 +MLINKS += libusb.3 libusb_unref_device.3 +MLINKS += libusb.3 libusb_open.3 +MLINKS += libusb.3 libusb_open_device_with_vid_pid.3 +MLINKS += libusb.3 libusb_close.3 +MLINKS += libusb.3 libusb_get_device.3 +MLINKS += libusb.3 libusb_get_configuration.3 +MLINKS += libusb.3 libusb_set_configuration.3 +MLINKS += libusb.3 libusb_claim_interface.3 +MLINKS += libusb.3 libusb_release_interface.3 +MLINKS += libusb.3 libusb_set_interface_alt_setting.3 +MLINKS += libusb.3 libusb_clear_halt.3 +MLINKS += libusb.3 libusb_reset_device.3 +MLINKS += libusb.3 libusb_check_connected.3 +MLINKS += libusb.3 libusb_kernel_driver_active.3 +MLINKS += libusb.3 libusb_get_driver.3 +MLINKS += libusb.3 libusb_get_driver_np.3 +MLINKS += libusb.3 libusb_detach_kernel_driver.3 +MLINKS += libusb.3 libusb_detach_kernel_driver_np.3 +MLINKS += libusb.3 libusb_attach_kernel_driver.3 +MLINKS += libusb.3 libusb_get_device_descriptor.3 +MLINKS += libusb.3 libsub_get_active_config_descriptor.3 +MLINKS += libusb.3 libusb_get_config_descriptor.3 +MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 +MLINKS += libusb.3 libusb_free_config_descriptor.3 +MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 +MLINKS += libusb.3 libusb_alloc_transfer.3 +MLINKS += libusb.3 libusb_free_transfer.3 +MLINKS += libusb.3 libusb_submit_transfer.3 +MLINKS += libusb.3 libusb_cancel_transfer.3 +MLINKS += libusb.3 libusb_control_transfer.3 +MLINKS += libusb.3 libusb_bulk_transfer.3 +MLINKS += libusb.3 libusb_interrupt_transfer.3 +MLINKS += libusb.3 libusb_try_lock_events.3 +MLINKS += libusb.3 libusb_lock_events.3 +MLINKS += libusb.3 libusb_unlock_events.3 +MLINKS += libusb.3 libusb_event_handling_ok.3 +MLINKS += libusb.3 libusb_event_handler_active.3 +MLINKS += libusb.3 libusb_lock_event_waiters.3 +MLINKS += libusb.3 libusb_unlock_event_waiters.3 +MLINKS += libusb.3 libusb_wait_for_event.3 +MLINKS += libusb.3 libusb_handle_events_timeout.3 +MLINKS += libusb.3 libusb_handle_events.3 +MLINKS += libusb.3 libusb_handle_events_locked.3 +MLINKS += libusb.3 libusb_get_next_timeout.3 +MLINKS += libusb.3 libusb_set_pollfd_notifiers.3 +MLINKS += libusb.3 libusb_get_pollfds.3 + +# LibUSB v0.1 +MLINKS += libusb.3 usb_open.3 +MLINKS += libusb.3 usb_close.3 +MLINKS += libusb.3 usb_get_string.3 +MLINKS += libusb.3 usb_get_string_simple.3 +MLINKS += libusb.3 usb_get_descriptor_by_endpoint.3 +MLINKS += libusb.3 usb_get_descriptor.3 +MLINKS += libusb.3 usb_parse_descriptor.3 +MLINKS += libusb.3 usb_parse_configuration.3 +MLINKS += libusb.3 usb_destroy_configuration.3 +MLINKS += libusb.3 usb_fetch_and_parse_descriptors.3 +MLINKS += libusb.3 usb_bulk_write.3 +MLINKS += libusb.3 usb_bulk_read.3 +MLINKS += libusb.3 usb_interrupt_write.3 +MLINKS += libusb.3 usb_interrupt_read.3 +MLINKS += libusb.3 usb_control_msg.3 +MLINKS += libusb.3 usb_set_configuration.3 +MLINKS += libusb.3 usb_claim_interface.3 +MLINKS += libusb.3 usb_release_interface.3 +MLINKS += libusb.3 usb_set_altinterface.3 +MLINKS += libusb.3 usb_resetep.3 +MLINKS += libusb.3 usb_clear_halt.3 +MLINKS += libusb.3 usb_reset.3 +MLINKS += libusb.3 usb_strerror.3 +MLINKS += libusb.3 usb_init.3 +MLINKS += libusb.3 usb_set_debug.3 +MLINKS += libusb.3 usb_find_busses.3 +MLINKS += libusb.3 usb_find_devices.3 +MLINKS += libusb.3 usb_device.3 +MLINKS += libusb.3 usb_get_busses.3 +MLINKS += libusb.3 usb_check_connected.3 + +# LibUSB v2.0 +MLINKS += libusb20.3 libusb20_tr_close.3 +MLINKS += libusb20.3 libusb20_tr_open.3 +MLINKS += libusb20.3 libusb20_tr_get_pointer.3 +MLINKS += libusb20.3 libusb20_tr_get_time_complete.3 +MLINKS += libusb20.3 libusb20_tr_get_actual_frames.3 +MLINKS += libusb20.3 libusb20_tr_get_actual_length.3 +MLINKS += libusb20.3 libusb20_tr_get_max_frames.3 +MLINKS += libusb20.3 libusb20_tr_get_max_packet_length.3 +MLINKS += libusb20.3 libusb20_tr_get_max_total_length.3 +MLINKS += libusb20.3 libusb20_tr_get_status.3 +MLINKS += libusb20.3 libusb20_tr_pending.3 +MLINKS += libusb20.3 libusb20_tr_callback_wrapper.3 +MLINKS += libusb20.3 libusb20_tr_clear_stall_sync.3 +MLINKS += libusb20.3 libusb20_tr_drain.3 +MLINKS += libusb20.3 libusb20_tr_set_buffer.3 +MLINKS += libusb20.3 libusb20_tr_set_callback.3 +MLINKS += libusb20.3 libusb20_tr_set_flags.3 +MLINKS += libusb20.3 libusb20_tr_get_length.3 +MLINKS += libusb20.3 libusb20_tr_set_length.3 +MLINKS += libusb20.3 libusb20_tr_set_priv_sc0.3 +MLINKS += libusb20.3 libusb20_tr_set_priv_sc1.3 +MLINKS += libusb20.3 libusb20_tr_set_timeout.3 +MLINKS += libusb20.3 libusb20_tr_set_total_frames.3 +MLINKS += libusb20.3 libusb20_tr_setup_bulk.3 +MLINKS += libusb20.3 libusb20_tr_setup_control.3 +MLINKS += libusb20.3 libusb20_tr_setup_intr.3 +MLINKS += libusb20.3 libusb20_tr_setup_isoc.3 +MLINKS += libusb20.3 libusb20_tr_bulk_intr_sync.3 +MLINKS += libusb20.3 libusb20_tr_start.3 +MLINKS += libusb20.3 libusb20_tr_stop.3 +MLINKS += libusb20.3 libusb20_tr_submit.3 +MLINKS += libusb20.3 libusb20_tr_get_priv_sc0.3 +MLINKS += libusb20.3 libusb20_tr_get_priv_sc1.3 +MLINKS += libusb20.3 libusb20_dev_get_backend_name.3 +MLINKS += libusb20.3 libusb20_dev_get_info.3 +MLINKS += libusb20.3 libusb20_dev_get_iface_desc.3 +MLINKS += libusb20.3 libusb20_dev_get_desc.3 +MLINKS += libusb20.3 libusb20_dev_close.3 +MLINKS += libusb20.3 libusb20_dev_detach_kernel_driver.3 +MLINKS += libusb20.3 libusb20_dev_set_config_index.3 +MLINKS += libusb20.3 libusb20_dev_get_debug.3 +MLINKS += libusb20.3 libusb20_dev_get_fd.3 +MLINKS += libusb20.3 libusb20_dev_kernel_driver_active.3 +MLINKS += libusb20.3 libusb20_dev_open.3 +MLINKS += libusb20.3 libusb20_dev_process.3 +MLINKS += libusb20.3 libusb20_dev_request_sync.3 +MLINKS += libusb20.3 libusb20_dev_req_string_sync.3 +MLINKS += libusb20.3 libusb20_dev_req_string_simple_sync.3 +MLINKS += libusb20.3 libusb20_dev_reset.3 +MLINKS += libusb20.3 libusb20_dev_check_connected.3 +MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 +MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 +MLINKS += libusb20.3 libusb20_dev_alloc_config.3 +MLINKS += libusb20.3 libusb20_dev_alloc.3 +MLINKS += libusb20.3 libusb20_dev_get_address.3 +MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 +MLINKS += libusb20.3 libusb20_dev_get_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_speed.3 +MLINKS += libusb20.3 libusb20_dev_get_config_index.3 +MLINKS += libusb20.3 libusb20_dev_free.3 +MLINKS += libusb20.3 libusb20_dev_set_debug.3 +MLINKS += libusb20.3 libusb20_dev_wait_process.3 +MLINKS += libusb20.3 libusb20_be_get_template.3 +MLINKS += libusb20.3 libusb20_be_set_template.3 +MLINKS += libusb20.3 libusb20_be_get_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_get_quirk_name.3 +MLINKS += libusb20.3 libusb20_be_add_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_remove_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_alloc_default.3 +MLINKS += libusb20.3 libusb20_be_device_foreach.3 +MLINKS += libusb20.3 libusb20_be_dequeue_device.3 +MLINKS += libusb20.3 libusb20_be_enqueue_device.3 +MLINKS += libusb20.3 libusb20_be_free.3 +MLINKS += libusb20.3 libusb20_me_get_1.3 +MLINKS += libusb20.3 libusb20_me_get_2.3 +MLINKS += libusb20.3 libusb20_me_encode.3 +MLINKS += libusb20.3 libusb20_me_decode.3 +MLINKS += libusb20.3 libusb20_desc_foreach.3 Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb.3 Wed Jun 22 08:55:00 2011 (r223419) @@ -153,7 +153,7 @@ disconnected and a LIBUSB_ERROR code on . .Ft libusb_device_handle * .Fn libusb_open_device_with_vid_pid "libusb_context *ctx" "uint16_t vid" "uint16_t pid" -Conveniance function to open a device with is +Convenience function to open a device with is .Fa vid and .Fa pid. @@ -209,7 +209,7 @@ been disconnected and a LIBUSB_ERROR cod .Fn libusb_release_interface "libusb_device_handle *devh" "int interface_number" This function release an interface. All the claimed interface must be released before closing a device. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the -interafce was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been +interface was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and LIBUSB_ERROR on failure. . .Pp @@ -383,7 +383,7 @@ LIBUSB_ERROR code on failure. Perform a USB control transfer. Returns the actual number of bytes transferred on success in the range from and including zero until and including -.Xa wLength . +.Fa wLength . On error a libusb error code is returned, for example LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_NO_DEVICE if the @@ -393,7 +393,10 @@ The libusb error codes are always negati .Pp .Ft int .Fn libusb_bulk_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" -Perform an USB bulk transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT +Perform an USB bulk transfer. +A timeout value of zero means no timeout. +The timeout value is given in milliseconds. +Returns 0 on success, LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and @@ -402,7 +405,10 @@ LIBUSB_ERROR code on other failure. .Pp .Ft int .Fn libusb_interrupt_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" -Perform an USB Interrupt transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT +Perform an USB Interrupt transfer. +A timeout value of zero means no timeout. +The timeout value is given in milliseconds. +Returns 0 on success, LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and Modified: stable/8/lib/libusb/libusb10_desc.c ============================================================================== --- stable/8/lib/libusb/libusb10_desc.c Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb10_desc.c Wed Jun 22 08:55:00 2011 (r223419) @@ -26,11 +26,11 @@ #include -#define libusb_device_handle libusb20_device - #include #include +#define libusb_device_handle libusb20_device + #include "libusb20.h" #include "libusb20_desc.h" #include "libusb20_int.h" Modified: stable/8/lib/libusb/libusb10_io.c ============================================================================== --- stable/8/lib/libusb/libusb10_io.c Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb10_io.c Wed Jun 22 08:55:00 2011 (r223419) @@ -141,7 +141,7 @@ libusb10_handle_events_sub(struct libusb err = LIBUSB_ERROR_IO; if (err < 1) { - for (i = 0; i != nfds; i++) { + for (i = 0; i != (int)nfds; i++) { if (ppdev[i] != NULL) { CTX_UNLOCK(ctx); libusb_unref_device(libusb_get_device(ppdev[i])); @@ -150,7 +150,7 @@ libusb10_handle_events_sub(struct libusb } goto do_done; } - for (i = 0; i != nfds; i++) { + for (i = 0; i != (int)nfds; i++) { if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); Modified: stable/8/lib/libusb/libusb20.3 ============================================================================== --- stable/8/lib/libusb/libusb20.3 Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb20.3 Wed Jun 22 08:55:00 2011 (r223419) @@ -534,7 +534,7 @@ returns a zero terminated string describ .Pp . .Fn libusb20_dev_get_info -retrives the BSD specific usb_device_info structure into the memory location given by +retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . The USB device given by .Fa pdev Modified: stable/8/lib/libusb/libusb20.c ============================================================================== --- stable/8/lib/libusb/libusb20.c Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb20.c Wed Jun 22 08:55:00 2011 (r223419) @@ -326,7 +326,7 @@ libusb20_tr_clear_stall_sync(struct libu void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t frIndex) { - xfer->ppBuffer[frIndex] = buffer; + xfer->ppBuffer[frIndex] = libusb20_pass_ptr(buffer); return; } @@ -392,7 +392,7 @@ libusb20_tr_set_total_frames(struct libu void libusb20_tr_setup_bulk(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -404,7 +404,7 @@ libusb20_tr_setup_control(struct libusb2 { uint16_t len; - xfer->ppBuffer[0] = psetup; + xfer->ppBuffer[0] = libusb20_pass_ptr(psetup); xfer->pLength[0] = 8; /* fixed */ xfer->timeout = timeout; @@ -412,7 +412,7 @@ libusb20_tr_setup_control(struct libusb2 if (len != 0) { xfer->nFrames = 2; - xfer->ppBuffer[1] = pBuf; + xfer->ppBuffer[1] = libusb20_pass_ptr(pBuf); xfer->pLength[1] = len; } else { xfer->nFrames = 1; @@ -423,7 +423,7 @@ libusb20_tr_setup_control(struct libusb2 void libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -437,7 +437,7 @@ libusb20_tr_setup_isoc(struct libusb20_t /* should not happen */ return; } - xfer->ppBuffer[frIndex] = pBuf; + xfer->ppBuffer[frIndex] = libusb20_pass_ptr(pBuf); xfer->pLength[frIndex] = length; return; } @@ -1173,7 +1173,7 @@ libusb20_be_alloc_ugen20(void) { struct libusb20_backend *pbe; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) pbe = libusb20_be_alloc(&libusb20_ugen20_backend); #else pbe = NULL; Modified: stable/8/lib/libusb/libusb20_int.h ============================================================================== --- stable/8/lib/libusb/libusb20_int.h Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb20_int.h Wed Jun 22 08:55:00 2011 (r223419) @@ -31,6 +31,12 @@ #ifndef _LIBUSB20_INT_H_ #define _LIBUSB20_INT_H_ +#ifdef COMPAT_32BIT +#define libusb20_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) +#else +#define libusb20_pass_ptr(ptr) (ptr) +#endif + struct libusb20_device; struct libusb20_backend; struct libusb20_transfer; @@ -146,7 +152,11 @@ struct libusb20_transfer { /* * Pointer to a list of buffer pointers: */ +#ifdef COMPAT_32BIT + uint64_t *ppBuffer; +#else void **ppBuffer; +#endif /* * Pointer to frame lengths, which are updated to actual length * after the USB transfer completes: Modified: stable/8/lib/libusb/libusb20_ugen20.c ============================================================================== --- stable/8/lib/libusb/libusb20_ugen20.c Wed Jun 22 08:52:16 2011 (r223418) +++ stable/8/lib/libusb/libusb20_ugen20.c Wed Jun 22 08:55:00 2011 (r223419) @@ -226,7 +226,7 @@ ugen20_readdir(struct ugen20_urd_state * repeat: if (st->ptr == NULL) { st->urd.urd_startentry += st->nparsed; - st->urd.urd_data = st->buf; + st->urd.urd_data = libusb20_pass_ptr(st->buf); st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; @@ -339,7 +339,7 @@ ugen20_tr_renew(struct libusb20_device * memset(&fs_init, 0, sizeof(fs_init)); - fs_init.pEndpoints = pdev->privBeData; + fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); fs_init.ep_index_max = nMaxTransfer; if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) { @@ -453,7 +453,7 @@ ugen20_get_config_desc_full(struct libus memset(&cdesc, 0, sizeof(cdesc)); memset(&gen_desc, 0, sizeof(gen_desc)); - gen_desc.ugd_data = &cdesc; + gen_desc.ugd_data = libusb20_pass_ptr(&cdesc); gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; @@ -474,7 +474,7 @@ ugen20_get_config_desc_full(struct libus /* make sure memory is initialised */ memset(ptr, 0, len); - gen_desc.ugd_data = ptr; + gen_desc.ugd_data = libusb20_pass_ptr(ptr); gen_desc.ugd_maxlen = len; error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); @@ -666,7 +666,7 @@ ugen20_do_request_sync(struct libusb20_d memset(&req, 0, sizeof(req)); - req.ucr_data = data; + req.ucr_data = libusb20_pass_ptr(data); if (!(flags & LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK)) { req.ucr_flags |= USB_SHORT_XFER_OK; } @@ -764,9 +764,9 @@ ugen20_tr_open(struct libusb20_transfer xfer->maxTotalLength = temp.max_bufsize; xfer->maxPacketLen = temp.max_packet_length; - /* setup buffer and length lists */ - fsep->ppBuffer = xfer->ppBuffer;/* zero copy */ - fsep->pLength = xfer->pLength; /* zero copy */ + /* setup buffer and length lists using zero copy */ + fsep->ppBuffer = libusb20_pass_ptr(xfer->ppBuffer); + fsep->pLength = libusb20_pass_ptr(xfer->pLength); return (0); /* success */ } @@ -886,7 +886,7 @@ ugen20_dev_get_iface_desc(struct libusb2 memset(&ugd, 0, sizeof(ugd)); - ugd.ugd_data = buf; + ugd.ugd_data = libusb20_pass_ptr(buf); ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 09:16:33 2011 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 45C281065770; Wed, 22 Jun 2011 09:16:33 +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 3542D8FC1A; Wed, 22 Jun 2011 09:16: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 p5M9GX2V041217; Wed, 22 Jun 2011 09:16:33 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M9GXJd041215; Wed, 22 Jun 2011 09:16:33 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106220916.p5M9GXJd041215@svn.freebsd.org> From: Kevin Lo Date: Wed, 22 Jun 2011 09:16: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: r223420 - stable/8/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: Wed, 22 Jun 2011 09:16:33 -0000 Author: kevlo Date: Wed Jun 22 09:16:32 2011 New Revision: 223420 URL: http://svn.freebsd.org/changeset/base/223420 Log: MFC r221199: Guard against default ni_chan PR: kern/144642 Submitted by: Arthur Hartwig Modified: stable/8/sys/dev/usb/wlan/if_rum.c Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Wed Jun 22 08:55:00 2011 (r223419) +++ stable/8/sys/dev/usb/wlan/if_rum.c Wed Jun 22 09:16:32 2011 (r223420) @@ -207,7 +207,7 @@ static void rum_init(void *); static void rum_stop(struct rum_softc *); static void rum_load_microcode(struct rum_softc *, const uint8_t *, size_t); -static int rum_prepare_beacon(struct rum_softc *, +static void rum_prepare_beacon(struct rum_softc *, struct ieee80211vap *); static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); @@ -2118,7 +2118,7 @@ rum_load_microcode(struct rum_softc *sc, rum_pause(sc, hz / 8); } -static int +static void rum_prepare_beacon(struct rum_softc *sc, struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; @@ -2126,9 +2126,12 @@ rum_prepare_beacon(struct rum_softc *sc, struct rum_tx_desc desc; struct mbuf *m0; + if (vap->iv_bss->ni_chan == IEEE80211_CHAN_ANYC) + return; + m0 = ieee80211_beacon_alloc(vap->iv_bss, &RUM_VAP(vap)->bo); if (m0 == NULL) { - return ENOBUFS; + return; } tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_bsschan)]; @@ -2143,8 +2146,6 @@ rum_prepare_beacon(struct rum_softc *sc, m0->m_pkthdr.len); m_freem(m0); - - return 0; } static int From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 09:26:33 2011 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 7788C10656B1; Wed, 22 Jun 2011 09:26:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id D63B48FC14; Wed, 22 Jun 2011 09:26:32 +0000 (UTC) Received: by yic13 with SMTP id 13so328921yic.13 for ; Wed, 22 Jun 2011 02:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bhOb7Nxr/QRKmFz2Viv/4izarL7aaeAcEYCcSixx6Ow=; b=wNYd9C2yfvbS6jxgxkgN9TTQR6+i58h+DuR9B8tkaV94NfcACGl2bYPzkgpz3xPAp1 w0uolxd84/MzUTvHGQj7kkHRGI/NCEfSkvyj8vVssbyOFBWGdFMz0YisNrz1wFvJncWb RC19mS8neTOPyscJC1JZtmOQe1z1hr2F63ILw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=NqYIrQWv2Pnj659FUvyZ+hIZN1R2AK+SOCBHlvSg7gQNhFbdAslHuM8NMftDwY35Px zr6eQBicbi7NdNEhSvyv+z4kjaRSR0czEt3MamlMVfeKMxeSujTlmjET2l4crpTd/YwK n5ZqzGWIKOjVaNl4xIjg9RtJW+hmYpmAXfm30= MIME-Version: 1.0 Received: by 10.236.109.19 with SMTP id r19mr680405yhg.289.1308734791880; Wed, 22 Jun 2011 02:26:31 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Wed, 22 Jun 2011 02:26:31 -0700 (PDT) In-Reply-To: References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> Date: Wed, 22 Jun 2011 11:26:31 +0200 X-Google-Sender-Auth: C32054n8MIHgdI9fKYrAh-1-tHU Message-ID: From: Attilio Rao To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 09:26:33 -0000 2011/6/22 Warner Losh : > > On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: > > On 06/21/2011 16:09, Attilio Rao wrote: > > 2011/6/21 Bruce Evans: > > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > Hi Alan, > > Author: alc > > Date: Sun Jun 19 19:13:24 2011 > > New Revision: 223307 > > URL: http://svn.freebsd.org/changeset/base/223307 > > Log: > > =C2=A0Precisely document the synchronization rules for the page's dirty f= ield. > > =C2=A0(Saying that the lock on the object that the page belongs to must b= e > > held > > =C2=A0only represents one aspect of the rules.) > > =C2=A0Eliminate the use of the page queues lock for atomically performing > > read- > > =C2=A0modify-write operations on the dirty field when the underlying > > architecture > > =C2=A0supports atomic operations on char and short types. > > =C2=A0Document the fact that 32KB pages aren't really supported. > > contrary to the tinderbox I'd like to point out that all mips kernels > > built by universe are broken with a SVN HEAD from earlier today. =C2=A0Co= uld you > > please check and see if you can fix it? =C2=A0The errors I get are: > > vm_page.o: In function `vm_page_clear_dirty': > > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 > > against `atomic_clear_8' > > vm_page.o: In function `vm_page_set_validclean': > > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 > > against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > > not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed a= ll their > > old uses for sparc4 in ~Y2K. > > I'm sure they do, they exist in support.S though and may not have the > > _8 form (they may just have the _char version). I may look at the code > > again to be sure. > > > It appears that while mips/include/atomic.h declares the existence of > atomic_clear_8, mips/mips/support.S doesn't implement it. =C2=A0In other = words, > only support for int's and short's is currently implemented, not char's: > > # grep atomic_clear mips/mips/support.S > * atomic_clear_32(u_int32_t *a, u_int32_t b) > LEAF(atomic_clear_32) > END(atomic_clear_32) > * atomic_clear_16(u_int16_t *a, u_int16_t b) > LEAF(atomic_clear_16) > END(atomic_clear_16) > > The current crop of atomic*16 and atomic*8 functions have the restriction > that the address must be 32-bit aligned (and it forces this by aligning t= o > 32-bits silently and then operates on the low 8 or 16 bits in that word!) > I'm guessing that this is likely just wrong. =C2=A0Comments? > Warner That is wrong, of course, and my personal opinion is that one should not implement atomic operations if they cannot be done efficiently (example: if you need to disable interrupts or similar expensive operation just to assure atomicity of operation, just don't support it) as long as not having _8/_char is perfectly fine. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 09:55:29 2011 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 2178E1065672; Wed, 22 Jun 2011 09:55:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11ACC8FC1D; Wed, 22 Jun 2011 09:55: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 p5M9tSNC042378; Wed, 22 Jun 2011 09:55:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M9tSdj042376; Wed, 22 Jun 2011 09:55:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106220955.p5M9tSdj042376@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 22 Jun 2011 09:55: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: r223421 - head/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: Wed, 22 Jun 2011 09:55:29 -0000 Author: ae Date: Wed Jun 22 09:55:28 2011 New Revision: 223421 URL: http://svn.freebsd.org/changeset/base/223421 Log: Document PKT_ALIAS_SKIP_GLOBAL option. Submitted by: Alexander V. Chernikov Modified: head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Wed Jun 22 09:16:32 2011 (r223420) +++ head/sys/netinet/libalias/libalias.3 Wed Jun 22 09:55:28 2011 (r223421) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd June 22, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -257,6 +257,16 @@ Normal packet aliasing is not performed. See .Fn LibAliasProxyRule below for details. +.It Dv PKT_ALIAS_SKIP_GLOBAL +This option is used by +.Pa ipfw_nat +only. Specifying it as a flag to +.Fn LibAliasSetMode +has no effect. See section +.Sx NETWORK ADDRESS TRANSLATION +in +.Xr ipfw 8 +for more details. .El .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 13:41:51 2011 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 00C37106566B; Wed, 22 Jun 2011 13:41:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 988588FC15; Wed, 22 Jun 2011 13:41:49 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA09947; Wed, 22 Jun 2011 16:41:48 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E01F11B.3070602@FreeBSD.org> Date: Wed, 22 Jun 2011 16:41:47 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Justin T. Gibbs" References: <201106102010.p5AKAV8G041541@svn.freebsd.org> In-Reply-To: <201106102010.p5AKAV8G041541@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r222950 - in head: cddl/compat/opensolaris/include sys/cddl/compat/opensolaris/sys 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: Wed, 22 Jun 2011 13:41:51 -0000 on 10/06/2011 23:10 Justin T. Gibbs said the following: > Author: gibbs > Date: Fri Jun 10 20:10:30 2011 > New Revision: 222950 > URL: http://svn.freebsd.org/changeset/base/222950 > > Log: > Remove C constructs that are incompatible with C++ from various > OpenSolaris and ZFS header files. These changes are sufficient > to allow a C++ program to use the libzfs library. Is this going to affect any possible (but improbable?) merges from upstream? And/or from other ZFS/OpenSolaris forks (which should be more likely)? > Note: The majority of these files already included 'extern "C"' > declarations, so the intention of providing C++ compatibility > already existed even if it wasn't provided. > > cddl/compat/opensolaris/include/assert.h: > Wrap our compatibility assert implementation in > 'extern "C"'. Since this is a compatibility header > I matched the Solaris style of doing this explicitly > rather than rely on FreeBSD's __BEGIN/END_DECLS macro. > > sys/cddl/compat/opensolaris/sys/kstat.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: > Rename parameters in function declarations that conflict > with C++ keywords. This was the solution preferred by > members of the Illumos community. > > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: > In C, nested structures are visible in the global namespace, > but in C++, they take on the namespace of the structure in > which they are contained. Flatten nested structure > definitions within struct zfs_cmd so these structures are > visible in the global namespace when compiled in both > languages. > > Sponsored by: Spectra Logic Corporation > > Modified: > head/cddl/compat/opensolaris/include/assert.h > head/sys/cddl/compat/opensolaris/sys/kstat.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 13:48:03 2011 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 F116F1065676; Wed, 22 Jun 2011 13:48:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C3E218FC14; Wed, 22 Jun 2011 13:48:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5DF1D46B0D; Wed, 22 Jun 2011 09:48:03 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED5F48A027; Wed, 22 Jun 2011 09:48:02 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Wed, 22 Jun 2011 09:48:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> In-Reply-To: <20110622063258.D2275@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106220948.02421.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 22 Jun 2011 09:48:03 -0400 (EDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 13:48:04 -0000 On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: > On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: > > > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: > > > > Hi Alan, > > > >> Author: alc > >> Date: Sun Jun 19 19:13:24 2011 > >> New Revision: 223307 > >> URL: http://svn.freebsd.org/changeset/base/223307 > >> > >> Log: > >> Precisely document the synchronization rules for the page's dirty field. > >> (Saying that the lock on the object that the page belongs to must be held > >> only represents one aspect of the rules.) > >> > >> Eliminate the use of the page queues lock for atomically performing read- > >> modify-write operations on the dirty field when the underlying architecture > >> supports atomic operations on char and short types. > >> > >> Document the fact that 32KB pages aren't really supported. > > > > contrary to the tinderbox I'd like to point out that all mips kernels built by universe are broken with a SVN HEAD from earlier today. Could you please check and see if you can fix it? The errors I get are: > > > > vm_page.o: In function `vm_page_clear_dirty': > > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > > vm_page.o: In function `vm_page_set_validclean': > > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' > > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' > > Atomic types shorter than int cannot be used in MI code, since they might > not exist. Apparently they don't exist on mips. jake@ fixed all their > old uses for sparc4 in ~Y2K. I agree. Is there any harm in having the 'dirty' and 'valid' fields in vm_page always be at least of size 'int'? In the case of amd64, vm_page would change from a size of 120 bytes to 128. On i386 I think you'd end up changing the size from 68 to 76. (Using an int results in alignment padding after 'busy'.) Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of RAM, so around 0.18% of RAM would be used on both platforms (presumably the usage would be similar on other platforms as well). At 24 GB of RAM, the extra space is just under 0.20% of RAM (48M). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 13:53:12 2011 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 2641D106566C; Wed, 22 Jun 2011 13:53:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE9F8FC1A; Wed, 22 Jun 2011 13:53:11 +0000 (UTC) Received: by gxk19 with SMTP id 19so854338gxk.17 for ; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7T9ZxVhZrKhXcUzceRQk8X3lNvbf9FLNLqrqlTQ36Xs=; b=JwMtRqzbcKVuMTd61s7PsuU6F3l2XSwFzgaSyac2M70Jkn5OoL3Nd7weVZ3rpN2Jan VUGNtbByh5WH8h40wSxsFYZ+3R2N8/hI0z9j7jMkX+8UcLTvfcmqB+Uk+71pwuFYjuAa Yv5kX+xGiPV6n1F0OWheaKfMjLDPJrPfMfpHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=aNNiALRGHJZrs1u//ZJ09//jWNzToLZL654AF00SfSzm9vdsbabSRDJ6yn01i8adkX o/TTJGUfkDVhy1Mj8nBlkBY0x2FkFqWzEyJ5TZlnt/M4J4TvGuCYDrc39cpoI6Mro4Ni STI1RaXBo5WP8SFsGKoNsImAP2ISq7yRz+hTg= MIME-Version: 1.0 Received: by 10.236.111.20 with SMTP id v20mr1189923yhg.423.1308750790550; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Wed, 22 Jun 2011 06:53:10 -0700 (PDT) In-Reply-To: <201106220948.02421.jhb@freebsd.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <201106220948.02421.jhb@freebsd.org> Date: Wed, 22 Jun 2011 15:53:10 +0200 X-Google-Sender-Auth: oXsgX_O3FNx9NMzsRaHEeE3iCbA Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 13:53:12 -0000 2011/6/22 John Baldwin : > On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >> >> > On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >> > >> > Hi Alan, >> > >> >> Author: alc >> >> Date: Sun Jun 19 19:13:24 2011 >> >> New Revision: 223307 >> >> URL: http://svn.freebsd.org/changeset/base/223307 >> >> >> >> Log: >> >> =C2=A0Precisely document the synchronization rules for the page's dir= ty field. >> >> =C2=A0(Saying that the lock on the object that the page belongs to mu= st be held >> >> =C2=A0only represents one aspect of the rules.) >> >> >> >> =C2=A0Eliminate the use of the page queues lock for atomically perfor= ming read- >> >> =C2=A0modify-write operations on the dirty field when the underlying = architecture >> >> =C2=A0supports atomic operations on char and short types. >> >> >> >> =C2=A0Document the fact that 32KB pages aren't really supported. >> > >> > contrary to the tinderbox I'd like to point out that all mips kernels = built by universe are broken with a SVN HEAD from earlier today. =C2=A0Coul= d > you please check and see if you can fix it? =C2=A0The errors I get are: >> > >> > vm_page.o: In function `vm_page_clear_dirty': >> > /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear= _8' >> > /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_= 26 against `atomic_clear_8' >> > vm_page.o: In function `vm_page_set_validclean': >> > /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear= _8' >> > /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_= 26 against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they migh= t >> not exist. =C2=A0Apparently they don't exist on mips. =C2=A0jake@ fixed = all their >> old uses for sparc4 in ~Y2K. > > I agree. =C2=A0Is there any harm in having the 'dirty' and 'valid' fields= in > vm_page always be at least of size 'int'? > > In the case of amd64, vm_page would change from a size of 120 bytes to 12= 8. > > On i386 I think you'd end up changing the size from 68 to 76. > > (Using an int results in alignment padding after 'busy'.) > > Hmm, that's around 120k of extra vm_page_t space for a machine with 64M o= f > RAM, so around 0.18% of RAM would be used on both platforms (presumably t= he > usage would be similar on other platforms as well). =C2=A0At 24 GB of RAM= , the > extra space is just under 0.20% of RAM (48M). I think that there is a bit of misunderstanding here. The idea here is to use just the atomic 8bits for the architectures that support it and otherwise use the vm_page_queue_lock. Anyway, as not all the architectures have this implementation, rather than replicate a lot of MD code to be used in MI, Alan just went with an explicit stub, where necessary. The real bug I see here is that we thought mips was supporting _8 atomic ops while it doesn't seem to be the case (sorry for being lazy on checking, but I nearly have 0 time). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 15:45:39 2011 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 EA4D3106564A; Wed, 22 Jun 2011 15:45:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 977048FC17; Wed, 22 Jun 2011 15:45:38 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5MFgFMM092998 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 09:42:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 22 Jun 2011 09:42:06 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> To: Attilio Rao X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 22 Jun 2011 09:42:17 -0600 (MDT) Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 15:45:39 -0000 On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote: > 2011/6/22 Warner Losh : >>=20 >> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>=20 >> On 06/21/2011 16:09, Attilio Rao wrote: >>=20 >> 2011/6/21 Bruce Evans: >>=20 >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>=20 >> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>=20 >> Hi Alan, >>=20 >> Author: alc >>=20 >> Date: Sun Jun 19 19:13:24 2011 >>=20 >> New Revision: 223307 >>=20 >> URL: http://svn.freebsd.org/changeset/base/223307 >>=20 >> Log: >>=20 >> Precisely document the synchronization rules for the page's dirty = field. >>=20 >> (Saying that the lock on the object that the page belongs to must be >>=20 >> held >>=20 >> only represents one aspect of the rules.) >>=20 >> Eliminate the use of the page queues lock for atomically performing >>=20 >> read- >>=20 >> modify-write operations on the dirty field when the underlying >>=20 >> architecture >>=20 >> supports atomic operations on char and short types. >>=20 >> Document the fact that 32KB pages aren't really supported. >>=20 >> contrary to the tinderbox I'd like to point out that all mips kernels >>=20 >> built by universe are broken with a SVN HEAD from earlier today. = Could you >>=20 >> please check and see if you can fix it? The errors I get are: >>=20 >> vm_page.o: In function `vm_page_clear_dirty': >>=20 >> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to = `atomic_clear_8' >>=20 >> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: = R_MIPS_26 >>=20 >> against `atomic_clear_8' >>=20 >> vm_page.o: In function `vm_page_set_validclean': >>=20 >> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to = `atomic_clear_8' >>=20 >> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: = R_MIPS_26 >>=20 >> against `atomic_clear_8' >>=20 >> Atomic types shorter than int cannot be used in MI code, since they = might >>=20 >> not exist. Apparently they don't exist on mips. jake@ fixed all = their >>=20 >> old uses for sparc4 in ~Y2K. >>=20 >> I'm sure they do, they exist in support.S though and may not have the >>=20 >> _8 form (they may just have the _char version). I may look at the = code >>=20 >> again to be sure. >>=20 >>=20 >> It appears that while mips/include/atomic.h declares the existence of >> atomic_clear_8, mips/mips/support.S doesn't implement it. In other = words, >> only support for int's and short's is currently implemented, not = char's: >>=20 >> # grep atomic_clear mips/mips/support.S >> * atomic_clear_32(u_int32_t *a, u_int32_t b) >> LEAF(atomic_clear_32) >> END(atomic_clear_32) >> * atomic_clear_16(u_int16_t *a, u_int16_t b) >> LEAF(atomic_clear_16) >> END(atomic_clear_16) >>=20 >> The current crop of atomic*16 and atomic*8 functions have the = restriction >> that the address must be 32-bit aligned (and it forces this by = aligning to >> 32-bits silently and then operates on the low 8 or 16 bits in that = word!) >> I'm guessing that this is likely just wrong. Comments? >> Warner >=20 > That is wrong, of course, and my personal opinion is that one should > not implement atomic operations if they cannot be done efficiently > (example: if you need to disable interrupts or similar expensive > operation just to assure atomicity of operation, just don't support > it) as long as not having _8/_char is perfectly fine. I think it can be efficient, for some reasonable definition of = efficient. The masking and shifting operations aren't that onerous to = write and the instructions cycles would be dwarfed by the ll/sc pair, = which are required to implement atomic. The issue is that the code today is clearly wrong and needs to be fixed. Warner= From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 16:15:16 2011 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 2B35110656F2; Wed, 22 Jun 2011 16:15:16 +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 19BC78FC17; Wed, 22 Jun 2011 16:15: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 p5MGFFR1056372; Wed, 22 Jun 2011 16:15:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MGFFLF056368; Wed, 22 Jun 2011 16:15:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221615.p5MGFFLF056368@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 16:15: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: r223424 - in head/sys: amd64/pci dev/acpica i386/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, 22 Jun 2011 16:15:16 -0000 Author: jhb Date: Wed Jun 22 16:15:15 2011 New Revision: 223424 URL: http://svn.freebsd.org/changeset/base/223424 Log: Add a helper routine to conditionally modify the start address of a resource allocation from an x86 Host-PCI bridge driver so that it can be reused by the ACPI Host-PCI bridge driver (and eventually the MPTable Host-PCI bridge driver) instead of duplicating the same logic. Note that this means that hw.acpi.host_mem_start is now replaced with the hw.pci.host_mem_start tunable that was already used in the non-ACPI case. This also removes hw.acpi.host_mem_start on ia64 where it was not applicable (the implementation was very x86-specific). While here, adjust the logic to apply the new start address on any "wildcard" allocation even if that allocation comes from a subset of the allowable address range. Reviewed by: imp (1) Modified: head/sys/amd64/pci/pci_bus.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/amd64/pci/pci_bus.c Wed Jun 22 16:15:15 2011 (r223424) @@ -302,35 +302,45 @@ legacy_pcib_write_ivar(device_t dev, dev return ENOENT; } +/* + * Helper routine for x86 Host-PCI bridge driver resource allocation. + * This is used to adjust the start address of wildcard allocation + * requests to avoid low addresses that are known to be problematic. + * + * If no memory preference is given, use upper 32MB slot most BIOSes + * use for their memory window. This is typically only used on older + * laptops that don't have PCI busses behind a PCI bridge, so assuming + * > 32MB is likely OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. + */ SYSCTL_DECL(_hw_pci); -static unsigned long legacy_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start); -SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, - &legacy_host_mem_start, 0x80000000, - "Limit the host bridge memory to being above this address. Must be\n\ -set at boot via a tunable."); +static unsigned long host_mem_start = 0x80000000; +TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); +SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, + 0, "Limit the host bridge memory to being above this address."); + +u_long +hostb_alloc_start(int type, u_long start, u_long end, u_long count) +{ + + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < host_mem_start) + start = host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } + return (start); +} struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. - * - * However, this can cause problems for other chipsets, so we make - * this tunable by hw.pci.host_mem_start. - */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = legacy_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) - start = 0x1000; + + start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Jun 22 16:15:15 2011 (r223424) @@ -357,32 +357,14 @@ acpi_pcib_map_msi(device_t pcib, device_ return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); } -static u_long acpi_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.acpi.host_mem_start", &acpi_host_mem_start); - struct resource * acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is likely OK. - * - * PCI-PCI bridges may allocate smaller ranges for their windows, - * but the heuristics here should apply to those, so we allow - * several different end addresses. - */ - if (type == SYS_RES_MEMORY && start == 0UL && (end == ~0UL || - end == 0xffffffff)) - start = acpi_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && (end == ~0UL || - end == 0xffff || end == 0xffffffff)) - start = 0x1000; + +#if defined(__i386__) || defined(__amd64__) + start = hostb_alloc_start(type, start, end, count); +#endif return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 14:33:16 2011 (r223423) +++ head/sys/i386/pci/pci_bus.c Wed Jun 22 16:15:15 2011 (r223424) @@ -519,35 +519,45 @@ legacy_pcib_write_ivar(device_t dev, dev return ENOENT; } +/* + * Helper routine for x86 Host-PCI bridge driver resource allocation. + * This is used to adjust the start address of wildcard allocation + * requests to avoid low addresses that are known to be problematic. + * + * If no memory preference is given, use upper 32MB slot most BIOSes + * use for their memory window. This is typically only used on older + * laptops that don't have PCI busses behind a PCI bridge, so assuming + * > 32MB is likely OK. + * + * However, this can cause problems for other chipsets, so we make + * this tunable by hw.pci.host_mem_start. + */ SYSCTL_DECL(_hw_pci); -static unsigned long legacy_host_mem_start = 0x80000000; -TUNABLE_ULONG("hw.pci.host_mem_start", &legacy_host_mem_start); -SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, - &legacy_host_mem_start, 0x80000000, - "Limit the host bridge memory to being above this address. Must be\n\ -set at boot via a tunable."); +static unsigned long host_mem_start = 0x80000000; +TUNABLE_ULONG("hw.pci.host_mem_start", &host_mem_start); +SYSCTL_ULONG(_hw_pci, OID_AUTO, host_mem_start, CTLFLAG_RDTUN, &host_mem_start, + 0, "Limit the host bridge memory to being above this address."); + +u_long +hostb_alloc_start(int type, u_long start, u_long end, u_long count) +{ + + if (start + count - 1 != end) { + if (type == SYS_RES_MEMORY && start < host_mem_start) + start = host_mem_start; + if (type == SYS_RES_IOPORT && start < 0x1000) + start = 0x1000; + } + return (start); +} struct resource * legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { - /* - * If no memory preference is given, use upper 32MB slot most - * bioses use for their memory window. Typically other bridges - * before us get in the way to assert their preferences on memory. - * Hardcoding like this sucks, so a more MD/MI way needs to be - * found to do it. This is typically only used on older laptops - * that don't have pci busses behind pci bridge, so assuming > 32MB - * is liekly OK. - * - * However, this can cause problems for other chipsets, so we make - * this tunable by hw.pci.host_mem_start. - */ - if (type == SYS_RES_MEMORY && start == 0UL && end == ~0UL) - start = legacy_host_mem_start; - if (type == SYS_RES_IOPORT && start == 0UL && end == ~0UL) - start = 0x1000; + + start = hostb_alloc_start(type, start, end, count); return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 16:40:46 2011 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 1AFCF106566B; Wed, 22 Jun 2011 16:40:46 +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 09FE68FC24; Wed, 22 Jun 2011 16:40: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 p5MGejZi057169; Wed, 22 Jun 2011 16:40:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MGejHY057164; Wed, 22 Jun 2011 16:40:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106221640.p5MGejHY057164@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Jun 2011 16:40: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: r223426 - in head/sys: dev/acpica kern 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: Wed, 22 Jun 2011 16:40:46 -0000 Author: jkim Date: Wed Jun 22 16:40:45 2011 New Revision: 223426 URL: http://svn.freebsd.org/changeset/base/223426 Log: Set negative quality to TSC timecounter when C3 state is enabled for Intel processors unless the invariant TSC bit of CPUID is set. Intel processors may stop incrementing TSC when DPSLP# pin is asserted, according to Intel processor manuals, i. e., TSC timecounter is useless if the processor can enter deep sleep state (C3/C4). This problem was accidentally uncovered by r222869, which increased timecounter quality of P-state invariant TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c). Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) Ian FREISLICH (ianf at clue dot co dot za) Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) - Core2 Duo T5870 (C3 state available/enabled) jkim - Xeon X5150 (C3 state unavailable) Modified: head/sys/dev/acpica/acpi_cpu.c head/sys/kern/kern_clocksource.c head/sys/sys/systm.h head/sys/x86/x86/tsc.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:40:45 2011 (r223426) @@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; + else + cpu_can_deep_sleep = 1; } sbuf_trim(&sb); sbuf_finish(&sb); Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/kern/kern_clocksource.c Wed Jun 22 16:40:45 2011 (r223426) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); cyclic_clock_func_t cyclic_clock_func = NULL; #endif +int cpu_can_deep_sleep = 0; /* C3 state is available. */ int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ static void setuptimer(void); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/sys/systm.h Wed Jun 22 16:40:45 2011 (r223426) @@ -253,6 +253,7 @@ void cpu_startprofclock(void); void cpu_stopprofclock(void); void cpu_idleclock(void); void cpu_activeclock(void); +extern int cpu_can_deep_sleep; extern int cpu_disable_deep_sleep; int cr_cansee(struct ucred *u1, struct ucred *u2); Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Jun 22 16:26:21 2011 (r223425) +++ head/sys/x86/x86/tsc.c Wed Jun 22 16:40:45 2011 (r223426) @@ -444,6 +444,19 @@ init_TSC_tc(void) goto init; } + /* + * We cannot use the TSC if it stops incrementing in deep sleep. + * Currently only Intel CPUs are known for this problem unless + * the invariant TSC bit is set. + */ + if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && + (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { + tsc_timecounter.tc_quality = -1000; + if (bootverbose) + printf("TSC timecounter disabled: C3 enabled.\n"); + goto init; + } + #ifdef SMP /* * We can not use the TSC in SMP mode unless the TSCs on all CPUs are From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 16:47:14 2011 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 8A1A5106566C; Wed, 22 Jun 2011 16:47:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 530D58FC1A; Wed, 22 Jun 2011 16:47:12 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA12636; Wed, 22 Jun 2011 19:47:11 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E021C8E.8010904@FreeBSD.org> Date: Wed, 22 Jun 2011 19:47:10 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201106221640.p5MGejHY057164@svn.freebsd.org> In-Reply-To: <201106221640.p5MGejHY057164@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Wed, 22 Jun 2011 16:47:14 -0000 on 22/06/2011 19:40 Jung-uk Kim said the following: > Author: jkim > Date: Wed Jun 22 16:40:45 2011 > New Revision: 223426 > URL: http://svn.freebsd.org/changeset/base/223426 > > Log: > Set negative quality to TSC timecounter when C3 state is enabled for Intel > processors unless the invariant TSC bit of CPUID is set. Intel processors > may stop incrementing TSC when DPSLP# pin is asserted, according to Intel > processor manuals, i. e., TSC timecounter is useless if the processor can > enter deep sleep state (C3/C4). This problem was accidentally uncovered by > r222869, which increased timecounter quality of P-state invariant TSC, e.g., > for Core2 Duo T5870 (Family 6, Model f) and Atom N270 (Family 6, Model 1c). > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > Ian FREISLICH (ianf at clue dot co dot za) > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > - Core2 Duo T5870 (C3 state available/enabled) > jkim - Xeon X5150 (C3 state unavailable) I think that this change should have a counterpart similar to what was done for event timers. That is, if a user forces use of TSC as a timecounter vis sysctl and it is known that TSC stops in the deep C-state, then the deep C-states should not be entered. This is what cpu_disable_deep_sleep does for LAPIC timers. > Modified: > head/sys/dev/acpica/acpi_cpu.c > head/sys/kern/kern_clocksource.c > head/sys/sys/systm.h > head/sys/x86/x86/tsc.c > > Modified: head/sys/dev/acpica/acpi_cpu.c > ============================================================================== > --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -856,6 +856,8 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * > sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); > if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) > sc->cpu_non_c3 = i; > + else > + cpu_can_deep_sleep = 1; > } > sbuf_trim(&sb); > sbuf_finish(&sb); > > Modified: head/sys/kern/kern_clocksource.c > ============================================================================== > --- head/sys/kern/kern_clocksource.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/kern/kern_clocksource.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); > cyclic_clock_func_t cyclic_clock_func = NULL; > #endif > > +int cpu_can_deep_sleep = 0; /* C3 state is available. */ > int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */ > > static void setuptimer(void); > > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/sys/systm.h Wed Jun 22 16:40:45 2011 (r223426) > @@ -253,6 +253,7 @@ void cpu_startprofclock(void); > void cpu_stopprofclock(void); > void cpu_idleclock(void); > void cpu_activeclock(void); > +extern int cpu_can_deep_sleep; > extern int cpu_disable_deep_sleep; > > int cr_cansee(struct ucred *u1, struct ucred *u2); > > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Wed Jun 22 16:26:21 2011 (r223425) > +++ head/sys/x86/x86/tsc.c Wed Jun 22 16:40:45 2011 (r223426) > @@ -444,6 +444,19 @@ init_TSC_tc(void) > goto init; > } > > + /* > + * We cannot use the TSC if it stops incrementing in deep sleep. > + * Currently only Intel CPUs are known for this problem unless > + * the invariant TSC bit is set. > + */ > + if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && > + (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { > + tsc_timecounter.tc_quality = -1000; > + if (bootverbose) > + printf("TSC timecounter disabled: C3 enabled.\n"); > + goto init; > + } > + > #ifdef SMP > /* > * We can not use the TSC in SMP mode unless the TSCs on all CPUs are -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 17:02:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 34F7A106564A; Wed, 22 Jun 2011 17:02:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 13:02:20 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> In-Reply-To: <4E021C8E.8010904@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106221302.23375.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Wed, 22 Jun 2011 17:02:31 -0000 On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > on 22/06/2011 19:40 Jung-uk Kim said the following: > > Author: jkim > > Date: Wed Jun 22 16:40:45 2011 > > New Revision: 223426 > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > Log: > > Set negative quality to TSC timecounter when C3 state is > > enabled for Intel processors unless the invariant TSC bit of > > CPUID is set. Intel processors may stop incrementing TSC when > > DPSLP# pin is asserted, according to Intel processor manuals, i. > > e., TSC timecounter is useless if the processor can enter deep > > sleep state (C3/C4). This problem was accidentally uncovered by > > r222869, which increased timecounter quality of P-state invariant > > TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 > > (Family 6, Model 1c). > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > Ian FREISLICH (ianf at clue dot co dot za) > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > - Core2 Duo T5870 (C3 state available/enabled) > > jkim - Xeon X5150 (C3 state unavailable) > > I think that this change should have a counterpart similar to what > was done for event timers. That is, if a user forces use of TSC as > a timecounter vis sysctl and it is known that TSC stops in the deep > C-state, then the deep C-states should not be entered. This is > what cpu_disable_deep_sleep does for LAPIC timers. Yes. We have to teach tc_windup() to increase/decrease cpu_disable_deep_sleep. Currently, the user must disable C3 and force TSC timecounter manually if power consumption is not important, e.g., /etc/rc.conf: economy_cx_lowest="C2" /etc/sysctl.conf: kern.timecounter.hardware=TSC Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 17:55:17 2011 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 6D263106566B; Wed, 22 Jun 2011 17:55:17 +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 4102F8FC08; Wed, 22 Jun 2011 17:55: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 p5MHtHIg060108; Wed, 22 Jun 2011 17:55:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MHtHvC060105; Wed, 22 Jun 2011 17:55:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221755.p5MHtHvC060105@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 17:55: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: r223428 - in head/sys: amd64/pci i386/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, 22 Jun 2011 17:55:17 -0000 Author: jhb Date: Wed Jun 22 17:55:16 2011 New Revision: 223428 URL: http://svn.freebsd.org/changeset/base/223428 Log: Use uintXX_t instead of u_intXX_t. Modified: head/sys/amd64/pci/pci_bus.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/pci/pci_bus.c ============================================================================== --- head/sys/amd64/pci/pci_bus.c Wed Jun 22 17:31:50 2011 (r223427) +++ head/sys/amd64/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428) @@ -135,7 +135,7 @@ static void legacy_pcib_identify(driver_t *driver, device_t parent) { int bus, slot, func; - u_int8_t hdrtype; + uint8_t hdrtype; int found = 0; int pcifunchigh; int found824xx = 0; @@ -178,8 +178,8 @@ legacy_pcib_identify(driver_t *driver, d /* * Read the IDs and class from the device. */ - u_int32_t id; - u_int8_t class, subclass, busnum; + uint32_t id; + uint8_t class, subclass, busnum; const char *s; device_t *devs; int ndevs, i; Modified: head/sys/i386/pci/pci_bus.c ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 17:31:50 2011 (r223427) +++ head/sys/i386/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428) @@ -62,7 +62,7 @@ legacy_pcib_maxslots(device_t dev) /* read configuration space register */ -u_int32_t +uint32_t legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) { @@ -73,7 +73,7 @@ legacy_pcib_read_config(device_t dev, u_ void legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, - u_int reg, u_int32_t data, int bytes) + u_int reg, uint32_t data, int bytes) { pci_cfgregwrite(bus, slot, func, reg, data, bytes); } @@ -342,7 +342,7 @@ static void legacy_pcib_identify(driver_t *driver, device_t parent) { int bus, slot, func; - u_int8_t hdrtype; + uint8_t hdrtype; int found = 0; int pcifunchigh; int found824xx = 0; @@ -385,8 +385,8 @@ legacy_pcib_identify(driver_t *driver, d /* * Read the IDs and class from the device. */ - u_int32_t id; - u_int8_t class, subclass, busnum; + uint32_t id; + uint8_t class, subclass, busnum; const char *s; device_t *devs; int ndevs, i; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 17:59:54 2011 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 15C681065673; Wed, 22 Jun 2011 17:59:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 049C38FC19; Wed, 22 Jun 2011 17:59: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 p5MHxr3Q060651; Wed, 22 Jun 2011 17:59:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MHxrDx060648; Wed, 22 Jun 2011 17:59:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221759.p5MHxrDx060648@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 17:59: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: r223429 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 17:59:54 -0000 Author: trasz Date: Wed Jun 22 17:59:53 2011 New Revision: 223429 URL: http://svn.freebsd.org/changeset/base/223429 Log: Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent from messages. Modified: head/sbin/growfs/growfs.8 head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Wed Jun 22 17:55:16 2011 (r223428) +++ head/sbin/growfs/growfs.8 Wed Jun 22 17:59:53 2011 (r223429) @@ -37,12 +37,12 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt GROWFS 8 .Os .Sh NAME .Nm growfs -.Nd grow size of an existing UFS file system +.Nd expand an existing UFS filesystem .Sh SYNOPSIS .Nm .Op Fl Ny @@ -58,26 +58,26 @@ Before starting .Nm the disk must be labeled to a bigger size using .Xr bsdlabel 8 . -If you wish to grow a file system beyond the boundary of -the slice it resides in, you must re-size the slice using -.Xr fdisk 8 +If you wish to grow a filesystem beyond the boundary of +the slice it resides in, you must resize the slice using +.Xr gpart 8 before running .Nm . If you are using volumes you must enlarge them by using -.Xr vinum 8 . +.Xr gvinum 8 . The .Nm -utility extends the size of the file system on the specified special file. +utility extends the size of the filesystem on the specified special file. Currently .Nm -can only enlarge unmounted file systems. -Do not try enlarging a mounted file system, your system may panic and you will -not be able to use the file system any longer. +can only enlarge unmounted filesystems. +Do not try enlarging a mounted filesystem, your system may panic and you will +not be able to use the filesystem any longer. Most of the .Xr newfs 8 options cannot be changed by .Nm . -In fact, you can only increase the size of the file system. +In fact, you can only increase the size of the filesystem. Use .Xr tunefs 8 for other changes. @@ -86,8 +86,8 @@ The following options are available: .Bl -tag -width indent .It Fl N .Dq Test mode . -Causes the new file system parameters to be printed out without actually -enlarging the file system. +Causes the new filesystem parameters to be printed out without actually +enlarging the filesystem. .It Fl y .Dq Expert mode . Usually @@ -102,12 +102,12 @@ So use this option with great care! .It Fl s Ar size Determines the .Ar size -of the file system after enlarging in sectors. +of the filesystem after enlarging in sectors. This value defaults to the size of the raw partition specified in .Ar special (in other words, .Nm -will enlarge the file system to the size of the entire partition). +will enlarge the filesystem to the size of the entire partition). .El .Sh EXAMPLES .Dl growfs -s 4194304 /dev/vinum/testvol @@ -119,12 +119,12 @@ up to 2GB if there is enough space in .Sh SEE ALSO .Xr bsdlabel 8 , .Xr dumpfs 8 , -.Xr fdisk 8 , .Xr ffsinfo 8 , .Xr fsck 8 , +.Xr gpart 8 , .Xr newfs 8 , .Xr tunefs 8 , -.Xr vinum 8 +.Xr gvinum 8 .Sh HISTORY The .Nm @@ -144,12 +144,12 @@ There may be cases on .Fx 3.x only, when .Nm -does not recognize properly whether or not the file system is mounted and +does not recognize properly whether or not the filesystem is mounted and exits with an error message. Then please use .Nm .Fl y -if you are sure that the file system is not mounted. +if you are sure that the filesystem is not mounted. It is also recommended to always use .Xr fsck 8 after enlarging (just to be on the safe side). @@ -183,8 +183,8 @@ on the first cylinder group to verify th in the CYLINDER SUMMARY (internal cs) of the CYLINDER GROUP .Em cgr0 has enough blocks. -As a rule of thumb for default file system parameters one block is needed for -every 2 GB of total file system size. +As a rule of thumb for default filesystem parameters one block is needed for +every 2 GB of total filesystem size. .Pp Normally .Nm Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Wed Jun 22 17:55:16 2011 (r223428) +++ head/sbin/growfs/growfs.c Wed Jun 22 17:59:53 2011 (r223429) @@ -160,7 +160,7 @@ static void get_dev_size(int, int *); /* ************************************************************ growfs ***** */ /* - * Here we actually start growing the file system. We basically read the + * Here we actually start growing the filesystem. We basically read the * cylinder summary from the first cylinder group as we want to update * this on the fly during our various operations. First we handle the * changes in the former last cylinder group. Afterwards we create all new @@ -231,7 +231,7 @@ growfs(int fsi, int fso, unsigned int Nf updjcg(osblock.fs_ncg-1, modtime, fsi, fso, Nflag); /* - * Dump out summary information about file system. + * Dump out summary information about filesystem. */ # define B2MBFACTOR (1 / (1024.0 * 1024.0)) printf("growfs: %.1fMB (%jd sectors) block size %d, fragment size %d\n", @@ -435,7 +435,7 @@ initcg(int cylno, time_t modtime, int fs if (acg.cg_nextfreeoff > (unsigned)sblock.fs_cgsize) { /* * This should never happen as we would have had that panic - * already on file system creation + * already on filesystem creation */ errx(37, "panic: cylinder group too big"); } @@ -446,7 +446,7 @@ initcg(int cylno, time_t modtime, int fs acg.cg_cs.cs_nifree--; } /* - * For the old file system, we have to initialize all the inodes. + * For the old filesystem, we have to initialize all the inodes. */ if (sblock.fs_magic == FS_UFS1_MAGIC) { bzero(iobuf, sblock.fs_bsize); @@ -670,7 +670,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct /* ************************************************************ updjcg ***** */ /* * Here we do all needed work for the former last cylinder group. It has to be - * changed in any case, even if the file system ended exactly on the end of + * changed in any case, even if the filesystem ended exactly on the end of * this group, as there is some slightly inconsistent handling of the number * of cylinders in the cylinder group. We start again by reading the cylinder * group from disk. If the last block was not fully available, we first handle @@ -780,7 +780,7 @@ updjcg(int cylno, time_t modtime, int fs * the rotational layout tables and the cluster summary. This is * also done per fragment for the first new block if the old file * system end was not on a block boundary, per fragment for the new - * last block if the new file system end is not on a block boundary, + * last block if the new filesystem end is not on a block boundary, * and per block for all space in between. * * Handle the first new block here if it was partially available @@ -804,7 +804,7 @@ updjcg(int cylno, time_t modtime, int fs /* * Check if the fragment just created could join an * already existing fragment at the former end of the - * file system. + * filesystem. */ if(isblock(&sblock, cg_blksfree(&acg), ((osblock.fs_size - cgbase(&sblock, cylno))/ @@ -931,7 +931,7 @@ updjcg(int cylno, time_t modtime, int fs * Option (1) is considered to be less intrusive to the structure of the file- * system. So we try to stick to that whenever possible. If there is not enough * space in the cylinder group containing the cylinder summary we have to use - * method (2). In case of active snapshots in the file system we probably can + * method (2). In case of active snapshots in the filesystem we probably can * completely avoid implementing copy on write if we stick to method (2) only. */ static void @@ -1287,7 +1287,7 @@ updcsloc(time_t modtime, int fsi, int fs /* * No cluster handling is needed here, as there was at least * one fragment in use by the cylinder summary in the old - * file system. + * filesystem. * No block-free counter handling here as this block was not * a free block. */ @@ -1597,7 +1597,7 @@ wtfs(ufs2_daddr_t bno, size_t size, void /* * Here we allocate a free block in the current cylinder group. It is assumed, * that acg contains the current cylinder group. As we may take a block from - * somewhere in the file system we have to handle cluster summary here. + * somewhere in the filesystem we have to handle cluster summary here. */ static ufs2_daddr_t alloc(void) @@ -1939,9 +1939,9 @@ get_dev_size(int fd, int *size) /* ************************************************************** main ***** */ /* * growfs(8) is a utility which allows to increase the size of an existing - * ufs file system. Currently this can only be done on unmounted file system. + * ufs filesystem. Currently this can only be done on unmounted filesystem. * It recognizes some command line options to specify the new desired size, - * and it does some basic checkings. The old file system size is determined + * and it does some basic checkings. The old filesystem size is determined * and after some more checks like we can really access the new last block * on the disk etc. we calculate the new parameters for the superblock. After * having done this we just call growfs() which will do the work. Before @@ -1953,11 +1953,11 @@ get_dev_size(int fd, int *size) * are lucky, then we only have to handle our blocks to be relocated in that * way. * Also we have to consider in what order we actually update the critical - * data structures of the file system to make sure, that in case of a disaster + * data structures of the filesystem to make sure, that in case of a disaster * fsck(8) is still able to restore any lost data. * The foreseen last step then will be to provide for growing even mounted - * file systems. There we have to extend the mount() system call to provide - * userland access to the file system locking facility. + * filesystems. There we have to extend the mount() system call to provide + * userland access to the filesystem locking facility. */ int main(int argc, char **argv) @@ -2088,7 +2088,7 @@ main(int argc, char **argv) } /* - * Check if that partition is suitable for growing a file system. + * Check if that partition is suitable for growing a filesystem. */ if (p_size < 1) { errx(1, "partition is unavailable"); @@ -2146,8 +2146,8 @@ main(int argc, char **argv) if(ExpertFlag == 0) { for(j=0; j 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 6BEAE106566B; Wed, 22 Jun 2011 18:02: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 5BEB48FC0C; Wed, 22 Jun 2011 18:02: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 p5MI2SRv060799; Wed, 22 Jun 2011 18:02:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MI2S2e060796; Wed, 22 Jun 2011 18:02:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221802.p5MI2S2e060796@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 18:02: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: r223430 - in head/sbin: newfs tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 18:02:28 -0000 Author: trasz Date: Wed Jun 22 18:02:28 2011 New Revision: 223430 URL: http://svn.freebsd.org/changeset/base/223430 Log: Advertise growfs(8) a little better. Modified: head/sbin/newfs/newfs.8 head/sbin/tunefs/tunefs.8 Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Wed Jun 22 17:59:53 2011 (r223429) +++ head/sbin/newfs/newfs.8 Wed Jun 22 18:02:28 2011 (r223430) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 25, 2011 +.Dd June 22, 2011 .Dt NEWFS 8 .Os .Sh NAME @@ -297,6 +297,7 @@ on file systems that contain many small .Xr dumpfs 8 , .Xr fsck 8 , .Xr gjournal 8 , +.Xr growfs 8 , .Xr makefs 8 , .Xr mount 8 , .Xr tunefs 8 , Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Wed Jun 22 17:59:53 2011 (r223429) +++ head/sbin/tunefs/tunefs.8 Wed Jun 22 18:02:28 2011 (r223430) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd June 22, 2011 .Dt TUNEFS 8 .Os .Sh NAME @@ -165,6 +165,7 @@ specified mount point. .Xr fs 5 , .Xr dumpfs 8 , .Xr gjournal 8 , +.Xr growfs 8 , .Xr newfs 8 .Rs .%A M. McKusick From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 18:18:06 2011 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 1FF7D106564A; Wed, 22 Jun 2011 18:18:06 +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 EA1738FC19; Wed, 22 Jun 2011 18:18: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 p5MII57P061310; Wed, 22 Jun 2011 18:18:05 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MII5ak061307; Wed, 22 Jun 2011 18:18:05 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106221818.p5MII5ak061307@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 22 Jun 2011 18:18:05 +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: r223431 - 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: Wed, 22 Jun 2011 18:18:06 -0000 Author: gavin Date: Wed Jun 22 18:18:05 2011 New Revision: 223431 URL: http://svn.freebsd.org/changeset/base/223431 Log: Merge r217202 from head: Add support for the Zeagle N2iTion3 Dive Computer to uplcom(4). Requested by: hselasky Modified: stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Wed Jun 22 18:02:28 2011 (r223430) +++ stable/8/sys/dev/usb/serial/uplcom.c Wed Jun 22 18:18:05 2011 (r223431) @@ -257,6 +257,7 @@ static const struct usb_device_id uplcom UPLCOM_DEV(BELKIN, F5U257), /* Belkin F5U257 USB to Serial */ UPLCOM_DEV(COREGA, CGUSBRS232R), /* Corega CG-USBRS232R */ UPLCOM_DEV(EPSON, CRESSI_EDY), /* Cressi Edy diving computer */ + UPLCOM_DEV(EPSON, N2ITION3), /* Zeagle N2iTion3 diving computer */ UPLCOM_DEV(ELECOM, UCSGT), /* ELECOM UC-SGT Serial Adapter */ UPLCOM_DEV(ELECOM, UCSGT0), /* ELECOM UC-SGT Serial Adapter */ UPLCOM_DEV(HAL, IMR001), /* HAL Corporation Crossam2+USB */ Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Jun 22 18:02:28 2011 (r223430) +++ stable/8/sys/dev/usb/usbdevs Wed Jun 22 18:18:05 2011 (r223431) @@ -1536,6 +1536,7 @@ product EPSON 2480 0x0121 Perfection 24 product EPSON 3590 0x0122 Perfection 3590 scanner product EPSON 4990 0x012a Perfection 4990 Photo scanner product EPSON CRESSI_EDY 0x0521 Cressi Edy diving computer +product EPSON N2ITION3 0x0522 Zeagle N2iTion3 diving computer product EPSON STYLUS_875DC 0x0601 Stylus Photo 875DC Card Reader product EPSON STYLUS_895 0x0602 Stylus Photo 895 Card Reader product EPSON CX5400 0x0808 CX5400 scanner From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 18:22:54 2011 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 75FBA106566B; Wed, 22 Jun 2011 18:22:54 +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 4D1128FC0C; Wed, 22 Jun 2011 18:22: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 p5MIMsca061486; Wed, 22 Jun 2011 18:22:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MIMsZh061484; Wed, 22 Jun 2011 18:22:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221822.p5MIMsZh061484@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 18:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223432 - svnadmin/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: Wed, 22 Jun 2011 18:22:54 -0000 Author: jhb Date: Wed Jun 22 18:22:53 2011 New Revision: 223432 URL: http://svn.freebsd.org/changeset/base/223432 Log: Take mux's commit bit into safekeeping per his request. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Jun 22 18:18:05 2011 (r223431) +++ svnadmin/conf/access Wed Jun 22 18:22:53 2011 (r223432) @@ -166,7 +166,6 @@ mp mpp mr mtm -mux n_hibma devnull neel netchild From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 18:48:07 2011 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 7AB31106566C; Wed, 22 Jun 2011 18:48:07 +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 6AC9C8FC16; Wed, 22 Jun 2011 18:48: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 p5MIm7LD062289; Wed, 22 Jun 2011 18:48:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MIm7O4062286; Wed, 22 Jun 2011 18:48:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106221848.p5MIm7O4062286@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 18:48: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: r223433 - in head/sys: amd64/include 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: Wed, 22 Jun 2011 18:48:07 -0000 Author: jhb Date: Wed Jun 22 18:48:07 2011 New Revision: 223433 URL: http://svn.freebsd.org/changeset/base/223433 Log: Oops, missed these in 223424. Reported by: jkim Modified: head/sys/amd64/include/pci_cfgreg.h head/sys/i386/include/pci_cfgreg.h Modified: head/sys/amd64/include/pci_cfgreg.h ============================================================================== --- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:22:53 2011 (r223432) +++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433) @@ -37,6 +37,7 @@ #define CONF1_ENABLE_MSK1 0x80000001ul #define CONF1_ENABLE_RES1 0x80000000ul +u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); Modified: head/sys/i386/include/pci_cfgreg.h ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:22:53 2011 (r223432) +++ head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433) @@ -43,6 +43,7 @@ #define CONF2_ENABLE_CHK 0x0e #define CONF2_ENABLE_RES 0x0e +u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 18:55:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 2D1251065670; Wed, 22 Jun 2011 18:55:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 14:55:05 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> In-Reply-To: <4E021C8E.8010904@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_LqjAOQlSv1JdSAI" Message-Id: <201106221455.07540.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Wed, 22 Jun 2011 18:55:19 -0000 --Boundary-00=_LqjAOQlSv1JdSAI Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > on 22/06/2011 19:40 Jung-uk Kim said the following: > > Author: jkim > > Date: Wed Jun 22 16:40:45 2011 > > New Revision: 223426 > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > Log: > > Set negative quality to TSC timecounter when C3 state is > > enabled for Intel processors unless the invariant TSC bit of > > CPUID is set. Intel processors may stop incrementing TSC when > > DPSLP# pin is asserted, according to Intel processor manuals, i. > > e., TSC timecounter is useless if the processor can enter deep > > sleep state (C3/C4). This problem was accidentally uncovered by > > r222869, which increased timecounter quality of P-state invariant > > TSC, e.g., for Core2 Duo T5870 (Family 6, Model f) and Atom N270 > > (Family 6, Model 1c). > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > Ian FREISLICH (ianf at clue dot co dot za) > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > - Core2 Duo T5870 (C3 state available/enabled) > > jkim - Xeon X5150 (C3 state unavailable) > > I think that this change should have a counterpart similar to what > was done for event timers. That is, if a user forces use of TSC as > a timecounter vis sysctl and it is known that TSC stops in the deep > C-state, then the deep C-states should not be entered. This is > what cpu_disable_deep_sleep does for LAPIC timers. Can you please review/test the attached patch? Also available from here: http://people.freebsd.org/~jkim/tc_c3stop.diff Thanks! Jung-uk Kim --Boundary-00=_LqjAOQlSv1JdSAI Content-Type: text/plain; charset="iso-8859-1"; name="tc_c3stop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_c3stop.diff" Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c (revision 223426) +++ sys/kern/kern_tc.c (working copy) @@ -492,6 +492,10 @@ tc_windup(void) /* Now is a good time to change timecounters. */ if (th->th_counter != timecounter) { + if ((timecounter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep++; + if ((th->th_counter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep--; th->th_counter = timecounter; th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / Index: sys/sparc64/sparc64/counter.c =================================================================== --- sys/sparc64/sparc64/counter.c (revision 223426) +++ sys/sparc64/sparc64/counter.c (working copy) @@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; + tc->tc_flags = 0; tc_init(tc); } Index: sys/sys/timetc.h =================================================================== --- sys/sys/timetc.h (revision 223426) +++ sys/sys/timetc.h (working copy) @@ -57,6 +57,8 @@ struct timecounter { * another timecounter higher means better. Negative * means "only use at explicit request". */ + u_int tc_flags; +#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */ void *tc_priv; /* Pointer to the timecounter's private parts. */ Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 223426) +++ sys/x86/x86/tsc.c (working copy) @@ -451,6 +451,7 @@ init_TSC_tc(void) */ if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { + tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP; tsc_timecounter.tc_quality = -1000; if (bootverbose) printf("TSC timecounter disabled: C3 enabled.\n"); --Boundary-00=_LqjAOQlSv1JdSAI-- From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 18:58:46 2011 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 96142106566B; Wed, 22 Jun 2011 18:58:46 +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 2DB168FC16; Wed, 22 Jun 2011 18:58:45 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MIwhI4017074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 04:58:44 +1000 Date: Thu, 23 Jun 2011 04:58:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201106220948.02421.jhb@freebsd.org> Message-ID: <20110623045454.U1550@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <201106220948.02421.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Alan Cox , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 18:58:46 -0000 On Wed, 22 Jun 2011, John Baldwin wrote: > On Tuesday, June 21, 2011 4:58:10 pm Bruce Evans wrote: >> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>> ... >>> vm_page.o: In function `vm_page_clear_dirty': >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' >>> vm_page.o: In function `vm_page_set_validclean': >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 against `atomic_clear_8' >> >> Atomic types shorter than int cannot be used in MI code, since they might >> not exist. Apparently they don't exist on mips. jake@ fixed all their >> old uses for sparc4 in ~Y2K. > > I agree. Is there any harm in having the 'dirty' and 'valid' fields in > vm_page always be at least of size 'int'? > > In the case of amd64, vm_page would change from a size of 120 bytes to 128. > > On i386 I think you'd end up changing the size from 68 to 76. > > (Using an int results in alignment padding after 'busy'.) That is quite a bit. Perhaps the struct should be packed better so that each char -> int expansion takes <= 3 bytes instead of >= 4. The expansion might even be negative. It is only moderately well packed now. > Hmm, that's around 120k of extra vm_page_t space for a machine with 64M of > RAM, so around 0.18% of RAM would be used on both platforms (presumably the > usage would be similar on other platforms as well). At 24 GB of RAM, the > extra space is just under 0.20% of RAM (48M). Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 19:14:50 2011 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 4C1D51065672; Wed, 22 Jun 2011 19:14:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF548FC0C; Wed, 22 Jun 2011 19:14: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 p5MJEoEr063113; Wed, 22 Jun 2011 19:14:50 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MJEoLq063111; Wed, 22 Jun 2011 19:14:50 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106221914.p5MJEoLq063111@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jun 2011 19:14: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: r223434 - head/libexec/ftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 19:14:50 -0000 Author: trasz Date: Wed Jun 22 19:14:49 2011 New Revision: 223434 URL: http://svn.freebsd.org/changeset/base/223434 Log: Add LOGIN_SETCPUMASK and LOGIN_SETLOGINCLASS to the setusercontext(3) calls in ftpd(8). Modified: head/libexec/ftpd/ftpd.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Wed Jun 22 18:48:07 2011 (r223433) +++ head/libexec/ftpd/ftpd.c Wed Jun 22 19:14:49 2011 (r223434) @@ -1191,9 +1191,9 @@ end_login(void) ftpd_logwtmp(wtmpid, NULL, NULL); pw = NULL; #ifdef LOGIN_CAP - setusercontext(NULL, getpwuid(0), 0, - LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK| - LOGIN_SETMAC); + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); #endif #ifdef USE_PAM if (pamh) { @@ -1465,9 +1465,8 @@ skip: return; } } - setusercontext(lc, pw, 0, - LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY| - LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC); + setusercontext(lc, pw, 0, LOGIN_SETALL & + ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 19:31:36 2011 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 802FB106566B; Wed, 22 Jun 2011 19:31:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 137F48FC19; Wed, 22 Jun 2011 19:31:35 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MJVPgO031151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 05:31:26 +1000 Date: Thu, 23 Jun 2011 05:31:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> Message-ID: <20110623050025.O1587@besplex.bde.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <20110622063258.D2275@besplex.bde.org> <4E0128FF.6020804@rice.edu> <82E2B828-97C9-4C35-A619-ACDB5C40E99B@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Alan Cox , Alan Cox , svn-src-all@FreeBSD.org, Attilio Rao , "Bjoern A. Zeeb" , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r223307 - 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: Wed, 22 Jun 2011 19:31:36 -0000 On Wed, 22 Jun 2011, Warner Losh wrote: > On Jun 22, 2011, at 3:26 AM, Attilio Rao wrote: > >> 2011/6/22 Warner Losh : >>> >>> On Jun 21, 2011, at 5:27 PM, Alan Cox wrote: >>> >>> On 06/21/2011 16:09, Attilio Rao wrote: >>> >>> 2011/6/21 Bruce Evans: >>> >>> On Tue, 21 Jun 2011, Bjoern A. Zeeb wrote: >>> >>> On Jun 19, 2011, at 7:13 PM, Alan Cox wrote: >>> >>> Hi Alan, >>> >>> Author: alc >>> >>> Date: Sun Jun 19 19:13:24 2011 >>> >>> New Revision: 223307 >>> >>> URL: http://svn.freebsd.org/changeset/base/223307 >>> >>> Log: >>> >>> Precisely document the synchronization rules for the page's dirty field. >>> >>> (Saying that the lock on the object that the page belongs to must be >>> >>> held >>> >>> only represents one aspect of the rules.) >>> >>> Eliminate the use of the page queues lock for atomically performing >>> >>> read- >>> >>> modify-write operations on the dirty field when the underlying >>> >>> architecture >>> >>> supports atomic operations on char and short types. >>> >>> Document the fact that 32KB pages aren't really supported. >>> >>> contrary to the tinderbox I'd like to point out that all mips kernels >>> >>> built by universe are broken with a SVN HEAD from earlier today. Could you >>> >>> please check and see if you can fix it? The errors I get are: >>> >>> vm_page.o: In function `vm_page_clear_dirty': >>> >>> /sys/vm/vm_page.c:(.text+0x18d0): undefined reference to `atomic_clear_8' >>> >>> /sys/vm/vm_page.c:(.text+0x18d0): relocation truncated to fit: R_MIPS_26 >>> >>> against `atomic_clear_8' >>> >>> vm_page.o: In function `vm_page_set_validclean': >>> >>> /sys/vm/vm_page.c:(.text+0x38f0): undefined reference to `atomic_clear_8' >>> >>> /sys/vm/vm_page.c:(.text+0x38f0): relocation truncated to fit: R_MIPS_26 >>> >>> against `atomic_clear_8' >>> >>> Atomic types shorter than int cannot be used in MI code, since they might >>> >>> not exist. Apparently they don't exist on mips. jake@ fixed all their >>> >>> old uses for sparc4 in ~Y2K. >>> >>> I'm sure they do, they exist in support.S though and may not have the >>> >>> _8 form (they may just have the _char version). I may look at the code >>> >>> again to be sure. >>> >>> >>> It appears that while mips/include/atomic.h declares the existence of >>> atomic_clear_8, mips/mips/support.S doesn't implement it. In other words, >>> only support for int's and short's is currently implemented, not char's: >>> >>> # grep atomic_clear mips/mips/support.S >>> * atomic_clear_32(u_int32_t *a, u_int32_t b) >>> LEAF(atomic_clear_32) >>> END(atomic_clear_32) >>> * atomic_clear_16(u_int16_t *a, u_int16_t b) >>> LEAF(atomic_clear_16) >>> END(atomic_clear_16) >>> >>> The current crop of atomic*16 and atomic*8 functions have the restriction >>> that the address must be 32-bit aligned (and it forces this by aligning to >>> 32-bits silently and then operates on the low 8 or 16 bits in that word!) >>> I'm guessing that this is likely just wrong. Comments? >>> Warner >> >> That is wrong, of course, and my personal opinion is that one should >> not implement atomic operations if they cannot be done efficiently >> (example: if you need to disable interrupts or similar expensive >> operation just to assure atomicity of operation, just don't support >> it) as long as not having _8/_char is perfectly fine. > > I think it can be efficient, for some reasonable definition of efficient. The masking and shifting operations aren't that onerous to write and the instructions cycles would be dwarfed by the ll/sc pair, which are required to implement atomic. > > The issue is that the code today is clearly wrong and needs to be fixed. I think it is still good to discourage use of non-bus-width atomic ops by not supporting at the MI level them for any arch. Suppose only bus-width accesses are atomic, as seems to be the case on mips. Then you can still do atomic accesses on bytes by doing an atomic op on the neigbouring 3 or 7 bytes. But this may increase memory contention by a factor of 3 or 7. The contention can be reduced either by putting only rarely-accessed bytes near the bytes that need the atomic ops, or by putting unused padding there, or by not using byte-sized objects to begin with (this gives the same effect and even the same memory accesses as unused padding bytes -- there are unused bits in the objects instead of external unused bytes). The former can be arranged easily enough in the vm_page struct. But MI code shouldn't know about this. Suppose byte accesses are atomic at the instruction level. Then the hardware probably still needs to expand to the bus width. Depending on how well it virtualizes this, there may be the same factor of 3, 7 or more in memory contention. The relevant bus width may be the cache line size which on modern CPUs is much more than 4 bytes and probably more like 32. So the CPU must already being doing good virtualization to make 4-byte atomic accesses not too slow (non-atomic accesses are already virtualized by the caches). For efficiency, we really should pay more attention to packing related int variables into cache lines (either the same line to increase cache hits or separate lines, to reduce contention), but the best way to do this is very MD and unclear. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 19:47:45 2011 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 D308A106566C; Wed, 22 Jun 2011 19:47:45 +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 C391F8FC12; Wed, 22 Jun 2011 19:47: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 p5MJljQo064177; Wed, 22 Jun 2011 19:47:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MJljhJ064175; Wed, 22 Jun 2011 19:47:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106221947.p5MJljhJ064175@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jun 2011 19:47: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: r223436 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 19:47:45 -0000 Author: rmacklem Date: Wed Jun 22 19:47:45 2011 New Revision: 223436 URL: http://svn.freebsd.org/changeset/base/223436 Log: Fix the new NFSv4 client so that it uses the same uid as was used for doing a mount when performing system operations on AUTH_SYS mounts. This resolved an issue when mounting a Linux server. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 19:42:32 2011 (r223435) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 19:47:45 2011 (r223436) @@ -526,6 +526,20 @@ newnfs_request(struct nfsrv_descript *nd else secflavour = RPCSEC_GSS_KRB5; srv_principal = NFSMNT_SRVKRBNAME(nmp); + } else if (nmp != NULL && !NFSHASKERB(nmp) && + nd->nd_procnum != NFSPROC_NULL && + (nd->nd_flag & ND_USEGSSNAME) != 0) { + /* + * Use the uid that did the mount when the RPC is doing + * NFSv4 system operations, as indicated by the + * ND_USEGSSNAME flag, for the AUTH_SYS case. + */ + saved_uid = cred->cr_uid; + if (nmp->nm_uid != (uid_t)-1) + cred->cr_uid = nmp->nm_uid; + else + cred->cr_uid = 0; + set_uid = 1; } if (nmp != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 19:55:22 2011 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 C5E33106566C; Wed, 22 Jun 2011 19:55:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 4ABF38FC14; Wed, 22 Jun 2011 19:55:21 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5MJtJDV030637 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jun 2011 05:55:20 +1000 Date: Thu, 23 Jun 2011 05:55:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala In-Reply-To: <201106221759.p5MHxrDx060648@svn.freebsd.org> Message-ID: <20110623054328.V1770@besplex.bde.org> References: <201106221759.p5MHxrDx060648@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: r223429 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 19:55:22 -0000 On Wed, 22 Jun 2011, Edward Tomasz Napierala wrote: > Log: > Cosmetic fixes; mostly s/file system/filesystem/g and removing weird indent > from messages. The first part seems backwards. It undoes the 2002 change that does s/filesystem/file system/g, except the 2002 change was not restricted to growfs. 'file system' seems best English in most contexts, but not all, so such changes should not be done mechanically. 'filesystem' might be best German or Danish. I like to use 'file system' for individual file systems, but `filesystem' for things like the handler of a file system. But I don't like renaming things and wouldn't touch this :-). > Modified: head/sbin/growfs/growfs.8 > ============================================================================== > --- head/sbin/growfs/growfs.8 Wed Jun 22 17:55:16 2011 (r223428) > +++ head/sbin/growfs/growfs.8 Wed Jun 22 17:59:53 2011 (r223429) > @@ -37,12 +37,12 @@ > .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ > .\" $FreeBSD$ > .\" > -.Dd May 8, 2011 > +.Dd June 22, 2011 > .Dt GROWFS 8 > .Os > .Sh NAME > .Nm growfs > -.Nd grow size of an existing UFS file system > +.Nd expand an existing UFS filesystem Also, UFS doesn't exist. See ffs(7), the fastfs paper in /usr/share/doc, and ufs(nonexistent). I would use 'file system' here since it is an individual file system being expanded, and 'filesystem' for the ffs filesystem implementation. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 20:00:28 2011 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 5E3DC1065672; Wed, 22 Jun 2011 20:00:28 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D85F8FC0C; Wed, 22 Jun 2011 20:00: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 p5MK0SGW064664; Wed, 22 Jun 2011 20:00:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MK0STg064659; Wed, 22 Jun 2011 20:00:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106222000.p5MK0STg064659@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 22 Jun 2011 20:00: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: r223437 - head/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: Wed, 22 Jun 2011 20:00:28 -0000 Author: ae Date: Wed Jun 22 20:00:27 2011 New Revision: 223437 URL: http://svn.freebsd.org/changeset/base/223437 Log: Export AddLink() function from libalias. It can be used when custom alias address needs to be specified. Add inbound handler to the alias_ftp module. It helps handle active FTP transfer mode for the case with external clients and FTP server behind NAT. Fix passive FTP transfer case for server behind NAT using redirect with external IP address different from NAT ip address. PR: kern/157957 Submitted by: Alexander V. Chernikov Modified: head/sys/netinet/libalias/alias_db.c head/sys/netinet/libalias/alias_ftp.c head/sys/netinet/libalias/alias_local.h head/sys/netinet/libalias/libalias.3 Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_db.c Wed Jun 22 20:00:27 2011 (r223437) @@ -552,10 +552,6 @@ static void IncrementalCleanup(struct li static void DeleteLink(struct alias_link *); static struct alias_link * -AddLink(struct libalias *, struct in_addr, struct in_addr, struct in_addr, - u_short, u_short, int, int); - -static struct alias_link * ReLink(struct alias_link *, struct in_addr, struct in_addr, struct in_addr, u_short, u_short, int, int); @@ -572,9 +568,6 @@ static struct alias_link * #define ALIAS_PORT_MASK_EVEN 0x07ffe #define GET_NEW_PORT_MAX_ATTEMPTS 20 -#define GET_ALIAS_PORT -1 -#define GET_ALIAS_ID GET_ALIAS_PORT - #define FIND_EVEN_ALIAS_BASE 1 /* GetNewPort() allocates port numbers. Note that if a port number @@ -937,17 +930,12 @@ DeleteLink(struct alias_link *lnk) } -static struct alias_link * -AddLink(struct libalias *la, struct in_addr src_addr, - struct in_addr dst_addr, - struct in_addr alias_addr, - u_short src_port, - u_short dst_port, - int alias_port_param, /* if less than zero, alias */ - int link_type) -{ /* port will be automatically *//* chosen. - * If greater than */ - u_int start_point; /* zero, equal to alias port */ +struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_port_param, int link_type) +{ + u_int start_point; struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_ftp.c Wed Jun 22 20:00:27 2011 (r223437) @@ -100,38 +100,68 @@ __FBSDID("$FreeBSD$"); #define FTP_CONTROL_PORT_NUMBER 21 static void -AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, - int maxpacketsize); +AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, + int maxpacketsize); +static void +AliasHandleFtpIn(struct libalias *, struct ip *, struct alias_link *); -static int -fingerprint(struct libalias *la, struct alias_data *ah) +static int +fingerprint_out(struct libalias *la, struct alias_data *ah) { - if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || - ah->maxpktsize == 0) + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || + ah->maxpktsize == 0) return (-1); - if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER - || ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) return (0); return (-1); } -static int -protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) +static int +fingerprint_in(struct libalias *la, struct alias_data *ah) +{ + + if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL) + return (-1); + if (ntohs(*ah->dport) == FTP_CONTROL_PORT_NUMBER || + ntohs(*ah->sport) == FTP_CONTROL_PORT_NUMBER) + return (0); + return (-1); +} + +static int +protohandler_out(struct libalias *la, struct ip *pip, struct alias_data *ah) { - + AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize); return (0); } + +static int +protohandler_in(struct libalias *la, struct ip *pip, struct alias_data *ah) +{ + + AliasHandleFtpIn(la, pip, ah->lnk); + return (0); +} + struct proto_handler handlers[] = { - { - .pri = 80, - .dir = OUT, - .proto = TCP, - .fingerprint = &fingerprint, - .protohandler = &protohandler - }, + { + .pri = 80, + .dir = OUT, + .proto = TCP, + .fingerprint = &fingerprint_out, + .protohandler = &protohandler_out + }, + { + .pri = 80, + .dir = IN, + .proto = TCP, + .fingerprint = &fingerprint_in, + .protohandler = &protohandler_in + }, { EOH } }; @@ -256,6 +286,57 @@ AliasHandleFtpOut( } } +static void +AliasHandleFtpIn(struct libalias *la, + struct ip *pip, /* IP packet to examine/patch */ + struct alias_link *lnk) /* The link to go through (aliased port) */ +{ + int hlen, tlen, dlen, pflags; + char *sptr; + struct tcphdr *tc; + + /* Calculate data length of TCP packet */ + tc = (struct tcphdr *)ip_next(pip); + hlen = (pip->ip_hl + tc->th_off) << 2; + tlen = ntohs(pip->ip_len); + dlen = tlen - hlen; + + /* Place string pointer and beginning of data */ + sptr = (char *)pip; + sptr += hlen; + + /* + * Check that data length is not too long and previous message was + * properly terminated with CRLF. + */ + pflags = GetProtocolFlags(lnk); + if (dlen <= MAX_MESSAGE_SIZE && (pflags & WAIT_CRLF) == 0 && + ntohs(tc->th_dport) == FTP_CONTROL_PORT_NUMBER && + (ParseFtpPortCommand(la, sptr, dlen) != 0 || + ParseFtpEprtCommand(la, sptr, dlen) != 0)) { + /* + * Alias active mode client requesting data from server + * behind NAT. We need to alias server->client connection + * to external address client is connecting to. + */ + AddLink(la, GetOriginalAddress(lnk), la->true_addr, + GetAliasAddress(lnk), htons(FTP_CONTROL_PORT_NUMBER - 1), + htons(la->true_port), GET_ALIAS_PORT, IPPROTO_TCP); + } + /* Track the msgs which are CRLF term'd for PORT/PASV FW breach */ + if (dlen) { + sptr = (char *)pip; /* start over at beginning */ + tlen = ntohs(pip->ip_len); /* recalc tlen, pkt may + * have grown. + */ + if (sptr[tlen - 2] == '\r' && sptr[tlen - 1] == '\n') + pflags &= ~WAIT_CRLF; + else + pflags |= WAIT_CRLF; + SetProtocolFlags(lnk, pflags); + } +} + static int ParseFtpPortCommand(struct libalias *la, char *sptr, int dlen) { @@ -576,9 +657,10 @@ NewFtpMessage(struct libalias *la, struc if (la->true_port < IPPORT_RESERVED) return; -/* Establish link to address and port found in FTP control message. */ - ftp_lnk = FindUdpTcpOut(la, la->true_addr, GetDestAddress(lnk), - htons(la->true_port), 0, IPPROTO_TCP, 1); + /* Establish link to address and port found in FTP control message. */ + ftp_lnk = AddLink(la, la->true_addr, GetDestAddress(lnk), + GetAliasAddress(lnk), htons(la->true_port), 0, GET_ALIAS_PORT, + IPPROTO_TCP); if (ftp_lnk != NULL) { int slen, hlen, tlen, dlen; Modified: head/sys/netinet/libalias/alias_local.h ============================================================================== --- head/sys/netinet/libalias/alias_local.h Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/alias_local.h Wed Jun 22 20:00:27 2011 (r223437) @@ -67,6 +67,9 @@ #define LINK_TABLE_OUT_SIZE 4001 #define LINK_TABLE_IN_SIZE 4001 +#define GET_ALIAS_PORT -1 +#define GET_ALIAS_ID GET_ALIAS_PORT + struct proxy_entry; struct libalias { @@ -249,6 +252,10 @@ DifferentialChecksum(u_short * _cksum, v /* Internal data access */ struct alias_link * +AddLink(struct libalias *la, struct in_addr src_addr, struct in_addr dst_addr, + struct in_addr alias_addr, u_short src_port, u_short dst_port, + int alias_param, int link_type); +struct alias_link * FindIcmpIn(struct libalias *la, struct in_addr _dst_addr, struct in_addr _alias_addr, u_short _id_alias, int _create); struct alias_link * Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Wed Jun 22 19:47:45 2011 (r223436) +++ head/sys/netinet/libalias/libalias.3 Wed Jun 22 20:00:27 2011 (r223437) @@ -824,6 +824,17 @@ argument is the pointer to a header frag is the pointer to the packet to be de-aliased. .Ed .Sh MISCELLANEOUS FUNCTIONS +.Ft struct alias_link * +.Fn AddLink "struct libalias *" "struct in_addr src_addr" "struct in_addr dst_addr" \ +"struct in_addr alias_addr" "u_short src_port" "u_short dst_port" \ +"int alias_param" "int link_type" +.Bd -ragged -offset indent +This function adds new state to instance hash table. +Zero can be specified instead of dst_address and/or dst port. +This makes link partially specified dynamic. +However due to hashing method such links can be resolved on inbound (ext -> int) only. +.Ed +.Pp .Ft void .Fn LibAliasSetTarget "struct libalias *" "struct in_addr addr" .Bd -ragged -offset indent From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 21:04:14 2011 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 6B968106566B; Wed, 22 Jun 2011 21:04:14 +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 4DDAA8FC18; Wed, 22 Jun 2011 21:04: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 p5ML4EYN068576; Wed, 22 Jun 2011 21:04:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ML4Ef7068567; Wed, 22 Jun 2011 21:04:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106222104.p5ML4Ef7068567@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Jun 2011 21:04: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: r223440 - in head/sys: amd64/include amd64/pci conf i386/include i386/pci x86/include x86/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, 22 Jun 2011 21:04:14 -0000 Author: jhb Date: Wed Jun 22 21:04:13 2011 New Revision: 223440 URL: http://svn.freebsd.org/changeset/base/223440 Log: Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to the x86 tree. The $PIR code is still only enabled on i386 and not amd64. While here, make the qpi(4) driver on conditional on 'device pci'. Added: head/sys/x86/include/pci_cfgreg.h - copied, changed from r223433, head/sys/i386/include/pci_cfgreg.h head/sys/x86/pci/pci_bus.c - copied, changed from r223428, head/sys/i386/pci/pci_bus.c Deleted: head/sys/amd64/pci/pci_bus.c head/sys/i386/pci/pci_bus.c Modified: head/sys/amd64/include/pci_cfgreg.h head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/i386/include/param.h head/sys/i386/include/pci_cfgreg.h Modified: head/sys/amd64/include/pci_cfgreg.h ============================================================================== --- head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/amd64/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -1,44 +1,6 @@ /*- - * Copyright (c) 1997, Stefan Esser - * 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 unmodified, 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$ - * + * This file is in the public domain. */ +/* $FreeBSD$ */ -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc - -#define CONF1_ENABLE 0x80000000ul -#define CONF1_ENABLE_CHK 0x80000000ul -#define CONF1_ENABLE_MSK 0x7f000000ul -#define CONF1_ENABLE_CHK1 0xff000001ul -#define CONF1_ENABLE_MSK1 0x80000001ul -#define CONF1_ENABLE_RES1 0x80000000ul - -u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); -int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); -int pci_cfgregopen(void); -u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#include Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.amd64 Wed Jun 22 21:04:13 2011 (r223440) @@ -128,7 +128,6 @@ amd64/amd64/trap.c standard amd64/amd64/uio_machdep.c standard amd64/amd64/uma_machdep.c standard amd64/amd64/vm_machdep.c standard -amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/aesni/aesencdec_amd64.S optional aesni crypto/aesni/aeskeys_amd64.S optional aesni @@ -315,7 +314,8 @@ x86/isa/isa.c standard x86/isa/isa_dma.c standard x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.i386 Wed Jun 22 21:04:13 2011 (r223440) @@ -352,7 +352,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -405,7 +404,8 @@ x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa x86/isa/nmi.c standard x86/isa/orm.c optional isa -x86/pci/qpi.c standard +x86/pci/pci_bus.c optional pci +x86/pci/qpi.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/conf/files.pc98 Wed Jun 22 21:04:13 2011 (r223440) @@ -199,7 +199,6 @@ i386/linux/linux_support.s optional comp dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux -i386/pci/pci_bus.c optional pci i386/pci/pci_cfgreg.c optional pci i386/pci/pci_pir.c optional pci i386/svr4/svr4_locore.s optional compat_svr4 \ @@ -249,6 +248,7 @@ pc98/pc98/pc98_machdep.c standard x86/isa/atpic.c optional atpic x86/isa/clock.c standard x86/isa/isa.c optional isa +x86/pci/pci_bus.c optional pci x86/x86/busdma_machdep.c standard x86/x86/dump_machdep.c standard x86/x86/io_apic.c optional apic Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/i386/include/param.h Wed Jun 22 21:04:13 2011 (r223440) @@ -56,6 +56,7 @@ #define __HAVE_ACPI +#define __HAVE_PIR #define __PCI_REROUTE_INTERRUPT #ifndef MACHINE Modified: head/sys/i386/include/pci_cfgreg.h ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 20:20:49 2011 (r223439) +++ head/sys/i386/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -1,53 +1,6 @@ /*- - * Copyright (c) 1997, Stefan Esser - * 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 unmodified, 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$ - * + * This file is in the public domain. */ +/* $FreeBSD$ */ -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc - -#define CONF1_ENABLE 0x80000000ul -#define CONF1_ENABLE_CHK 0x80000000ul -#define CONF1_ENABLE_MSK 0x7f000000ul -#define CONF1_ENABLE_CHK1 0xff000001ul -#define CONF1_ENABLE_MSK1 0x80000001ul -#define CONF1_ENABLE_RES1 0x80000000ul - -#define CONF2_ENABLE_PORT 0x0cf8 -#define CONF2_FORWARD_PORT 0x0cfa - -#define CONF2_ENABLE_CHK 0x0e -#define CONF2_ENABLE_RES 0x0e - -u_long hostb_alloc_start(int type, u_long start, u_long end, u_long count); -int pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus); -int pci_cfgregopen(void); -u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); -void pci_pir_open(void); -int pci_pir_probe(int bus, int require_parse); -int pci_pir_route_interrupt(int bus, int device, int func, int pin); +#include Copied and modified: head/sys/x86/include/pci_cfgreg.h (from r223433, head/sys/i386/include/pci_cfgreg.h) ============================================================================== --- head/sys/i386/include/pci_cfgreg.h Wed Jun 22 18:48:07 2011 (r223433, copy source) +++ head/sys/x86/include/pci_cfgreg.h Wed Jun 22 21:04:13 2011 (r223440) @@ -27,6 +27,9 @@ * */ +#ifndef __X86_PCI_CFGREG_H__ +#define __X86_PCI_CFGREG_H__ + #define CONF1_ADDR_PORT 0x0cf8 #define CONF1_DATA_PORT 0x0cfc @@ -48,6 +51,10 @@ int pcie_cfgregopen(uint64_t base, uint int pci_cfgregopen(void); u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#ifdef __HAVE_PIR void pci_pir_open(void); int pci_pir_probe(int bus, int require_parse); int pci_pir_route_interrupt(int bus, int device, int func, int pin); +#endif + +#endif /* !__X86_PCI_CFGREG_H__ */ Copied and modified: head/sys/x86/pci/pci_bus.c (from r223428, head/sys/i386/pci/pci_bus.c) ============================================================================== --- head/sys/i386/pci/pci_bus.c Wed Jun 22 17:55:16 2011 (r223428, copy source) +++ head/sys/x86/pci/pci_bus.c Wed Jun 22 21:04:13 2011 (r223440) @@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" -static int pcibios_pcib_route_interrupt(device_t pcib, device_t dev, - int pin); - int legacy_pcib_maxslots(device_t dev) { @@ -78,6 +75,21 @@ legacy_pcib_write_config(device_t dev, u pci_cfgregwrite(bus, slot, func, reg, data, bytes); } +/* route interrupt */ + +static int +legacy_pcib_route_interrupt(device_t pcib, device_t dev, int pin) +{ + +#ifdef __HAVE_PIR + return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev), pin)); +#else + /* No routing possible */ + return (PCI_INVALID_IRQ); +#endif +} + /* Pass MSI requests up to the nexus. */ static int @@ -115,6 +127,7 @@ legacy_pcib_is_host_bridge(int bus, int uint32_t id, uint8_t class, uint8_t subclass, uint8_t *busnum) { +#ifdef __i386__ const char *s = NULL; static uint8_t pxb[4]; /* hack for 450nx */ @@ -332,6 +345,14 @@ legacy_pcib_is_host_bridge(int bus, int } return s; +#else + const char *s = NULL; + + *busnum = 0; + if (class == PCIC_BRIDGE && subclass == PCIS_BRIDGE_HOST) + s = "Host to PCI bridge"; + return s; +#endif } /* @@ -471,19 +492,23 @@ legacy_pcib_probe(device_t dev) static int legacy_pcib_attach(device_t dev) { +#ifdef __HAVE_PIR device_t pir; +#endif int bus; + bus = pcib_get_bus(dev); +#ifdef __HAVE_PIR /* * Look for a PCI BIOS interrupt routing table as that will be * our method of routing interrupts if we have one. */ - bus = pcib_get_bus(dev); if (pci_pir_probe(bus, 0)) { pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0); if (pir != NULL) device_probe_and_attach(pir); } +#endif device_add_child(dev, "pci", bus); return bus_generic_attach(dev); } @@ -587,7 +612,7 @@ static device_method_t legacy_pcib_metho DEVMETHOD(pcib_maxslots, legacy_pcib_maxslots), DEVMETHOD(pcib_read_config, legacy_pcib_read_config), DEVMETHOD(pcib_write_config, legacy_pcib_write_config), - DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt), + DEVMETHOD(pcib_route_interrupt, legacy_pcib_route_interrupt), DEVMETHOD(pcib_alloc_msi, legacy_pcib_alloc_msi), DEVMETHOD(pcib_release_msi, pcib_release_msi), DEVMETHOD(pcib_alloc_msix, legacy_pcib_alloc_msix), @@ -651,7 +676,7 @@ static devclass_t pcibus_pnp_devclass; DEFINE_CLASS_0(pcibus_pnp, pcibus_pnp_driver, pcibus_pnp_methods, 1); DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0); - +#ifdef __HAVE_PIR /* * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges * that appear in the PCIBIOS Interrupt Routing Table to use the routing @@ -664,7 +689,7 @@ static device_method_t pcibios_pcib_pci_ DEVMETHOD(device_probe, pcibios_pcib_probe), /* pcib interface */ - DEVMETHOD(pcib_route_interrupt, pcibios_pcib_route_interrupt), + DEVMETHOD(pcib_route_interrupt, legacy_pcib_route_interrupt), {0, 0} }; @@ -691,10 +716,4 @@ pcibios_pcib_probe(device_t dev) device_set_desc(dev, "PCIBIOS PCI-PCI bridge"); return (-2000); } - -static int -pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin) -{ - return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev), - pci_get_function(dev), pin)); -} +#endif From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 21:10:12 2011 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 BD7241065679; Wed, 22 Jun 2011 21:10:12 +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 A9C208FC08; Wed, 22 Jun 2011 21:10: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 p5MLACEs068781; Wed, 22 Jun 2011 21:10:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLACwx068779; Wed, 22 Jun 2011 21:10:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106222110.p5MLACwx068779@svn.freebsd.org> From: Rick Macklem Date: Wed, 22 Jun 2011 21:10:12 +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: r223441 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 21:10:12 -0000 Author: rmacklem Date: Wed Jun 22 21:10:12 2011 New Revision: 223441 URL: http://svn.freebsd.org/changeset/base/223441 Log: Plug an mbuf leak in the new NFS client that occurred when a server replied NFS3ERR_JUKEBOX/NFS4ERR_DELAY to an rpc. This affected both NFSv3 and NFSv4. Found during testing at the recent NFSv4 interoperability Bakeathon. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 21:04:13 2011 (r223440) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Jun 22 21:10:12 2011 (r223441) @@ -733,6 +733,8 @@ tryagain: while (NFSD_MONOSEC < waituntil) (void) nfs_catnap(PZERO, 0, "nfstry"); trylater_delay *= 2; + m_freem(nd->nd_mrep); + nd->nd_mrep = NULL; goto tryagain; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 21:43:10 2011 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 82CF71065672; Wed, 22 Jun 2011 21:43:10 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 733528FC0C; Wed, 22 Jun 2011 21:43: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 p5MLhAqn069840; Wed, 22 Jun 2011 21:43:10 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLhAiF069838; Wed, 22 Jun 2011 21:43:10 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201106222143.p5MLhAiF069838@svn.freebsd.org> From: Will Andrews Date: Wed, 22 Jun 2011 21:43: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: r223443 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 21:43:10 -0000 Author: will Date: Wed Jun 22 21:43:10 2011 New Revision: 223443 URL: http://svn.freebsd.org/changeset/base/223443 Log: Plumb support for the device advanced information CCB in the ATA XPT. This was previously done only for SCSI XPT in r223081, on which the change in r223089 depended in order to respond to serial number requests. As a result of r223089, da(4) and ada(4) devices register a d_getattr for geom to use to obtain the information. Reported by: ache Reviewed by: ken Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jun 22 21:18:37 2011 (r223442) +++ head/sys/cam/ata/ata_xpt.c Wed Jun 22 21:43:10 2011 (r223443) @@ -1601,6 +1601,34 @@ ata_device_transport(struct cam_path *pa } static void +ata_dev_advinfo(union ccb *start_ccb) +{ + struct cam_ed *device; + struct ccb_dev_advinfo *cdai; + off_t amt; + + start_ccb->ccb_h.status = CAM_REQ_INVALID; + device = start_ccb->ccb_h.path->device; + cdai = &start_ccb->cdai; + switch(cdai->buftype) { + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + break; + start_ccb->ccb_h.status = CAM_REQ_CMP; + cdai->provsiz = device->serial_num_len; + if (device->serial_num_len == 0) + break; + amt = device->serial_num_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->serial_num, amt); + break; + default: + break; + } +} + +static void ata_action(union ccb *start_ccb) { @@ -1652,6 +1680,11 @@ ata_action(union ccb *start_ccb) } /* FALLTHROUGH */ } + case XPT_DEV_ADVINFO: + { + ata_dev_advinfo(start_ccb); + break; + } default: xpt_action_default(start_ccb); break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 21:53:45 2011 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 6A7C0106566B; Wed, 22 Jun 2011 21:53:45 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD188FC12; Wed, 22 Jun 2011 21:53: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 p5MLrjLf070191; Wed, 22 Jun 2011 21:53:45 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MLrjfi070189; Wed, 22 Jun 2011 21:53:45 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222153.p5MLrjfi070189@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 21:53: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: r223444 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 21:53:45 -0000 Author: rodrigc Date: Wed Jun 22 21:53:45 2011 New Revision: 223444 URL: http://svn.freebsd.org/changeset/base/223444 Log: Clarify tftpd's -d flag in the new TFTP implementation. Bump date. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 21:43:10 2011 (r223443) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 21:53:45 2011 (r223444) @@ -32,7 +32,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 14, 2000 +.Dd June 22, 2011 .Dt TFTPD 8 .Os .Sh NAME @@ -150,9 +150,27 @@ compatible format string for the creatio .Fl W is specified. By default the string "%Y%m%d" is used. -.It Fl d +.It Fl d, d Ar [value] Enables debug output. -If specified twice, it will log DATA and ACK packets too. +If +.Ar value +is not specified, then the debug level is increased by one +for each instance of +.Fl d +which is specified. +.Pp +If +.Ar value +is specified, then the debug level is set to +.Ar value . +The debug level is a bitmask implemented in +.Pa src/libexec/tftpd/tftp-utils.h . +Valid values are 0 (DEBUG_NONE), 1 (DEBUG_PACKETS), 2, (DEBUG_SIMPLE), +4 (DEBUG_OPTIONS), and 8 (DEBUG_ACCESS). Multiple debug values can be combined +in the bitmask by logically OR'ing the values. For example, specifying +.Fl d +.Ar 15 +will enable all the debug values. .It Fl l Log all requests using .Xr syslog 3 From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 22:05:37 2011 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 718B31065674; Wed, 22 Jun 2011 22:05:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FCC8FC13; Wed, 22 Jun 2011 22:05: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 p5MM5bFm070595; Wed, 22 Jun 2011 22:05:37 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MM5btL070593; Wed, 22 Jun 2011 22:05:37 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222205.p5MM5btL070593@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 22:05: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: r223445 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 22:05:37 -0000 Author: rodrigc Date: Wed Jun 22 22:05:37 2011 New Revision: 223445 URL: http://svn.freebsd.org/changeset/base/223445 Log: Fix typo. Reported by: Nick Mann Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 21:53:45 2011 (r223444) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 22:05:37 2011 (r223445) @@ -273,7 +273,7 @@ was introduced in .Fx 7.4 . .Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting the the TFTP blocksize option (RFC2348), +without client and server supporting the TFTP blocksize option (RFC2348), or the non-standard TFTP rollover option. .Pp Many tftp clients will not transfer files over 16744448 octets (32767 blocks). From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 22:08:56 2011 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 5ADE9106566C; Wed, 22 Jun 2011 22:08:56 +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 4B4918FC15; Wed, 22 Jun 2011 22:08: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 p5MM8u6U070720; Wed, 22 Jun 2011 22:08:56 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MM8uE1070718; Wed, 22 Jun 2011 22:08:56 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201106222208.p5MM8uE1070718@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 22 Jun 2011 22:08: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: r223446 - head/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: Wed, 22 Jun 2011 22:08:56 -0000 Author: gavin Date: Wed Jun 22 22:08:55 2011 New Revision: 223446 URL: http://svn.freebsd.org/changeset/base/223446 Log: Use USB_VENDOR_OVISLINK define rather than the vendor ID. PR: usb/158142 Submitted by: Robert Millan MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:05:37 2011 (r223445) +++ head/sys/dev/usb/wlan/if_urtw.c Wed Jun 22 22:08:55 2011 (r223446) @@ -115,7 +115,7 @@ static const struct usb_device_id urtw_d URTW_DEV_L(REALTEK, RTL8187), URTW_DEV_L(SITECOMEU, WL168V1), URTW_DEV_L(SURECOM, EP9001G2A), - { USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) }, + { USB_VPI(USB_VENDOR_OVISLINK, 0x8187, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) }, From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 22:55:51 2011 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 D1F7B106566C; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A86C68FC12; Wed, 22 Jun 2011 22:55: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 p5MMtpNn072149; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMtp1a072147; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222255.p5MMtp1a072147@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 22:55: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: r223447 - head/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 22:55:51 -0000 Author: rodrigc Date: Wed Jun 22 22:55:51 2011 New Revision: 223447 URL: http://svn.freebsd.org/changeset/base/223447 Log: Bump date. Document the following commands which were added in the new TFTP implementation: blocksize, blocksize2, packetdrop, options, rollover Modified: head/usr.bin/tftp/tftp.1 Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Wed Jun 22 22:08:55 2011 (r223446) +++ head/usr.bin/tftp/tftp.1 Wed Jun 22 22:55:51 2011 (r223447) @@ -28,7 +28,7 @@ .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2003 +.Dd June 22, 2011 .Dt TFTP 1 .Os .Sh NAME @@ -70,6 +70,21 @@ Shorthand for "mode ascii" .It Cm binary Shorthand for "mode binary" .Pp +.It Cm blocksize Ar [size] +Sets the TFTP blksize option in TFTP Read Request or Write Request packets +to +.Ar [size] +as specified in RFC 2348. Valid values are between 8 and 65464. +If no blocksize is specified, then by default a blocksize of 512 bytes +will be used. +.Pp +.It Cm blocksize2 Ar [size] +Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets +to +.Ar [size] . +Values are restricted to powers of 2 between 8 and 32768. This is a +non-standard TFTP option. +.Pp .It Cm connect Ar host Op Ar port Set the .Ar host @@ -93,6 +108,14 @@ or .Cm put commands. .Pp +.It Cm debug Ar level +Enable or disable debugging levels during verbose output. The value of +.Ar level +can be one of +.Cm packet, simple, options, +or +.Cm access. +.Pp .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname .It Cm get Xo .Oo Ar host1 : Oc Ns Ar file1 @@ -130,6 +153,11 @@ or The default is .Em ascii . .Pp +.It Cm packetdrop [arg] +Randomly drop +.Ar arg +out of 100 packets during a transfer. This is a debugging feature. +.Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory Put a file or set of files to the remote host. @@ -149,6 +177,17 @@ see the example under the .Cm get command. .Pp +.It Cm options Ar [arg] +Enable or disable support for TFTP options. The valid values of +.Ar arg +are +.Cm on +(enable RFC 2347 options), +.Cm off +(disable RFC 2347 options), and +.Cm extra +(toggle support for non-RFC defined options). +.Pp .It Cm quit Exit .Nm . @@ -157,6 +196,15 @@ An end of file also exits. .It Cm rexmt Ar retransmission-timeout Set the per-packet retransmission timeout, in seconds. .Pp +.It Cm rollover [arg] +Specify the rollover option in TFTP Read Request or Write +Request packets. After 65535 packets have been transmitted, set the block +counter to +.Ar arg . +Valid values of +.Ar arg +are 0 and 1. This is a non-standard TFTP option. +.Pp .It Cm status Show current status. .Pp From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 22:55:51 2011 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 F22491065670; Wed, 22 Jun 2011 22:55:51 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E296C8FC13; Wed, 22 Jun 2011 22:55: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 p5MMtpr1072163; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMtpUD072161; Wed, 22 Jun 2011 22:55:51 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201106222255.p5MMtpUD072161@svn.freebsd.org> From: Will Andrews Date: Wed, 22 Jun 2011 22:55: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: r223448 - 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, 22 Jun 2011 22:55:52 -0000 Author: will Date: Wed Jun 22 22:55:51 2011 New Revision: 223448 URL: http://svn.freebsd.org/changeset/base/223448 Log: Return CAM_REQ_INVALID if the SCSI XPT receives an unsupported operation via the XPT_DEV_ADVINFO CCB. Reviewed by: ken Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed Jun 22 22:55:51 2011 (r223447) +++ head/sys/cam/scsi/scsi_xpt.c Wed Jun 22 22:55:51 2011 (r223448) @@ -2440,12 +2440,13 @@ scsi_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = &start_ccb->cdai; switch(cdai->buftype) { case CDAI_TYPE_SCSI_DEVID: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->device_id_len; if (device->device_id_len == 0) break; @@ -2456,7 +2457,7 @@ scsi_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_SERIAL_NUM: if (cdai->flags & CDAI_FLAG_STORE) - break; + return; cdai->provsiz = device->serial_num_len; if (device->serial_num_len == 0) break; @@ -2490,7 +2491,7 @@ scsi_dev_advinfo(union ccb *start_ccb) } break; default: - break; + return; } start_ccb->ccb_h.status = CAM_REQ_CMP; From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 22:56:43 2011 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 53227106566C; Wed, 22 Jun 2011 22:56:43 +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 43A648FC22; Wed, 22 Jun 2011 22:56: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 p5MMuhHD072229; Wed, 22 Jun 2011 22:56:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MMuhmr072227; Wed, 22 Jun 2011 22:56:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106222256.p5MMuhmr072227@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Jun 2011 22:56: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: r223449 - 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: Wed, 22 Jun 2011 22:56:43 -0000 Author: jkim Date: Wed Jun 22 22:56:42 2011 New Revision: 223449 URL: http://svn.freebsd.org/changeset/base/223449 Log: Fix build on ia64 after r223426. Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 22:55:51 2011 (r223448) +++ head/sys/dev/acpica/acpi_cpu.c Wed Jun 22 22:56:42 2011 (r223449) @@ -856,8 +856,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc * sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat); if (sc->cpu_cx_states[i].type < ACPI_STATE_C3) sc->cpu_non_c3 = i; +#ifndef __ia64__ else cpu_can_deep_sleep = 1; +#endif } sbuf_trim(&sb); sbuf_finish(&sb); From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 23:25:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 53D76106564A; Wed, 22 Jun 2011 23:25:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Wed, 22 Jun 2011 19:24:42 -0400 User-Agent: KMail/1.6.2 References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> In-Reply-To: <201106221455.07540.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_CnnAOthSUkiyZLi" Message-Id: <201106221924.50458.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Wed, 22 Jun 2011 23:25:02 -0000 --Boundary-00=_CnnAOthSUkiyZLi Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 22 June 2011 02:55 pm, Jung-uk Kim wrote: > On Wednesday 22 June 2011 12:47 pm, Andriy Gapon wrote: > > on 22/06/2011 19:40 Jung-uk Kim said the following: > > > Author: jkim > > > Date: Wed Jun 22 16:40:45 2011 > > > New Revision: 223426 > > > URL: http://svn.freebsd.org/changeset/base/223426 > > > > > > Log: > > > Set negative quality to TSC timecounter when C3 state is > > > enabled for Intel processors unless the invariant TSC bit of > > > CPUID is set. Intel processors may stop incrementing TSC when > > > DPSLP# pin is asserted, according to Intel processor manuals, > > > i. e., TSC timecounter is useless if the processor can enter > > > deep sleep state (C3/C4). This problem was accidentally > > > uncovered by r222869, which increased timecounter quality of > > > P-state invariant TSC, e.g., for Core2 Duo T5870 (Family 6, > > > Model f) and Atom N270 (Family 6, Model 1c). > > > > > > Reported by: Fabian Keil (freebsd-listen at fabiankeil dot > > > de) Ian FREISLICH (ianf at clue dot co dot za) > > > Tested by: Fabian Keil (freebsd-listen at fabiankeil dot de) > > > - Core2 Duo T5870 (C3 state available/enabled) > > > jkim - Xeon X5150 (C3 state unavailable) > > > > I think that this change should have a counterpart similar to > > what was done for event timers. That is, if a user forces use of > > TSC as a timecounter vis sysctl and it is known that TSC stops in > > the deep C-state, then the deep C-states should not be entered. > > This is what cpu_disable_deep_sleep does for LAPIC timers. > > Can you please review/test the attached patch? Also available from > here: > > http://people.freebsd.org/~jkim/tc_c3stop.diff I just realized kern_clocksource.c was excluded for arm and ia64. Here is updated patch. Please ignore the previous one. Thanks, Jung-uk Kim --Boundary-00=_CnnAOthSUkiyZLi Content-Type: text/plain; charset="iso-8859-1"; name="tc_c3stop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_c3stop.diff" Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c (revision 223446) +++ sys/kern/kern_tc.c (working copy) @@ -492,6 +492,12 @@ tc_windup(void) /* Now is a good time to change timecounters. */ if (th->th_counter != timecounter) { +#if !defined(__arm__) && !defined(__ia64__) + if ((timecounter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep++; + if ((th->th_counter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep--; +#endif th->th_counter = timecounter; th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / Index: sys/sparc64/sparc64/counter.c =================================================================== --- sys/sparc64/sparc64/counter.c (revision 223446) +++ sys/sparc64/sparc64/counter.c (working copy) @@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; + tc->tc_flags = 0; tc_init(tc); } Index: sys/sys/timetc.h =================================================================== --- sys/sys/timetc.h (revision 223446) +++ sys/sys/timetc.h (working copy) @@ -57,6 +57,8 @@ struct timecounter { * another timecounter higher means better. Negative * means "only use at explicit request". */ + u_int tc_flags; +#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */ void *tc_priv; /* Pointer to the timecounter's private parts. */ Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 223446) +++ sys/x86/x86/tsc.c (working copy) @@ -452,6 +452,7 @@ init_TSC_tc(void) if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { tsc_timecounter.tc_quality = -1000; + tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP; if (bootverbose) printf("TSC timecounter disabled: C3 enabled.\n"); goto init; --Boundary-00=_CnnAOthSUkiyZLi-- From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 23:25:24 2011 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 DA8991065689; Wed, 22 Jun 2011 23:25:24 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAA728FC12; Wed, 22 Jun 2011 23: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 p5MNPOCD073156; Wed, 22 Jun 2011 23:25:24 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MNPOTe073154; Wed, 22 Jun 2011 23:25:24 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222325.p5MNPOTe073154@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 23:25: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: r223450 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 23:25:25 -0000 Author: rodrigc Date: Wed Jun 22 23:25:24 2011 New Revision: 223450 URL: http://svn.freebsd.org/changeset/base/223450 Log: Update references to RFC's that the newer TFTP implementation supports. Modified: head/libexec/tftpd/tftpd.8 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Wed Jun 22 22:56:42 2011 (r223449) +++ head/libexec/tftpd/tftpd.8 Wed Jun 22 23:25:24 2011 (r223450) @@ -235,12 +235,34 @@ option. .Xr services 5 , .Xr syslog.conf 5 , .Xr inetd 8 +.Pp +The following RFC's are supported: .Rs -.%A K. R. Sollins +RFC 1350 .%T The TFTP Protocol (Revision 2) -.%D July 1992 -.%O RFC 1350, STD 33 .Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Wed Jun 22 23:26:04 2011 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 7FDA31065670; Wed, 22 Jun 2011 23:26:04 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7005F8FC12; Wed, 22 Jun 2011 23:26: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 p5MNQ4GD073218; Wed, 22 Jun 2011 23:26:04 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5MNQ4SG073216; Wed, 22 Jun 2011 23:26:04 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106222326.p5MNQ4SG073216@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 22 Jun 2011 23:26: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: r223451 - head/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2011 23:26:04 -0000 Author: rodrigc Date: Wed Jun 22 23:26:04 2011 New Revision: 223451 URL: http://svn.freebsd.org/changeset/base/223451 Log: Update references to RFC's that the newer TFTP implementation supports. Modified: head/usr.bin/tftp/tftp.1 Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Wed Jun 22 23:25:24 2011 (r223450) +++ head/usr.bin/tftp/tftp.1 Wed Jun 22 23:26:04 2011 (r223451) @@ -217,6 +217,40 @@ Toggle packet tracing. .It Cm verbose Toggle verbose mode. .El +.Sh SEE ALSO +.Xr tftp 1 +.Pp +The following RFC's are supported: +.Rs +RFC 1350 +.%T The TFTP Protocol (Revision 2) +.Re +.Rs +RFC 2347 +.%T TFTP Option Extension +.Re +.Rs +RFC 2348 +.%T TFTP Blocksize Option +.Re +.Rs +RFC 2349 +.%T TFTP Timeout Interval and Transfer Size Options +.Re +.Rs +RFC 3617 +.%T Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP) +.Re +.Pp +The non-standard +.Cm rollover +and +.Cm blksize2 +TFTP options are mentioned here: +.Rs +.%T Extending TFTP +.%U http://www.compuphase.com/tftp.htm +.Re .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:20:58 2011 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 22CE1106566B; Thu, 23 Jun 2011 00:20:58 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id CB31A8FC08; Thu, 23 Jun 2011 00:20:57 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5N0Ktww070092 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 17:20:58 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201106221924.50458.jkim@FreeBSD.org> Date: Wed, 22 Jun 2011 17:20:48 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andriy Gapon Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 00:20:58 -0000 On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: > > I just realized kern_clocksource.c was excluded for arm and ia64. > Here is updated patch. Please ignore the previous one. Any reason why we're not adding kern_clocksource.c for them? -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:27:45 2011 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 971381065672; Thu, 23 Jun 2011 00:27:45 +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 8520D8FC08; Thu, 23 Jun 2011 00:27: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 p5N0Rjf2075215; Thu, 23 Jun 2011 00:27:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N0Rjcj075201; Thu, 23 Jun 2011 00:27:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106230027.p5N0Rjcj075201@svn.freebsd.org> From: Xin LI Date: Thu, 23 Jun 2011 00:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223454 - stable/8/contrib/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 00:27:45 -0000 Author: delphij Date: Thu Jun 23 00:27:45 2011 New Revision: 223454 URL: http://svn.freebsd.org/changeset/base/223454 Log: MFC r222906: less v444. Modified: stable/8/contrib/less/NEWS stable/8/contrib/less/README stable/8/contrib/less/command.c stable/8/contrib/less/funcs.h stable/8/contrib/less/less.man stable/8/contrib/less/less.nro stable/8/contrib/less/lessecho.man stable/8/contrib/less/lessecho.nro stable/8/contrib/less/lesskey.man stable/8/contrib/less/lesskey.nro stable/8/contrib/less/optfunc.c stable/8/contrib/less/opttbl.c stable/8/contrib/less/version.c Directory Properties: stable/8/contrib/less/ (props changed) Modified: stable/8/contrib/less/NEWS ============================================================================== --- stable/8/contrib/less/NEWS Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/NEWS Thu Jun 23 00:27:45 2011 (r223454) @@ -12,6 +12,15 @@ ====================================================================== + Major changes between "less" versions 443 and 444 + +* Fix bug in unget handling that can cause strange effects on the + command line. + +* Remove vestiges of obsolete -l option that can cause a crash. + +====================================================================== + Major changes between "less" versions 436 and 443 * Change search behavior such that when a search is given an explicit Modified: stable/8/contrib/less/README ============================================================================== --- stable/8/contrib/less/README Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/README Thu Jun 23 00:27:45 2011 (r223454) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 443 + Less, version 444 - This is the distribution of less, version 443, released 09 Apr 2011. + This is the distribution of less, version 444, released 09 Jun 2011. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/8/contrib/less/command.c ============================================================================== --- stable/8/contrib/less/command.c Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/command.c Thu Jun 23 00:27:45 2011 (r223454) @@ -302,7 +302,7 @@ is_erase_char(c) */ static int mca_opt_first_char(c) - int c; + int c; { int flag = (optflag & ~OPT_NO_PROMPT); if (flag == OPT_NO_TOGGLE) @@ -846,6 +846,7 @@ ungetcc(c) ug->ug_char = c; ug->ug_next = ungot; ungot = ug; + unget_end = 0; } /* Modified: stable/8/contrib/less/funcs.h ============================================================================== --- stable/8/contrib/less/funcs.h Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/funcs.h Thu Jun 23 00:27:45 2011 (r223454) @@ -194,7 +194,6 @@ public void unmark (); public void opt_o (); public void opt__O (); - public void opt_l (); public void opt_j (); public void calc_jump_sline (); public void opt_shift (); Modified: stable/8/contrib/less/less.man ============================================================================== --- stable/8/contrib/less/less.man Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/less.man Thu Jun 23 00:27:45 2011 (r223454) @@ -1156,7 +1156,7 @@ LESS(1) next 8bcccbcc18b95.bb125.bb If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings - "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_TYPE or + "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or LANG environment variables, then the default character set is utf-8. If that string is not found, but your system supports the setlocale @@ -1580,4 +1580,4 @@ LESS(1) - Version 443: 09 Apr 2011 LESS(1) + Version 444: 09 Jun 2011 LESS(1) Modified: stable/8/contrib/less/less.nro ============================================================================== --- stable/8/contrib/less/less.nro Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/less.nro Thu Jun 23 00:27:45 2011 (r223454) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 443: 09 Apr 2011" +.TH LESS 1 "Version 444: 09 Jun 2011" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -1276,7 +1276,7 @@ to each of the possible values for LESSC .PP If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings "UTF-8", "UTF8", "utf-8" or "utf8" -is found in the LC_ALL, LC_TYPE or LANG +is found in the LC_ALL, LC_CTYPE or LANG environment variables, then the default character set is utf-8. .PP If that string is not found, but your system supports the Modified: stable/8/contrib/less/lessecho.man ============================================================================== --- stable/8/contrib/less/lessecho.man Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/lessecho.man Thu Jun 23 00:27:45 2011 (r223454) @@ -46,4 +46,4 @@ LESSECHO(1) - Version 443: 09 Apr 2011 LESSECHO(1) + Version 444: 09 Jun 2011 LESSECHO(1) Modified: stable/8/contrib/less/lessecho.nro ============================================================================== --- stable/8/contrib/less/lessecho.nro Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/lessecho.nro Thu Jun 23 00:27:45 2011 (r223454) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 443: 09 Apr 2011" +.TH LESSECHO 1 "Version 444: 09 Jun 2011" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/8/contrib/less/lesskey.man ============================================================================== --- stable/8/contrib/less/lesskey.man Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/lesskey.man Thu Jun 23 00:27:45 2011 (r223454) @@ -354,4 +354,4 @@ LESSKEY(1) - Version 443: 09 Apr 2011 LESSKEY(1) + Version 444: 09 Jun 2011 LESSKEY(1) Modified: stable/8/contrib/less/lesskey.nro ============================================================================== --- stable/8/contrib/less/lesskey.nro Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/lesskey.nro Thu Jun 23 00:27:45 2011 (r223454) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 443: 09 Apr 2011" +.TH LESSKEY 1 "Version 444: 09 Jun 2011" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/8/contrib/less/optfunc.c ============================================================================== --- stable/8/contrib/less/optfunc.c Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/optfunc.c Thu Jun 23 00:27:45 2011 (r223454) @@ -132,34 +132,6 @@ opt__O(type, s) #endif /* - * Handlers for -l option. - */ - public void -opt_l(type, s) - int type; - char *s; -{ - int err; - int n; - char *t; - - switch (type) - { - case INIT: - t = s; - n = getnum(&t, "l", &err); - if (err || n <= 0) - { - error("Line number is required after -l", NULL_PARG); - return; - } - plusoption = TRUE; - ungetsc(s); - break; - } -} - -/* * Handlers for -j option. */ public void Modified: stable/8/contrib/less/opttbl.c ============================================================================== --- stable/8/contrib/less/opttbl.c Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/opttbl.c Thu Jun 23 00:27:45 2011 (r223454) @@ -263,10 +263,6 @@ static struct loption option[] = NULL } }, - { 'l', NULL, - STRING|NO_TOGGLE|NO_QUERY, 0, NULL, opt_l, - { NULL, NULL, NULL } - }, { 'L', &L__optname, BOOL, OPT_ON, &use_lessopen, NULL, { Modified: stable/8/contrib/less/version.c ============================================================================== --- stable/8/contrib/less/version.c Thu Jun 23 00:04:06 2011 (r223453) +++ stable/8/contrib/less/version.c Thu Jun 23 00:27:45 2011 (r223454) @@ -742,6 +742,7 @@ v441 1/21/11 Fix semi-infinite loop i v442 3/2/11 Fix search bug. Add ctrl-G line edit command. v443 4/9/11 Fix Windows build. +v444 6/8/11 Fix ungetc bug; remove vestiges of obsolete -l option. */ -char version[] = "443"; +char version[] = "444"; From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:29:36 2011 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 25A951065673; Thu, 23 Jun 2011 00:29:36 +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 14F278FC15; Thu, 23 Jun 2011 00:29: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 p5N0TZh3075365; Thu, 23 Jun 2011 00:29:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N0TZ65075363; Thu, 23 Jun 2011 00:29:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106230029.p5N0TZ65075363@svn.freebsd.org> From: Xin LI Date: Thu, 23 Jun 2011 00:29: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: r223455 - stable/8/sys/dev/atkbdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 00:29:36 -0000 Author: delphij Date: Thu Jun 23 00:29:35 2011 New Revision: 223455 URL: http://svn.freebsd.org/changeset/base/223455 Log: MFC r223341: Correct a typo. Submitted by: Fabian Keil Modified: stable/8/sys/dev/atkbdc/atkbd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/atkbdc/atkbd.c ============================================================================== --- stable/8/sys/dev/atkbdc/atkbd.c Thu Jun 23 00:27:45 2011 (r223454) +++ stable/8/sys/dev/atkbdc/atkbd.c Thu Jun 23 00:29:35 2011 (r223455) @@ -1100,7 +1100,7 @@ get_typematic(keyboard_t *kbd) /* * Traditional entry points of int 0x15 and 0x16 are fixed * and later BIOSes follow them. (U)EFI CSM specification - * also mandate these fixed entry points. + * also mandates these fixed entry points. * * Validate the entry points here before we proceed further. * It's known that some recent laptops does not have the From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:31:32 2011 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 E830A106566C; Thu, 23 Jun 2011 00:31:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BCD698FC18; Thu, 23 Jun 2011 00:31:31 +0000 (UTC) Received: by fxm11 with SMTP id 11so1465979fxm.13 for ; Wed, 22 Jun 2011 17:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=qllRUKndC4zhcaVEfpL9gXKN6m+RAqmvqMIrZsXCSog=; b=wA/axO5VTarN9ZPKT7yTaeDtipLtmvgm/CgjwjShIcbirmVgvDPfY693+cl21a40u6 I2g3pFzQRz+2XKTkZsIAOC2hRhaEwDiGyViE4R4R3J0aT5gyTtySOMcsKAOZAnGyFcLT EZBJh6ISKZWz2/JWHltvegiAAUTpbmxdecwRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=QxZlqXHrzi2l8nG/uOTkPUHxjnZV47lQy40L5c5KSLncJbg9SqE8WwQQUbLT2Q1VvI 9fgEXXNH5pmnWmxre4s/jMyzxj7mWaJ3POugn6wELTIYdcMjwqnkSAPGWN89Pg2TQrqd /Gh8n45kAaHbVCqASqOQND72QsUiolcy1WxhM= Received: by 10.223.7.8 with SMTP id b8mr1759169fab.19.1308789090579; Wed, 22 Jun 2011 17:31:30 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id p3sm25718fan.21.2011.06.22.17.31.28 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 17:31:29 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E028921.2040805@FreeBSD.org> Date: Thu, 23 Jun 2011 03:30:25 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 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, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 00:31:33 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >> I just realized kern_clocksource.c was excluded for arm and ia64. >> Here is updated patch. Please ignore the previous one. > > Any reason why we're not adding kern_clocksource.c for them? Their event timers code still waits for refactoring. I have neither documentation nor hardware for them. Help would be appreciated. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:36:50 2011 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 11D301065670; Thu, 23 Jun 2011 00:36:50 +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 F33DE8FC17; Thu, 23 Jun 2011 00:36: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 p5N0anbn075660; Thu, 23 Jun 2011 00:36:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N0anXU075645; Thu, 23 Jun 2011 00:36:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106230036.p5N0anXU075645@svn.freebsd.org> From: Xin LI Date: Thu, 23 Jun 2011 00:36:49 +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: r223456 - in stable/7: contrib/less usr.bin/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 00:36:50 -0000 Author: delphij Date: Thu Jun 23 00:36:49 2011 New Revision: 223456 URL: http://svn.freebsd.org/changeset/base/223456 Log: MFC less v444. Deleted: stable/7/contrib/less/COPYING Modified: stable/7/contrib/less/LICENSE stable/7/contrib/less/Makefile.aut stable/7/contrib/less/Makefile.wnm stable/7/contrib/less/NEWS stable/7/contrib/less/README stable/7/contrib/less/brac.c stable/7/contrib/less/ch.c stable/7/contrib/less/charset.c stable/7/contrib/less/charset.h stable/7/contrib/less/cmd.h stable/7/contrib/less/cmdbuf.c stable/7/contrib/less/command.c stable/7/contrib/less/configure stable/7/contrib/less/configure.ac stable/7/contrib/less/cvt.c stable/7/contrib/less/decode.c stable/7/contrib/less/defines.ds stable/7/contrib/less/defines.h.in stable/7/contrib/less/defines.o2 stable/7/contrib/less/defines.o9 stable/7/contrib/less/defines.wn stable/7/contrib/less/edit.c stable/7/contrib/less/filename.c stable/7/contrib/less/forwback.c stable/7/contrib/less/funcs.h stable/7/contrib/less/help.c stable/7/contrib/less/ifile.c stable/7/contrib/less/input.c stable/7/contrib/less/jump.c stable/7/contrib/less/less.h stable/7/contrib/less/less.hlp stable/7/contrib/less/less.man stable/7/contrib/less/less.nro stable/7/contrib/less/lessecho.c stable/7/contrib/less/lessecho.man stable/7/contrib/less/lessecho.nro stable/7/contrib/less/lesskey.c stable/7/contrib/less/lesskey.h stable/7/contrib/less/lesskey.man stable/7/contrib/less/lesskey.nro stable/7/contrib/less/lglob.h stable/7/contrib/less/line.c stable/7/contrib/less/linenum.c stable/7/contrib/less/lsystem.c stable/7/contrib/less/main.c stable/7/contrib/less/mark.c stable/7/contrib/less/mkhelp.c stable/7/contrib/less/optfunc.c stable/7/contrib/less/option.c stable/7/contrib/less/option.h stable/7/contrib/less/opttbl.c stable/7/contrib/less/os.c stable/7/contrib/less/output.c stable/7/contrib/less/pattern.c stable/7/contrib/less/pattern.h stable/7/contrib/less/pckeys.h stable/7/contrib/less/position.c stable/7/contrib/less/position.h stable/7/contrib/less/prompt.c stable/7/contrib/less/screen.c stable/7/contrib/less/scrsize.c stable/7/contrib/less/search.c stable/7/contrib/less/signal.c stable/7/contrib/less/tags.c stable/7/contrib/less/ttyin.c stable/7/contrib/less/version.c stable/7/usr.bin/less/defines.h Directory Properties: stable/7/contrib/less/ (props changed) stable/7/usr.bin/less/ (props changed) Modified: stable/7/contrib/less/LICENSE ============================================================================== --- stable/7/contrib/less/LICENSE Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/LICENSE Thu Jun 23 00:36:49 2011 (r223456) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2009 Mark Nudelman +Copyright (C) 1984-2011 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/7/contrib/less/Makefile.aut ============================================================================== --- stable/7/contrib/less/Makefile.aut Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/Makefile.aut Thu Jun 23 00:36:49 2011 (r223456) @@ -34,6 +34,14 @@ DISTFILES = \ all: help.c funcs.h ${srcdir}/configure +release: .FORCE + ${MAKE} -f Makefile.aut tagall + ${MAKE} -f Makefile.aut all + ${MAKE} -f Makefile.aut clean + ${MAKE} -f Makefile.aut dist + +.FORCE: + help.c: less.hlp mkhelp -mv -f ${srcdir}/help.c ${srcdir}/help.c.old rm -rf help.c Modified: stable/7/contrib/less/Makefile.wnm ============================================================================== --- stable/7/contrib/less/Makefile.wnm Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/Makefile.wnm Thu Jun 23 00:36:49 2011 (r223456) @@ -7,11 +7,11 @@ CC = cl # Normal flags CFLAGS = /nologo /ML /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -LDFLAGS = /subsystem:console /incremental:no /machine:I386 +LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 # Debugging flags #CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -#LDFLAGS = /subsystem:console /incremental:yes /debug /machine:I386 +#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386 LD = link LIBS = user32.lib Modified: stable/7/contrib/less/NEWS ============================================================================== --- stable/7/contrib/less/NEWS Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/NEWS Thu Jun 23 00:36:49 2011 (r223456) @@ -12,6 +12,46 @@ ====================================================================== + Major changes between "less" versions 443 and 444 + +* Fix bug in unget handling that can cause strange effects on the + command line. + +* Remove vestiges of obsolete -l option that can cause a crash. + +====================================================================== + + Major changes between "less" versions 436 and 443 + +* Change search behavior such that when a search is given an explicit + pattern, the entire displayed screen is included in the search and + not just the portion after the target line. + +* Add -A option to change search behavior to the old way: only + the portion of the screen after the target line is searched. + +* Add %F formatting to prompt strings, replaced by the last component + of the input file. + +* Control-G while editing a command exits the command. + +* Less now exits with status 2 if control-C is pressed and -K is in effect. + +* Fix "ungetc overflow" when passing long commands via the -p option. + +* Fix bug in using line filtering via the & command + in combination with -i and -I. + +* Fix bug in handling negative arguments to the -j option. + +* Fix bug in handling %t in prompt strings. + +* Improve handling of long option names. + +* Improve percentage calculation for very large files. + +====================================================================== + Major changes between "less" versions 429 and 436 * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". Modified: stable/7/contrib/less/README ============================================================================== --- stable/7/contrib/less/README Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/README Thu Jun 23 00:36:49 2011 (r223456) @@ -1,7 +1,15 @@ +************************************************************************** +************************************************************************** +** ** +** The FreeBSD Project has chosen to redistribute and modify Less under ** +** the 'Less License' (as described in the 'LICENSE' file). ** +** ** +************************************************************************** +************************************************************************** - Less, version 436 + Less, version 444 - This is the distribution of less, version 436, released 07 Jul 2009. + This is the distribution of less, version 444, released 09 Jun 2011. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -93,6 +101,10 @@ complaints, etc., you may mail to the au Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. +(Note that the above note was originally written at a time when +"hackers" most commonly meant "enthusiastic and dedicated computer +programmers", not "persons who attempt to circumvent computer security".) + ======================================================================= Modified: stable/7/contrib/less/brac.c ============================================================================== --- stable/7/contrib/less/brac.c Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/brac.c Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/7/contrib/less/ch.c ============================================================================== --- stable/7/contrib/less/ch.c Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/ch.c Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/7/contrib/less/charset.c ============================================================================== --- stable/7/contrib/less/charset.c Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/charset.c Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -395,7 +395,7 @@ init_charset() binary_char(c) LWCHAR c; { - if (utf_mode) + if (utf_mode) return (is_ubin_char(c)); c &= 0377; return (chardef[c] & IS_BINARY_CHAR); @@ -817,7 +817,7 @@ static struct wchar_range ubin_table[] = { 0x000B, 0x000C} /* Cc */, { 0x000E, 0x001A} /* Cc */, { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, + { 0x007F, 0x009F} /* Cc */, #if 0 { 0x00AD, 0x00AD} /* Cf */, #endif Modified: stable/7/contrib/less/charset.h ============================================================================== --- stable/7/contrib/less/charset.h Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/charset.h Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2009 Mark Nudelman + * Copyright (C) 2005-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: stable/7/contrib/less/cmd.h ============================================================================== --- stable/7/contrib/less/cmd.h Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/cmd.h Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -98,6 +98,7 @@ #define EC_F_COMPLETE 17 #define EC_B_COMPLETE 18 #define EC_LITERAL 19 +#define EC_ABORT 20 #define EC_NOACTION 101 #define EC_UINVALID 102 Modified: stable/7/contrib/less/cmdbuf.c ============================================================================== --- stable/7/contrib/less/cmdbuf.c Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/cmdbuf.c Thu Jun 23 00:36:49 2011 (r223456) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -857,6 +857,10 @@ cmd_edit(c) case EC_LINEKILL: not_in_completion(); return (cmd_kill()); + case EC_ABORT: + not_in_completion(); + (void) cmd_kill(); + return (CC_QUIT); case EC_W_BACKSPACE: not_in_completion(); return (cmd_werase()); Modified: stable/7/contrib/less/command.c ============================================================================== --- stable/7/contrib/less/command.c Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/command.c Thu Jun 23 00:36:49 2011 (r223456) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -57,8 +57,6 @@ extern int shift_count; extern int oldbot; extern int forw_prompt; -static char ungot[UNGOT_SIZE]; -static char *ungotp = NULL; #if SHELL_ESCAPE static char *shellcmd = NULL; /* For holding last shell command for "!!" */ #endif @@ -66,7 +64,8 @@ static int mca; /* The multicharacter static int search_type; /* The previous type of search */ static LINENUM number; /* The number typed by the user */ static long fraction; /* The fractional part of the number */ -static char optchar; +static struct loption *curropt; +static int opt_lower; static int optflag; static int optgetname; static POSITION bottompos; @@ -75,6 +74,13 @@ static int save_hshift; static char pipec; #endif +struct ungot { + struct ungot *ug_next; + char ug_char; +}; +static struct ungot* ungot = NULL; +static int unget_end = 0; + static void multi_search(); /* @@ -228,8 +234,8 @@ exec_mca() every_first_cmd = save(cbuf); break; case A_OPT_TOGGLE: - toggle_option(optchar, cbuf, optflag); - optchar = '\0'; + toggle_option(curropt, opt_lower, cbuf, optflag); + curropt = NULL; break; case A_F_BRACKET: match_brac(cbuf[0], cbuf[1], 1, (int) number); @@ -282,22 +288,254 @@ exec_mca() } /* - * Add a character to a multi-character command. + * Is a character an erase or kill char? */ static int -mca_char(c) +is_erase_char(c) + int c; +{ + return (c == erase_char || c == erase2_char || c == kill_char); +} + +/* + * Handle the first char of an option (after the initial dash). + */ + static int +mca_opt_first_char(c) + int c; +{ + int flag = (optflag & ~OPT_NO_PROMPT); + if (flag == OPT_NO_TOGGLE) + { + switch (c) + { + case '_': + /* "__" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } else + { + switch (c) + { + case '+': + /* "-+" = UNSET. */ + optflag = (flag == OPT_UNSET) ? + OPT_TOGGLE : OPT_UNSET; + mca_opt_toggle(); + return (MCA_MORE); + case '!': + /* "-!" = SET */ + optflag = (flag == OPT_SET) ? + OPT_TOGGLE : OPT_SET; + mca_opt_toggle(); + return (MCA_MORE); + case CONTROL('P'): + optflag ^= OPT_NO_PROMPT; + mca_opt_toggle(); + return (MCA_MORE); + case '-': + /* "--" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } + /* Char was not handled here. */ + return (NO_MCA); +} + +/* + * Add a char to a long option name. + * See if we've got a match for an option name yet. + * If so, display the complete name and stop + * accepting chars until user hits RETURN. + */ + static int +mca_opt_nonfirst_char(c) int c; { char *p; - int flag; - char buf[3]; + char *oname; + + if (curropt != NULL) + { + /* + * Already have a match for the name. + * Don't accept anything but erase/kill. + */ + if (is_erase_char(c)) + return (MCA_DONE); + return (MCA_MORE); + } + /* + * Add char to cmd buffer and try to match + * the option name. + */ + if (cmd_char(c) == CC_QUIT) + return (MCA_DONE); + p = get_cmdbuf(); + opt_lower = ASCII_IS_LOWER(p[0]); + curropt = findopt_name(&p, &oname, NULL); + if (curropt != NULL) + { + /* + * Got a match. + * Remember the option and + * display the full option name. + */ + cmd_reset(); + mca_opt_toggle(); + for (p = oname; *p != '\0'; p++) + { + c = *p; + if (!opt_lower && ASCII_IS_LOWER(c)) + c = ASCII_TO_UPPER(c); + if (cmd_char(c) != CC_OK) + return (MCA_DONE); + } + } + return (MCA_MORE); +} + +/* + * Handle a char of an option toggle command. + */ + static int +mca_opt_char(c) + int c; +{ PARG parg; + /* + * This may be a short option (single char), + * or one char of a long option name, + * or one char of the option parameter. + */ + if (curropt == NULL && len_cmdbuf() == 0) + { + int ret = mca_opt_first_char(c); + if (ret != NO_MCA) + return (ret); + } + if (optgetname) + { + /* We're getting a long option name. */ + if (c != '\n' && c != '\r') + return (mca_opt_nonfirst_char(c)); + if (curropt == NULL) + { + parg.p_string = get_cmdbuf(); + error("There is no --%s option", &parg); + return (MCA_DONE); + } + optgetname = FALSE; + cmd_reset(); + } else + { + if (is_erase_char(c)) + return (NO_MCA); + if (curropt != NULL) + /* We're getting the option parameter. */ + return (NO_MCA); + curropt = findopt(c); + if (curropt == NULL) + { + parg.p_string = propt(c); + error("There is no %s option", &parg); + return (MCA_DONE); + } + } + /* + * If the option which was entered does not take a + * parameter, toggle the option immediately, + * so user doesn't have to hit RETURN. + */ + if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || + !opt_has_param(curropt)) + { + toggle_option(curropt, ASCII_IS_LOWER(c), "", optflag); + return (MCA_DONE); + } + /* + * Display a prompt appropriate for the option parameter. + */ + start_mca(A_OPT_TOGGLE, opt_prompt(curropt), (void*)NULL, 0); + return (MCA_MORE); +} + +/* + * Handle a char of a search command. + */ + static int +mca_search_char(c) + int c; +{ + int flag = 0; + + /* + * Certain characters as the first char of + * the pattern have special meaning: + * ! Toggle the NO_MATCH flag + * * Toggle the PAST_EOF flag + * @ Toggle the FIRST_FILE flag + */ + if (len_cmdbuf() > 0) + return (NO_MCA); + + switch (c) + { + case '*': + if (less_is_more) + break; + case CONTROL('E'): /* ignore END of file */ + if (mca != A_FILTER) + flag = SRCH_PAST_EOF; + break; + case '@': + if (less_is_more) + break; + case CONTROL('F'): /* FIRST file */ + if (mca != A_FILTER) + flag = SRCH_FIRST_FILE; + break; + case CONTROL('K'): /* KEEP position */ + if (mca != A_FILTER) + flag = SRCH_NO_MOVE; + break; + case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ + flag = SRCH_NO_REGEX; + break; + case CONTROL('N'): /* NOT match */ + case '!': + flag = SRCH_NO_MATCH; + break; + } + + if (flag != 0) + { + search_type ^= flag; + mca_search(); + return (MCA_MORE); + } + return (NO_MCA); +} + +/* + * Handle a character of a multi-character command. + */ + static int +mca_char(c) + int c; +{ + int ret; + switch (mca) { case 0: /* - * Not in a multicharacter command. + * We're not in a multicharacter command. */ return (NO_MCA); @@ -320,7 +558,8 @@ mca_char(c) { /* * Not part of the number. - * Treat as a normal command character. + * End the number and treat this char + * as a normal command character. */ number = cmd_int(&fraction); mca = 0; @@ -330,218 +569,26 @@ mca_char(c) break; case A_OPT_TOGGLE: - /* - * Special case for the TOGGLE_OPTION command. - * If the option letter which was entered is a - * single-char option, execute the command immediately, - * so user doesn't have to hit RETURN. - * If the first char is + or -, this indicates - * OPT_UNSET or OPT_SET respectively, instead of OPT_TOGGLE. - * "--" begins inputting a long option name. - */ - if (optchar == '\0' && len_cmdbuf() == 0) - { - flag = (optflag & ~OPT_NO_PROMPT); - if (flag == OPT_NO_TOGGLE) - { - switch (c) - { - case '_': - /* "__" = long option name. */ - optgetname = TRUE; - mca_opt_toggle(); - return (MCA_MORE); - } - } else - { - switch (c) - { - case '+': - /* "-+" = UNSET. */ - optflag = (flag == OPT_UNSET) ? - OPT_TOGGLE : OPT_UNSET; - mca_opt_toggle(); - return (MCA_MORE); - case '!': - /* "-!" = SET */ - optflag = (flag == OPT_SET) ? - OPT_TOGGLE : OPT_SET; - mca_opt_toggle(); - return (MCA_MORE); - case CONTROL('P'): - optflag ^= OPT_NO_PROMPT; - mca_opt_toggle(); - return (MCA_MORE); - case '-': - /* "--" = long option name. */ - optgetname = TRUE; - mca_opt_toggle(); - return (MCA_MORE); - } - } - } - if (optgetname) - { - /* - * We're getting a long option name. - * See if we've matched an option name yet. - * If so, display the complete name and stop - * accepting chars until user hits RETURN. - */ - struct loption *o; - char *oname; - int lc; - - if (c == '\n' || c == '\r') - { - /* - * When the user hits RETURN, make sure - * we've matched an option name, then - * pretend he just entered the equivalent - * option letter. - */ - if (optchar == '\0') - { - parg.p_string = get_cmdbuf(); - error("There is no --%s option", &parg); - return (MCA_DONE); - } - optgetname = FALSE; - cmd_reset(); - c = optchar; - } else - { - if (optchar != '\0') - { - /* - * Already have a match for the name. - * Don't accept anything but erase/kill. - */ - if (c == erase_char || - c == erase2_char || - c == kill_char) - return (MCA_DONE); - return (MCA_MORE); - } - /* - * Add char to cmd buffer and try to match - * the option name. - */ - if (cmd_char(c) == CC_QUIT) - return (MCA_DONE); - p = get_cmdbuf(); - lc = ASCII_IS_LOWER(p[0]); - o = findopt_name(&p, &oname, NULL); - if (o != NULL) - { - /* - * Got a match. - * Remember the option letter and - * display the full option name. - */ - optchar = o->oletter; - if (!lc && ASCII_IS_LOWER(optchar)) - optchar = ASCII_TO_UPPER(optchar); - cmd_reset(); - mca_opt_toggle(); - for (p = oname; *p != '\0'; p++) - { - c = *p; - if (!lc && ASCII_IS_LOWER(c)) - c = ASCII_TO_UPPER(c); - if (cmd_char(c) != CC_OK) - return (MCA_DONE); - } - } - return (MCA_MORE); - } - } else - { - if (c == erase_char || c == erase2_char || c == kill_char) - break; - if (optchar != '\0') - /* We already have the option letter. */ - break; - } - - optchar = c; - if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || - single_char_option(c)) - { - toggle_option(c, "", optflag); - return (MCA_DONE); - } - /* - * Display a prompt appropriate for the option letter. - */ - if ((p = opt_prompt(c)) == NULL) - { - buf[0] = '-'; - buf[1] = c; - buf[2] = '\0'; - p = buf; - } - start_mca(A_OPT_TOGGLE, p, (void*)NULL, 0); - return (MCA_MORE); + ret = mca_opt_char(c); + if (ret != NO_MCA) + return (ret); + break; case A_F_SEARCH: case A_B_SEARCH: case A_FILTER: - /* - * Special case for search commands. - * Certain characters as the first char of - * the pattern have special meaning: - * ! Toggle the NO_MATCH flag - * * Toggle the PAST_EOF flag - * @ Toggle the FIRST_FILE flag - */ - if (len_cmdbuf() > 0) - /* - * Only works for the first char of the pattern. - */ - break; + ret = mca_search_char(c); + if (ret != NO_MCA) + return (ret); + break; - flag = 0; - switch (c) - { - case '*': - if (less_is_more) - break; - case CONTROL('E'): /* ignore END of file */ - if (mca != A_FILTER) - flag = SRCH_PAST_EOF; - break; - case '@': - if (less_is_more) - break; - case CONTROL('F'): /* FIRST file */ - if (mca != A_FILTER) - flag = SRCH_FIRST_FILE; - break; - case CONTROL('K'): /* KEEP position */ - if (mca != A_FILTER) - flag = SRCH_NO_MOVE; - break; - case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ - flag = SRCH_NO_REGEX; - break; - case CONTROL('N'): /* NOT match */ - case '!': - flag = SRCH_NO_MATCH; - break; - } - if (flag != 0) - { - search_type ^= flag; - mca_search(); - return (MCA_MORE); - } + default: + /* Other multicharacter command. */ break; } /* - * Any other multicharacter command - * is terminated by a newline. + * The multichar command is terminated by a newline. */ if (c == '\n' || c == '\r') { @@ -641,7 +688,7 @@ prompt() { register char *p; - if (ungotp != NULL && ungotp > ungot) + if (ungot != NULL) { /* * No prompt necessary if commands are from @@ -731,48 +778,59 @@ dispversion() public int getcc() { - if (ungotp == NULL) + if (unget_end) + { /* - * Normal case: no ungotten chars, so get one from the user. + * We have just run out of ungotten chars. */ - return (getchr()); - - if (ungotp > ungot) + unget_end = 0; + if (len_cmdbuf() == 0 || !empty_screen()) + return (getchr()); /* - * Return the next ungotten char. + * Command is incomplete, so try to complete it. */ - return (*--ungotp); + switch (mca) + { + case A_DIGIT: + /* + * We have a number but no command. Treat as #g. + */ + return ('g'); - /* - * We have just run out of ungotten chars. - */ - ungotp = NULL; - if (len_cmdbuf() == 0 || !empty_screen()) - return (getchr()); - /* - * Command is incomplete, so try to complete it. - */ - switch (mca) - { - case A_DIGIT: - /* - * We have a number but no command. Treat as #g. - */ - return ('g'); + case A_F_SEARCH: + case A_B_SEARCH: + /* + * We have "/string" but no newline. Add the \n. + */ + return ('\n'); - case A_F_SEARCH: - case A_B_SEARCH: - /* - * We have "/string" but no newline. Add the \n. - */ - return ('\n'); + default: + /* + * Some other incomplete command. Let user complete it. + */ + return (getchr()); + } + } - default: + if (ungot == NULL) + { /* - * Some other incomplete command. Let user complete it. + * Normal case: no ungotten chars, so get one from the user. */ return (getchr()); } + + /* + * Return the next ungotten char. + */ + { + struct ungot *ug = ungot; + char c = ug->ug_char; + ungot = ug->ug_next; + free(ug); + unget_end = (ungot == NULL); + return (c); + } } /* @@ -783,14 +841,12 @@ getcc() ungetcc(c) int c; { - if (ungotp == NULL) - ungotp = ungot; - if (ungotp >= ungot + sizeof(ungot)) - { - error("ungetcc overflow", NULL_PARG); - quit(QUIT_ERROR); - } - *ungotp++ = c; + struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot)); + + ug->ug_char = c; + ug->ug_next = ungot; + ungot = ug; + unget_end = 0; } /* @@ -933,7 +989,7 @@ commands() mca = 0; cmd_accept(); number = 0; - optchar = '\0'; + curropt = NULL; /* * See if any signals need processing. Modified: stable/7/contrib/less/configure ============================================================================== --- stable/7/contrib/less/configure Thu Jun 23 00:29:35 2011 (r223455) +++ stable/7/contrib/less/configure Thu Jun 23 00:36:49 2011 (r223456) @@ -1,18 +1,22 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for less 1. +# Generated by GNU Autoconf 2.67 for less 1. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +24,15 @@ if test -n "${ZSH_VERSION+set}" && (emul alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +40,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +57,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +80,6 @@ if test "${PATH_SEPARATOR+set}" != set; } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +89,15 @@ fi IFS=" "" $as_nl" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 00:58:42 2011 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 76B62106564A; Thu, 23 Jun 2011 00:58:42 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 403E38FC0C; Thu, 23 Jun 2011 00:58:41 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5N0waqb070236 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 22 Jun 2011 17:58:42 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E028921.2040805@FreeBSD.org> Date: Wed, 22 Jun 2011 17:58:30 -0700 Content-Transfer-Encoding: 7bit Message-Id: <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 00:58:42 -0000 On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: > Marcel Moolenaar wrote: >> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>> I just realized kern_clocksource.c was excluded for arm and ia64. >>> Here is updated patch. Please ignore the previous one. >> >> Any reason why we're not adding kern_clocksource.c for them? > > Their event timers code still waits for refactoring. I have neither > documentation nor hardware for them. Help would be appreciated. Can you give me a pointer to a document orpage that describes what is being refactored, why and how? Thanks, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 01:16:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 2CEAF1065670; Thu, 23 Jun 2011 01:16:33 +0000 (UTC) Date: Thu, 23 Jun 2011 01:16:33 +0000 From: Alexander Best To: Xin LI Message-ID: <20110623011633.GA8035@freebsd.org> References: <201106201648.p5KGm0fp057853@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106201648.p5KGm0fp057853@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223342 - head/contrib/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 01:16:33 -0000 On Mon Jun 20 11, Xin LI wrote: > Author: delphij > Date: Mon Jun 20 16:48:00 2011 > New Revision: 223342 > URL: http://svn.freebsd.org/changeset/base/223342 > > Log: > Revert r214857 pursudant to 9.0-RELEASE cycle. why does top(1) have so much problems with finding the applicable number of available columns? ps(1) works great regarding this matter. for me it works without the need for the -w or -ww switch under the console and under X and always makes perfect use of the available columns. i've never been able to make `top -a` display complete commands, although there defenately are enough columns available. cheers. alex > > Requested by: jh > > Modified: > head/contrib/top/display.c > head/contrib/top/top.h > > Modified: head/contrib/top/display.c > ============================================================================== > --- head/contrib/top/display.c Mon Jun 20 16:42:20 2011 (r223341) > +++ head/contrib/top/display.c Mon Jun 20 16:48:00 2011 (r223342) > @@ -698,7 +698,7 @@ char *text; > int width; > > s = NULL; > - width = screen_width; > + width = display_width; > header_length = strlen(text); > if (header_length >= width) { > s = malloc((width + 1) * sizeof(char)); > @@ -706,14 +706,6 @@ char *text; > return (NULL); > strncpy(s, text, width); > s[width] = '\0'; > - } else { > - s = malloc((width + 1) * sizeof(char)); > - if (s == NULL) > - return (NULL); > - strncpy(s, text, width); > - while (screen_width > header_length) > - s[header_length++] = ' '; > - s[width] = '\0'; > } > return (s); > } > @@ -738,7 +730,7 @@ char *text; > if (header_status == ON) > { > putchar('\n'); > - standout(text, stdout); > + fputs(text, stdout); > lastline++; > } > else if (header_status == ERASE) > > Modified: head/contrib/top/top.h > ============================================================================== > --- head/contrib/top/top.h Mon Jun 20 16:42:20 2011 (r223341) > +++ head/contrib/top/top.h Mon Jun 20 16:48:00 2011 (r223342) > @@ -14,7 +14,7 @@ > extern int Header_lines; /* 7 */ > > /* Maximum number of columns allowed for display */ > -#define MAX_COLS 512 > +#define MAX_COLS 128 > > /* Log base 2 of 1024 is 10 (2^10 == 1024) */ > #define LOG1024 10 From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 01:37:39 2011 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 05027106566B; Thu, 23 Jun 2011 01:37:39 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id D89D48FC08; Thu, 23 Jun 2011 01:37:37 +0000 (UTC) Received: by fxm11 with SMTP id 11so1493982fxm.13 for ; Wed, 22 Jun 2011 18:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=vEvvDw6MgQlEfTWLVFDXk0NOyv7lzkNgXmW4n1j13Is=; b=LW17x2KEP7TbxAM7qBbERE3stPPjMxB6Pg+kobvuCyQEWaInsNSqCv6AcW3ohpq30l BRTpbWZ4Xo3iFnOKXJHJ/JlqA+O0x7mke+UgZiwD0Jz8FI9PPamdpjYPJ8HAje3+Qnsf g/IHzgXKyslxpRmfTfcoAu58wVJUoJ1zeXezM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=xYRrfNSjKQ72xYI4YDDMb8MYSOxOaTjbVfKUwsIrWmFCn4IJyds6gVLvlnR8myvcob 4tdh7kQDLAkZzbDkALjSl6C687JHrwmSD2H92HvBMBGU0CjgwMY1gYEIvqqBeF2zlNgg jzbA80BECu3uJVwS3VTaMXqH7vqbcMHmrQ35A= Received: by 10.223.98.5 with SMTP id o5mr1810887fan.33.1308793056841; Wed, 22 Jun 2011 18:37:36 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n15sm663289fag.42.2011.06.22.18.37.34 (version=SSLv3 cipher=OTHER); Wed, 22 Jun 2011 18:37:35 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E02989F.6040703@FreeBSD.org> Date: Thu, 23 Jun 2011 04:36:31 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> In-Reply-To: <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> X-Enigmail-Version: 0.96.0 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, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 01:37:39 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >> Marcel Moolenaar wrote: >>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>> I just realized kern_clocksource.c was excluded for arm and ia64. >>>> Here is updated patch. Please ignore the previous one. >>> Any reason why we're not adding kern_clocksource.c for them? >> Their event timers code still waits for refactoring. I have neither >> documentation nor hardware for them. Help would be appreciated. > > Can you give me a pointer to a document orpage that describes > what is being refactored, why and how? In short, timer management code was unified and formalized. Instead of direct programming periodic timers from MD code and calling hard-/ stat-/ profclock() from there, timer hardware should be exposed to the MI kernel using sys/timeet.h API to allow kern_clocksource.c manage it. Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() callbacks from MD initialization code, and cpu_idleclock() and cpu_activeclock() from MD cpu_idle(). Here is some references: man 4 eventtimers http://wiki.freebsd.org/201010DevSummit?action=AttachFile&do=view&target=timers.pdf http://svnweb.freebsd.org/base?view=revision&revision=209371 http://svnweb.freebsd.org/base?view=revision&revision=212541 All architectures except ia64 and non-Marvell arm are already done, so you may took any of them as reference. Ask me if you have any questions. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 02:35:56 2011 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 F342E106564A; Thu, 23 Jun 2011 02:35:55 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E33A88FC0A; Thu, 23 Jun 2011 02:35: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 p5N2ZtGk079159; Thu, 23 Jun 2011 02:35:55 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2ZtMV079157; Thu, 23 Jun 2011 02:35:55 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106230235.p5N2ZtMV079157@svn.freebsd.org> From: Hiroki Sato Date: Thu, 23 Jun 2011 02:35: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: r223457 - head/release/doc/en_US.ISO8859-1/readme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 02:35:56 -0000 Author: hrs Date: Thu Jun 23 02:35:55 2011 New Revision: 223457 URL: http://svn.freebsd.org/changeset/base/223457 Log: Remove links to mirrorlist.FreeBSD.org. Submitted by: ryusuke Reported by: gavin, brucec Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml Modified: head/release/doc/en_US.ISO8859-1/readme/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/readme/article.sgml Thu Jun 23 00:36:49 2011 (r223456) +++ head/release/doc/en_US.ISO8859-1/readme/article.sgml Thu Jun 23 02:35:55 2011 (r223457) @@ -184,8 +184,7 @@ Lists of locations that mirror &os; can be found in the FTP - Sites section of the Handbook, or on the Web pages. + Sites section of the Handbook. Finding a close (in networking terms) mirror from which to download the distribution is highly recommended. From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 02:36:10 2011 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 D096C10656F4; Thu, 23 Jun 2011 02:36:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4BEC48FC12; Thu, 23 Jun 2011 02:36:08 +0000 (UTC) Received: by gwb15 with SMTP id 15so754554gwb.13 for ; Wed, 22 Jun 2011 19:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=La4YNxGzvvIOAwBorC6hqaSTBuXHlWan1heeEaumuyw=; b=H9K/SDoA4wpjQTKKSCT4716iDoNnh4GrRlJpjl0oPo6HN28t8NyVNew8k6nsqpmsGU 8XoFffThEXvHbgS9IF0alN0nx/3m41WlukeshiqNWO0k+r9LtiuvqfQbSkLj2ATwd3po b3VWCAUIvnvG5V8plYrNLKJO/DE2lRLXhdo/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=i2h/Mkf8rzZtVXf8aFiuJ3EOgxLdAD91IkWwupEd0D5DhOk3QVZJ9MOodafwgbpcvo n1MTdmpZ36LBS2n3zpIt/4rLDZn4QqblvzpPy7L3TfhFmjjcSgw7/Y/omdeKR8BOxYAp I60avgGFEPwfeLJJMG838r4tjf7DxvpIqlA0w= MIME-Version: 1.0 Received: by 10.150.193.12 with SMTP id q12mr1655142ybf.9.1308796566697; Wed, 22 Jun 2011 19:36:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.146.13 with HTTP; Wed, 22 Jun 2011 19:36:06 -0700 (PDT) In-Reply-To: <201106191913.p5JJDOqJ006272@svn.freebsd.org> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> Date: Thu, 23 Jun 2011 10:36:06 +0800 X-Google-Sender-Auth: mtYCobb0R7g5VS_C3JuVqwMfNQk Message-ID: From: Adrian Chadd To: Alan Cox 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 Subject: Re: svn commit: r223307 - 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, 23 Jun 2011 02:36:10 -0000 Can this commit please be reverted whilst the kinks are worked out for MIPS= ? I'm currently knee deep in MIPS related hackery and I'd rather stay on an unpatched -HEAD so dogfood can be properly self-consumed. Thanks, Adrian On 20 June 2011 03:13, Alan Cox wrote: > Author: alc > Date: Sun Jun 19 19:13:24 2011 > New Revision: 223307 > URL: http://svn.freebsd.org/changeset/base/223307 > > Log: > =A0Precisely document the synchronization rules for the page's dirty fiel= d. > =A0(Saying that the lock on the object that the page belongs to must be h= eld > =A0only represents one aspect of the rules.) > > =A0Eliminate the use of the page queues lock for atomically performing re= ad- > =A0modify-write operations on the dirty field when the underlying archite= cture > =A0supports atomic operations on char and short types. > > =A0Document the fact that 32KB pages aren't really supported. > > =A0Reviewed by: =A0attilio, kib > > Modified: > =A0head/sys/vm/vm_fault.c > =A0head/sys/vm/vm_page.c > =A0head/sys/vm/vm_page.h > > Modified: head/sys/vm/vm_fault.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/sys/vm/vm_fault.c =A0 =A0 =A0Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_fault.c =A0 =A0 =A0Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * caller's changes may go= unnoticed because they are > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * performed through an un= managed mapping or by a DMA > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 * operation. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* The object lock is not= held here. =A0Therefore, like > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* a pmap operation, the = page queues lock may be > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* required in order to c= all vm_page_dirty(). =A0See > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* vm_page_clear_dirty_ma= sk(). > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + =A0 =A0defined(__mips__) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 vm_page_dirty(*mp); > +#else > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_lock_queues(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_dirty(*mp); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_unlock_queues(); > +#endif > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (pmap_failed) { > > Modified: head/sys/vm/vm_page.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/sys/vm/vm_page.c =A0 =A0 =A0 Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_page.c =A0 =A0 =A0 Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *m > =A0/* > =A0* =A0 =A0 vm_page_dirty: > =A0* > - * =A0 =A0 make page all dirty > + * =A0 =A0 Set all bits in the page's dirty field. > + * > + * =A0 =A0 The object containing the specified page must be locked if th= e call is > + * =A0 =A0 made from the machine-independent layer. =A0If, however, the = call is > + * =A0 =A0 made from the pmap layer, then the page queues lock may be re= quired. > + * =A0 =A0 See vm_page_clear_dirty_mask(). > =A0*/ > =A0void > =A0vm_page_dirty(vm_page_t m) > @@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, in > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * If the object is locked and the page is neither VPO_BUS= Y nor > =A0 =A0 =A0 =A0 * PG_WRITEABLE, then the page's dirty field cannot possib= ly be > - =A0 =A0 =A0 =A0* modified by a concurrent pmap operation. > + =A0 =A0 =A0 =A0* set by a concurrent pmap operation. > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); > =A0 =A0 =A0 =A0if ((m->oflags & VPO_BUSY) =3D=3D 0 && (m->flags & PG_WRIT= EABLE) =3D=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m->dirty &=3D ~pagebits; > =A0 =A0 =A0 =A0else { > +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ > + =A0 =A0defined(__mips__) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* On the aforementioned architectures, t= he page queues lock > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* is not required by the following read-= modify-write > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* operation. =A0The combination of the o= bject's lock and an > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* atomic operation suffice. =A0Moreover,= the pmap layer on > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* these architectures can call vm_page_d= irty() without > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* holding the page queues lock. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > +#if PAGE_SIZE =3D=3D 4096 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_char(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 8192 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_short(&m->dirty, pagebits); > +#elif PAGE_SIZE =3D=3D 16384 > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 atomic_clear_int(&m->dirty, pagebits); > +#else > +#error "PAGE_SIZE is not supported." > +#endif > +#else > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Otherwise, the page queues lock is req= uired to ensure that > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* a concurrent pmap operation does not s= et the page's dirty > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* field during the following read-modify= -write operation. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_lock_queues(); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0m->dirty &=3D ~pagebits; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vm_page_unlock_queues(); > +#endif > =A0 =A0 =A0 =A0} > =A0} > > > Modified: head/sys/vm/vm_page.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/sys/vm/vm_page.h =A0 =A0 =A0 Sun Jun 19 18:34:49 2011 =A0 =A0 = =A0 =A0(r223306) > +++ head/sys/vm/vm_page.h =A0 =A0 =A0 Sun Jun 19 19:13:24 2011 =A0 =A0 = =A0 =A0(r223307) > @@ -89,10 +89,26 @@ > =A0* =A0 =A0 and offset to which this page belongs (for pageout), > =A0* =A0 =A0 and sundry status bits. > =A0* > - * =A0 =A0 Fields in this structure are locked either by the lock on the > - * =A0 =A0 object that the page belongs to (O), its corresponding page l= ock (P), > - * =A0 =A0 or by the lock on the page queues (Q). > - * > + * =A0 =A0 In general, operations on this structure's mutable fields are > + * =A0 =A0 synchronized using either one of or a combination of the lock= on the > + * =A0 =A0 object that the page belongs to (O), the pool lock for the pa= ge (P), > + * =A0 =A0 or the lock for either the free or paging queues (Q). =A0If a= field is > + * =A0 =A0 annotated below with two of these locks, then holding either = lock is > + * =A0 =A0 sufficient for read access, but both locks are required for w= rite > + * =A0 =A0 access. > + * > + * =A0 =A0 In contrast, the synchronization of accesses to the page's di= rty field > + * =A0 =A0 is machine dependent (M). =A0In the machine-independent layer= , the lock > + * =A0 =A0 on the object that the page belongs to must be held in order = to > + * =A0 =A0 operate on the field. =A0However, the pmap layer is permitted= to set > + * =A0 =A0 all bits within the field without holding that lock. =A0There= fore, if > + * =A0 =A0 the underlying architecture does not support atomic read-modi= fy-write > + * =A0 =A0 operations on the field's type, then the machine-independent = layer > + * =A0 =A0 must also hold the page queues lock when performing read-modi= fy-write > + * =A0 =A0 operations and the pmap layer must hold the page queues lock = when > + * =A0 =A0 setting the field. =A0In the machine-independent layer, the > + * =A0 =A0 implementation of read-modify-write operations on the field i= s > + * =A0 =A0 encapsulated in vm_page_clear_dirty_mask(). > =A0*/ > > =A0TAILQ_HEAD(pglist, vm_page); > @@ -120,18 +136,19 @@ struct vm_page { > =A0 =A0 =A0 =A0u_char =A0busy; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* pag= e busy count (O) */ > =A0 =A0 =A0 =A0/* NOTE that these must support one bit per DEV_BSIZE in a= page!!! */ > =A0 =A0 =A0 =A0/* so, on normal X86 kernels, they must be at least 8 bits= wide */ > + =A0 =A0 =A0 /* In reality, support for 32KB pages is not fully implemen= ted. */ > =A0#if PAGE_SIZE =3D=3D 4096 > =A0 =A0 =A0 =A0u_char =A0valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map= of valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_char =A0dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_char =A0dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 8192 > =A0 =A0 =A0 =A0u_short valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map o= f valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_short dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map of= dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_short dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map of= dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 16384 > =A0 =A0 =A0 =A0u_int valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map= of valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_int dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_int dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* map = of dirty DEV_BSIZE chunks (M) */ > =A0#elif PAGE_SIZE =3D=3D 32768 > =A0 =A0 =A0 =A0u_long valid; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map o= f valid DEV_BSIZE chunks (O) */ > - =A0 =A0 =A0 u_long dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map of= dirty DEV_BSIZE chunks (O) */ > + =A0 =A0 =A0 u_long dirty; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* map of= dirty DEV_BSIZE chunks (M) */ > =A0#endif > =A0}; > > From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 02:38:06 2011 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 AD5D5106566C; Thu, 23 Jun 2011 02:38:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D9748FC15; Thu, 23 Jun 2011 02:38: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 p5N2c6RE079259; Thu, 23 Jun 2011 02:38:06 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2c6ac079257; Thu, 23 Jun 2011 02:38:06 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201106230238.p5N2c6ac079257@svn.freebsd.org> From: Hiroki Sato Date: Thu, 23 Jun 2011 02:38: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: r223458 - head/release/doc/share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 02:38:06 -0000 Author: hrs Date: Thu Jun 23 02:38:06 2011 New Revision: 223458 URL: http://svn.freebsd.org/changeset/base/223458 Log: Bump &release.manpath.*;. Modified: head/release/doc/share/sgml/release.ent Modified: head/release/doc/share/sgml/release.ent ============================================================================== --- head/release/doc/share/sgml/release.ent Thu Jun 23 02:35:55 2011 (r223457) +++ head/release/doc/share/sgml/release.ent Thu Jun 23 02:38:06 2011 (r223458) @@ -36,8 +36,8 @@ - - + + From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 02:38:37 2011 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 480261065670; Thu, 23 Jun 2011 02:38:37 +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 35ED88FC0A; Thu, 23 Jun 2011 02:38: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 p5N2cbgO079322; Thu, 23 Jun 2011 02:38:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N2cajT079306; Thu, 23 Jun 2011 02:38:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230238.p5N2cajT079306@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 02:38: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: r223459 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 02:38:37 -0000 Author: adrian Date: Thu Jun 23 02:38:36 2011 New Revision: 223459 URL: http://svn.freebsd.org/changeset/base/223459 Log: Break out most of the HAL related tweaks into a per-HAL instance, rather than global variables. This specifically allows for debugging to be enabled per-NIC, rather than globally. Since the ath driver doesn't know about AH_DEBUG, and to keep the ABI consistent regardless of whether AH_DEBUG is enabled or not, enable the debug parameter always but only conditionally compile in the debug methods if needed. The ALQ support is currently still global pending some brainstorming. Submitted by: ssgriffonuser@gmail.com Reviewed by: adrian, bschmidt Modified: head/sys/dev/ath/ah_osdep.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_sysctl.h Modified: head/sys/dev/ath/ah_osdep.c ============================================================================== --- head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ah_osdep.c Thu Jun 23 02:38:36 2011 (r223459) @@ -76,33 +76,6 @@ extern void DO_HALDEBUG(struct ath_hal * /* NB: put this here instead of the driver to avoid circular references */ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_RD, 0, "Atheros driver parameters"); -SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); - -#ifdef AH_DEBUG -int ath_hal_debug = 0; -SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug, - 0, "Atheros HAL debugging printfs"); -TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug); -#endif /* AH_DEBUG */ - -int ath_hal_ar5416_biasadj = 0; -SYSCTL_INT(_hw_ath_hal, OID_AUTO, ar5416_biasadj, CTLFLAG_RW, - &ath_hal_ar5416_biasadj, 0, "Enable 2ghz AR5416 direction sensitivity" - " bias adjust"); - -/* NB: these are deprecated; they exist for now for compatibility */ -int ath_hal_dma_beacon_response_time = 2; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, dma_brt, CTLFLAG_RW, - &ath_hal_dma_beacon_response_time, 0, - "Atheros HAL DMA beacon response time"); -int ath_hal_sw_beacon_response_time = 10; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, sw_brt, CTLFLAG_RW, - &ath_hal_sw_beacon_response_time, 0, - "Atheros HAL software beacon response time"); -int ath_hal_additional_swba_backoff = 0; /* in TU's */ -SYSCTL_INT(_hw_ath_hal, OID_AUTO, swba_backoff, CTLFLAG_RW, - &ath_hal_additional_swba_backoff, 0, - "Atheros HAL additional SWBA backoff time"); MALLOC_DEFINE(M_ATH_HAL, "ath_hal", "ath hal data"); @@ -146,7 +119,7 @@ ath_hal_ether_sprintf(const u_int8_t *ma void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...) { - if ((mask == HAL_DEBUG_UNMASKABLE) || (ath_hal_debug & mask)) { + if ((mask == HAL_DEBUG_UNMASKABLE) || (ah->ah_config.ah_debug & mask)) { __va_list ap; va_start(ap, fmt); ath_hal_vprintf(ah, fmt, ap); @@ -174,6 +147,8 @@ DO_HALDEBUG(struct ath_hal *ah, u_int ma #include #include +SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters"); + static struct alq *ath_hal_alq; static int ath_hal_alq_emitdev; /* need to emit DEVICE record */ static u_int ath_hal_alq_lost; /* count of lost records */ Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jun 23 02:38:36 2011 (r223459) @@ -756,6 +756,17 @@ struct dfs_event { }; typedef struct dfs_event HAL_DFS_EVENT; +typedef struct +{ + int ah_debug; /* only used if AH_DEBUG is defined */ + int ah_ar5416_biasadj; /* enable AR2133 radio specific bias fiddling */ + + /* NB: these are deprecated; they exist for now for compatibility */ + int ah_dma_beacon_response_time;/* in TU's */ + int ah_sw_beacon_response_time; /* in TU's */ + int ah_additional_swba_backoff; /* in TU's */ +}HAL_OPS_CONFIG; + /* * Hardware Access Layer (HAL) API. * @@ -784,6 +795,7 @@ struct ath_hal { uint16_t *ah_eepromdata; /* eeprom buffer, if needed */ + HAL_OPS_CONFIG ah_config; const HAL_RATE_TABLE *__ahdecl(*ah_getRateTable)(struct ath_hal *, u_int mode); void __ahdecl(*ah_detach)(struct ath_hal*); Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 02:38:36 2011 (r223459) @@ -475,12 +475,6 @@ isBigEndian(void) #define OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \ do { OS_REG_WRITE(_a, _r, (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ; OS_DELAY(100); } while (0) -/* system-configurable parameters */ -extern int ath_hal_dma_beacon_response_time; /* in TU's */ -extern int ath_hal_sw_beacon_response_time; /* in TU's */ -extern int ath_hal_additional_swba_backoff; /* in TU's */ -extern int ath_hal_ar5416_biasadj; /* 1 or 0 */ - /* wait for the register contents to have the specified value */ extern HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg, uint32_t mask, uint32_t val); @@ -504,11 +498,10 @@ extern void ath_hal_free(void *); /* common debugging interfaces */ #ifdef AH_DEBUG #include "ah_debug.h" -extern int ath_hal_debug; #define HALDEBUG(_ah, __m, ...) \ do { \ if ((__m) == HAL_DEBUG_UNMASKABLE || \ - (ath_hal_debug & (__m))) { \ + ((_ah != AH_NULL) && (((struct ath_hal*)_ah)->ah_config.ah_debug & (__m)))) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -56,9 +56,9 @@ ar5210BeaconInit(struct ath_hal *ah, if (AH_PRIVATE(ah)->ah_opmode != HAL_M_STA) { bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ /* * The SWBA interrupt is not used for beacons in ad hoc mode * as we don't yet support ATIMs. So since the beacon never Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -71,9 +71,9 @@ ar5211BeaconInit(struct ath_hal *ah, case HAL_M_IBSS: case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -345,8 +345,9 @@ ar5211ResetTxQueue(struct ath_hal *ah, u | AR_Q_MISC_CBR_INCR_DIS0 | AR_Q_MISC_RDYTIME_EXP_POLICY); value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time + - ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_EN); /* Configure DCU for CAB */ Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -84,9 +84,9 @@ ar5212BeaconInit(struct ath_hal *ah, case HAL_M_HOSTAP: case HAL_M_IBSS: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -416,9 +416,9 @@ ar5212ResetTxQueue(struct ath_hal *ah, u * here solely for backwards compatibility. */ value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time - + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Thu Jun 23 02:38:36 2011 (r223459) @@ -185,7 +185,7 @@ ar2133SetChannel(struct ath_hal *ah, con } /* Workaround for hw bug - AR5416 specific */ - if (AR_SREV_OWL(ah) && ath_hal_ar5416_biasadj) + if (AR_SREV_OWL(ah) && ah->ah_config.ah_ar5416_biasadj) ar2133ForceBias(ah, freq); reg32 = (channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) | Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 02:38:36 2011 (r223459) @@ -93,9 +93,9 @@ ar5416BeaconInit(struct ath_hal *ah, /* fall thru... */ case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ath_hal_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ath_hal_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_flags |= AR_TIMER_MODE_TBTT | AR_TIMER_MODE_DBA | AR_TIMER_MODE_SWBA; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jun 23 02:38:36 2011 (r223459) @@ -288,7 +288,7 @@ ar5416SetQuiet(struct ath_hal *ah, uint3 nextStart_us += OS_REG_READ(ah, AR_TSF_L32); } if (flag & HAL_QUIET_ADD_SWBA_RESP_TIME) { - nextStart_us += ath_hal_sw_beacon_response_time; + nextStart_us += ah->ah_config.ah_sw_beacon_response_time; } OS_REG_RMW_FIELD(ah, AR_QUIET1, AR_QUIET1_QUIET_ACK_CTS_ENABLE, 1); OS_REG_WRITE(ah, AR_QUIET2, SM(duration, AR_QUIET2_QUIET_DUR)); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Thu Jun 23 02:38:36 2011 (r223459) @@ -1035,9 +1035,9 @@ ar5416ResetTxQueue(struct ath_hal *ah, u * here solely for backwards compatibility. */ value = (ahp->ah_beaconInterval - - (ath_hal_sw_beacon_response_time - - ath_hal_dma_beacon_response_time) - - ath_hal_additional_swba_backoff) * 1024; + - (ah->ah_config.ah_sw_beacon_response_time - + ah->ah_config.ah_dma_beacon_response_time) + - ah->ah_config.ah_additional_swba_backoff) * 1024; OS_REG_WRITE(ah, AR_QRDYTIMECFG(q), value | AR_Q_RDYTIMECFG_ENA); } dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath.c Thu Jun 23 02:38:36 2011 (r223459) @@ -738,6 +738,7 @@ ath_attach(u_int16_t devid, struct ath_s */ ath_sysctlattach(sc); ath_sysctl_stats_attach(sc); + ath_sysctl_hal_attach(sc); if (bootverbose) ieee80211_announce(ic); Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath_sysctl.c Thu Jun 23 02:38:36 2011 (r223459) @@ -719,3 +719,43 @@ ath_sysctl_stats_attach(struct ath_softc /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); } + +/* + * This doesn't necessarily belong here (because it's HAL related, not + * driver related). + */ +void +ath_sysctl_hal_attach(struct ath_softc *sc) +{ + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hal", CTLFLAG_RD, + NULL, "Atheros HAL parameters"); + child = SYSCTL_CHILDREN(tree); + + sc->sc_ah->ah_config.ah_debug = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "debug", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_debug, 0, "Atheros HAL debugging printfs"); + + sc->sc_ah->ah_config.ah_ar5416_biasadj = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "ar5416_biasadj", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_ar5416_biasadj, 0, + "Enable 2ghz AR5416 direction sensitivity bias adjust"); + + sc->sc_ah->ah_config.ah_dma_beacon_response_time = 2; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "dma_brt", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_dma_beacon_response_time, 0, + "Atheros HAL DMA beacon response time"); + + sc->sc_ah->ah_config.ah_sw_beacon_response_time = 10; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sw_brt", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_sw_beacon_response_time, 0, + "Atheros HAL software beacon response time"); + + sc->sc_ah->ah_config.ah_additional_swba_backoff = 0; + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "swba_backoff", CTLFLAG_RW, + &sc->sc_ah->ah_config.ah_additional_swba_backoff, 0, + "Atheros HAL additional SWBA backoff time"); +} Modified: head/sys/dev/ath/if_ath_sysctl.h ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.h Thu Jun 23 02:38:06 2011 (r223458) +++ head/sys/dev/ath/if_ath_sysctl.h Thu Jun 23 02:38:36 2011 (r223459) @@ -34,5 +34,5 @@ extern void ath_sysctlattach(struct ath_softc *); extern void ath_sysctl_stats_attach(struct ath_softc *sc); - +extern void ath_sysctl_hal_attach(struct ath_softc *sc); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 03:20:12 2011 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 4BC7F1065673; Thu, 23 Jun 2011 03:20:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2289C8FC14; Thu, 23 Jun 2011 03:20: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 p5N3KCnn080814; Thu, 23 Jun 2011 03:20:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N3KCGn080811; Thu, 23 Jun 2011 03:20:12 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230320.p5N3KCGn080811@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 03:20: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: r223460 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 03:20:12 -0000 Author: nwhitehorn Date: Thu Jun 23 03:20:11 2011 New Revision: 223460 URL: http://svn.freebsd.org/changeset/base/223460 Log: Add hypervisor call error codes. Modified: head/sys/powerpc/ps3/ps3-hvcall.h head/sys/powerpc/ps3/ps3-hvcall.master Modified: head/sys/powerpc/ps3/ps3-hvcall.h ============================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.h Thu Jun 23 02:38:36 2011 (r223459) +++ head/sys/powerpc/ps3/ps3-hvcall.h Thu Jun 23 03:20:11 2011 (r223460) @@ -11,6 +11,34 @@ enum lpar_id { PS3_LPAR_ID_PME = 0x01, }; +/* Return codes from hypercalls */ +#define LV1_SUCCESS 0 +#define LV1_RESOURCE_SHORTAGE -2 +#define LV1_NO_PRIVILEGE -3 +#define LV1_DENIED_BY_POLICY -4 +#define LV1_ACCESS_VIOLATION -5 +#define LV1_NO_ENTRY -6 +#define LV1_DUPLICATE_ENTRY -7 +#define LV1_TYPE_MISMATCH -8 +#define LV1_BUSY -9 +#define LV1_EMPTY -10 +#define LV1_WRONG_STATE -11 +#define LV1_NO_MATCH -13 +#define LV1_ALREADY_CONNECTED -14 +#define LV1_UNSUPPORTED_PARAMETER_VALUE -15 +#define LV1_CONDITION_NOT_SATISFIED -16 +#define LV1_ILLEGAL_PARAMETER_VALUE -17 +#define LV1_BAD_OPTION -18 +#define LV1_IMPLEMENTATION_LIMITATION -19 +#define LV1_NOT_IMPLEMENTED -20 +#define LV1_INVALID_CLASS_ID -21 +#define LV1_CONSTRAINT_NOT_SATISFIED -22 +#define LV1_ALIGNMENT_ERROR -23 +#define LV1_HARDWARE_ERROR -24 +#define LV1_INVALID_DATA_FORMAT -25 +#define LV1_INVALID_OPERATION -26 +#define LV1_INTERNAL_ERROR -32768 + static inline uint64_t lv1_repository_string(const char *str) { Modified: head/sys/powerpc/ps3/ps3-hvcall.master ============================================================================== --- head/sys/powerpc/ps3/ps3-hvcall.master Thu Jun 23 02:38:36 2011 (r223459) +++ head/sys/powerpc/ps3/ps3-hvcall.master Thu Jun 23 03:20:11 2011 (r223460) @@ -11,6 +11,34 @@ enum lpar_id { PS3_LPAR_ID_PME = 0x01, }; +/* Return codes from hypercalls */ +#define LV1_SUCCESS 0 +#define LV1_RESOURCE_SHORTAGE -2 +#define LV1_NO_PRIVILEGE -3 +#define LV1_DENIED_BY_POLICY -4 +#define LV1_ACCESS_VIOLATION -5 +#define LV1_NO_ENTRY -6 +#define LV1_DUPLICATE_ENTRY -7 +#define LV1_TYPE_MISMATCH -8 +#define LV1_BUSY -9 +#define LV1_EMPTY -10 +#define LV1_WRONG_STATE -11 +#define LV1_NO_MATCH -13 +#define LV1_ALREADY_CONNECTED -14 +#define LV1_UNSUPPORTED_PARAMETER_VALUE -15 +#define LV1_CONDITION_NOT_SATISFIED -16 +#define LV1_ILLEGAL_PARAMETER_VALUE -17 +#define LV1_BAD_OPTION -18 +#define LV1_IMPLEMENTATION_LIMITATION -19 +#define LV1_NOT_IMPLEMENTED -20 +#define LV1_INVALID_CLASS_ID -21 +#define LV1_CONSTRAINT_NOT_SATISFIED -22 +#define LV1_ALIGNMENT_ERROR -23 +#define LV1_HARDWARE_ERROR -24 +#define LV1_INVALID_DATA_FORMAT -25 +#define LV1_INVALID_OPERATION -26 +#define LV1_INTERNAL_ERROR -32768 + static inline uint64_t lv1_repository_string(const char *str) { From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 03:37:25 2011 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 96F66106564A; Thu, 23 Jun 2011 03:37:25 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85D628FC0A; Thu, 23 Jun 2011 03:37: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 p5N3bPif081340; Thu, 23 Jun 2011 03:37:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N3bP17081338; Thu, 23 Jun 2011 03:37:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230337.p5N3bP17081338@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 03:37: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: r223461 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 03:37:25 -0000 Author: nwhitehorn Date: Thu Jun 23 03:37:25 2011 New Revision: 223461 URL: http://svn.freebsd.org/changeset/base/223461 Log: Rework the PS3 disk driver to support NCQ and do its DMA a little differently. Modified: head/sys/powerpc/ps3/ps3disk.c Modified: head/sys/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/powerpc/ps3/ps3disk.c Thu Jun 23 03:20:11 2011 (r223460) +++ head/sys/powerpc/ps3/ps3disk.c Thu Jun 23 03:37:25 2011 (r223461) @@ -116,39 +116,25 @@ struct ps3disk_softc { struct disk **sc_disk; struct bio_queue_head sc_bioq; + struct bio_queue_head sc_deferredq; + struct proc *sc_task; - struct proc *sc_task; - - int sc_bounce_maxblocks; - bus_dma_tag_t sc_bounce_dmatag; - bus_dmamap_t sc_bounce_dmamap; - bus_addr_t sc_bounce_dmaphys; - char *sc_bounce; - uint64_t sc_bounce_lpar; - int sc_bounce_busy; - uint64_t sc_bounce_tag; - uint64_t sc_bounce_status; + bus_dma_tag_t sc_dmatag; int sc_running; - int sc_debug; }; static int ps3disk_open(struct disk *dp); static int ps3disk_close(struct disk *dp); static void ps3disk_strategy(struct bio *bp); -static void ps3disk_task(void *arg); -static int ps3disk_intr_filter(void *arg); +static void ps3disk_task(void *arg); static void ps3disk_intr(void *arg); -static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc); static int ps3disk_enum_regions(struct ps3disk_softc *sc); -static int ps3disk_read(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data); -static int ps3disk_write(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data); -static int ps3disk_flush(struct ps3disk_softc *sc); +static void ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, + int error); static void ps3disk_sysctlattach(struct ps3disk_softc *sc); @@ -172,6 +158,7 @@ ps3disk_attach(device_t dev) struct ps3disk_softc *sc; struct disk *d; intmax_t mb; + uint64_t junk; char unit; int i, err; @@ -205,7 +192,6 @@ ps3disk_attach(device_t dev) } /* Setup interrupt handler */ - sc->sc_irqid = 0; sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid, RF_ACTIVE); @@ -217,52 +203,24 @@ ps3disk_attach(device_t dev) err = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY, - ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx); + NULL, ps3disk_intr, sc, &sc->sc_irqctx); if (err) { device_printf(dev, "Could not setup IRQ\n"); err = ENXIO; goto fail_release_intr; } - /* Setup DMA bounce buffer */ - - sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize; - + /* Setup DMA */ err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, - sc->sc_bounce_maxblocks * sc->sc_blksize, 1, - sc->sc_bounce_maxblocks * sc->sc_blksize, - 0, NULL, NULL, &sc->sc_bounce_dmatag); + BUS_SPACE_UNRESTRICTED, 1, PAGE_SIZE, 0, + busdma_lock_mutex, &sc->sc_mtx, &sc->sc_dmatag); if (err) { - device_printf(dev, "Could not create DMA tag for bounce buffer\n"); + device_printf(dev, "Could not create DMA tag\n"); err = ENXIO; goto fail_teardown_intr; } - err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce, - BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, - &sc->sc_bounce_dmamap); - if (err) { - device_printf(dev, "Could not allocate DMA memory for bounce buffer\n"); - err = ENXIO; - goto fail_destroy_dmatag; - } - - err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize, - ps3disk_getphys, &sc->sc_bounce_dmaphys, 0); - if (err) { - device_printf(dev, "Could not load DMA map for bounce buffer\n"); - err = ENXIO; - goto fail_free_dmamem; - } - - sc->sc_bounce_lpar = vtophys(sc->sc_bounce); - - if (bootverbose) - device_printf(dev, "bounce buffer lpar address 0x%016lx\n", - sc->sc_bounce_lpar); - /* Setup disks */ sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *), @@ -270,7 +228,7 @@ ps3disk_attach(device_t dev) if (!sc->sc_disk) { device_printf(dev, "Could not allocate disk(s)\n"); err = ENOMEM; - goto fail_unload_dmamem; + goto fail_teardown_intr; } for (i = 0; i < sc->sc_nregs; i++) { @@ -282,7 +240,7 @@ ps3disk_attach(device_t dev) d->d_strategy = ps3disk_strategy; d->d_name = "ps3disk"; d->d_drv1 = sc; - d->d_maxsize = DFLTPHYS; + d->d_maxsize = PAGE_SIZE; d->d_sectorsize = sc->sc_blksize; d->d_unit = i; d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize; @@ -297,53 +255,32 @@ ps3disk_attach(device_t dev) /* Test to see if we can read this region */ err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit, - 0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag); + 0, 0, rp->r_flags, 0, &junk); device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit, - (err == 0) ? "" : " (hypervisor protected)"); + (err == LV1_DENIED_BY_POLICY) ? " (hypervisor protected)" + : ""); - if (err == 0) + if (err != LV1_DENIED_BY_POLICY) disk_create(d, DISK_VERSION); } err = 0; bioq_init(&sc->sc_bioq); + bioq_init(&sc->sc_deferredq); + kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "ps3disk"); ps3disk_sysctlattach(sc); - sc->sc_running = 1; - - kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk"); - return (0); -fail_unload_dmamem: - - bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); - -fail_free_dmamem: - - bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); - -fail_destroy_dmatag: - - bus_dma_tag_destroy(sc->sc_bounce_dmatag); - fail_teardown_intr: - bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); - fail_release_intr: - bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); - fail_free_regions: - free(sc->sc_reg, M_PS3DISK); - fail_destroy_lock: - PS3DISK_LOCK_DESTROY(sc); - return (err); } @@ -353,28 +290,15 @@ ps3disk_detach(device_t dev) struct ps3disk_softc *sc = device_get_softc(dev); int i; - PS3DISK_LOCK(sc); - sc->sc_running = 0; - wakeup(sc); - PS3DISK_UNLOCK(sc); - - PS3DISK_LOCK(sc); - while (sc->sc_running != -1) - msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0); - PS3DISK_UNLOCK(sc); - for (i = 0; i < sc->sc_nregs; i++) disk_destroy(sc->sc_disk[i]); - bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap); - bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap); - bus_dma_tag_destroy(sc->sc_bounce_dmatag); + bus_dma_tag_destroy(sc->sc_dmatag); bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq); free(sc->sc_disk, M_PS3DISK); - free(sc->sc_reg, M_PS3DISK); PS3DISK_LOCK_DESTROY(sc); @@ -394,127 +318,94 @@ ps3disk_close(struct disk *dp) return (0); } -static void -ps3disk_strategy(struct bio *bp) -{ - struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1; - - if (!sc) { - bp->bio_flags |= BIO_ERROR; - bp->bio_error = EINVAL; - biodone(bp); - return; - } - - PS3DISK_LOCK(sc); - bioq_disksort(&sc->sc_bioq, bp); - if (!sc->sc_bounce_busy) - wakeup(sc); - PS3DISK_UNLOCK(sc); -} - +/* Process deferred blocks */ static void ps3disk_task(void *arg) { struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; struct bio *bp; - daddr_t block, end; - u_long nblocks; - char *data; - int err; - while (sc->sc_running) { + + while (1) { + kproc_suspend_check(sc->sc_task); + tsleep(&sc->sc_deferredq, PRIBIO, "ps3disk", 10); + PS3DISK_LOCK(sc); - do { - bp = bioq_first(&sc->sc_bioq); - if (bp == NULL) - msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); - } while (bp == NULL && sc->sc_running); - if (bp) - bioq_remove(&sc->sc_bioq, bp); + bp = bioq_takefirst(&sc->sc_deferredq); PS3DISK_UNLOCK(sc); - if (!sc->sc_running) - break; + if (bp == NULL) + continue; - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", - __func__, bp->bio_cmd); + if (bp->bio_driver1 != NULL) { + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + } - if (bp->bio_cmd == BIO_FLUSH) { - err = ps3disk_flush(sc); + ps3disk_strategy(bp); + } - if (err) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_error = 0; - bp->bio_flags |= BIO_DONE; - } - } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize); + kproc_exit(0); +} - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n", - __func__, bp->bio_pblkno, bp->bio_bcount); +static void +ps3disk_strategy(struct bio *bp) +{ + struct ps3disk_softc *sc = (struct ps3disk_softc *)bp->bio_disk->d_drv1; + int err; - for (block = bp->bio_pblkno; block < end;) { - data = bp->bio_data + - (block - bp->bio_pblkno) * sc->sc_blksize; - - nblocks = end - block; - if (nblocks > sc->sc_bounce_maxblocks) - nblocks = sc->sc_bounce_maxblocks; - - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n", - __func__, nblocks); - - if (bp->bio_cmd == BIO_READ) { - err = ps3disk_read(sc, bp->bio_disk->d_unit, - block, nblocks, data); - } else { - err = ps3disk_write(sc, bp->bio_disk->d_unit, - block, nblocks, data); - } - - if (err) - break; + if (sc == NULL) { + bp->bio_flags |= BIO_ERROR; + bp->bio_error = EINVAL; + biodone(bp); + return; + } - block += nblocks; - } + PS3DISK_LOCK(sc); + bp->bio_resid = bp->bio_bcount; + bioq_insert_tail(&sc->sc_bioq, bp); - bp->bio_resid = (end - block) * sc->sc_blksize; - if (bp->bio_resid) { - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - } else { - bp->bio_error = 0; - bp->bio_flags |= BIO_DONE; - } + DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n", + __func__, bp->bio_cmd); - DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n", - __func__, bp->bio_resid); + err = 0; + if (bp->bio_cmd == BIO_FLUSH) { + bp->bio_driver1 = 0; + err = lv1_storage_send_device_command( + ps3bus_get_device(sc->sc_dev), LV1_STORAGE_ATA_HDDOUT, + 0, 0, 0, 0, (uint64_t *)&bp->bio_driver2); + if (err == LV1_BUSY) + err = EAGAIN; + } else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { + if (bp->bio_bcount % sc->sc_blksize != 0) { + err = EINVAL; } else { - bp->bio_error = EINVAL; - bp->bio_flags |= BIO_ERROR; + bus_dmamap_create(sc->sc_dmatag, BUS_DMA_COHERENT, + (bus_dmamap_t *)(&bp->bio_driver1)); + err = bus_dmamap_load(sc->sc_dmatag, + (bus_dmamap_t)(bp->bio_driver1), bp->bio_data, + bp->bio_bcount, ps3disk_transfer, bp, 0); + if (err == EINPROGRESS) + err = 0; } + } else { + err = EINVAL; + } - if (bp->bio_flags & BIO_ERROR) - disk_err(bp, "hard error", -1, 1); - + if (err == EAGAIN) { + bioq_remove(&sc->sc_bioq, bp); + bioq_insert_tail(&sc->sc_deferredq, bp); + } else if (err != 0) { + bp->bio_error = err; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + disk_err(bp, "hard error", -1, 1); biodone(bp); } - PS3DISK_LOCK(sc); - sc->sc_running = -1; - wakeup(sc); PS3DISK_UNLOCK(sc); - - kproc_exit(0); -} - -static int -ps3disk_intr_filter(void *arg) -{ - return (FILTER_SCHEDULE_THREAD); } static void @@ -523,50 +414,55 @@ ps3disk_intr(void *arg) struct ps3disk_softc *sc = (struct ps3disk_softc *) arg; device_t dev = sc->sc_dev; uint64_t devid = ps3bus_get_device(dev); + struct bio *bp; uint64_t tag, status; - int err; + if (lv1_storage_get_async_status(devid, &tag, &status) != 0) + return; + PS3DISK_LOCK(sc); - err = lv1_storage_get_async_status(devid, &tag, &status); + DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: tag 0x%016lx " + "status 0x%016lx\n", __func__, tag, status); - DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n", - __func__, err, tag, status); + /* Locate the matching request */ + TAILQ_FOREACH(bp, &sc->sc_bioq.queue, bio_queue) { + if ((uint64_t)bp->bio_driver2 != tag) + continue; + + if (status != 0) { + device_printf(sc->sc_dev, "%s error (%#lx)\n", + (bp->bio_cmd == BIO_READ) ? "Read" : "Write", + status); + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_error = 0; + bp->bio_resid = 0; + bp->bio_flags |= BIO_DONE; + } - if (err) - goto out; + if (bp->bio_driver1 != NULL) { + if (bp->bio_cmd == BIO_READ) + bus_dmamap_sync(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + } - if (!sc->sc_bounce_busy) { - device_printf(dev, "Got interrupt while no request pending\n"); - goto out; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + break; } - if (tag != sc->sc_bounce_tag) - device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n", - tag, sc->sc_bounce_tag); - - if (status) - device_printf(dev, "Request completed with status 0x%016lx\n", status); - - sc->sc_bounce_status = status; - sc->sc_bounce_busy = 0; - - wakeup(sc); - -out: + if (bioq_first(&sc->sc_deferredq) != NULL) + wakeup(&sc->sc_deferredq); PS3DISK_UNLOCK(sc); } -static void -ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - - *(bus_addr_t *) arg = segs[0].ds_addr; -} - static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc) { @@ -582,8 +478,7 @@ ps3disk_get_disk_geometry(struct ps3disk lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk); if (err) { device_printf(dev, "Could not get block size (0x%08x)\n", err); - err = ENXIO; - goto out; + return (ENXIO); } err = lv1_get_repository_node_value(PS3_LPAR_ID_PME, @@ -591,16 +486,11 @@ ps3disk_get_disk_geometry(struct ps3disk lv1_repository_string("dev") | dev_index, lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk); if (err) { - device_printf(dev, "Could not get total number of blocks (0x%08x)\n", - err); + device_printf(dev, "Could not get total number of blocks " + "(0x%08x)\n", err); err = ENXIO; - goto out; } - err = 0; - -out: - return (err); } @@ -655,10 +545,11 @@ ps3disk_enum_regions(struct ps3disk_soft (lv1_repository_string("bus") >> 32) | bus_index, lv1_repository_string("dev") | dev_index, lv1_repository_string("region") | i, - lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk); + lv1_repository_string("start"), &sc->sc_reg[i].r_start, + &junk); if (err) { - device_printf(dev, "Could not get region start (0x%08x)\n", - err); + device_printf(dev, "Could not get region start " + "(0x%08x)\n", err); err = ENXIO; goto fail; } @@ -667,16 +558,16 @@ ps3disk_enum_regions(struct ps3disk_soft (lv1_repository_string("bus") >> 32) | bus_index, lv1_repository_string("dev") | dev_index, lv1_repository_string("region") | i, - lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk); + lv1_repository_string("size"), &sc->sc_reg[i].r_size, + &junk); if (err) { - device_printf(dev, "Could not get region size (0x%08x)\n", - err); + device_printf(dev, "Could not get region size " + "(0x%08x)\n", err); err = ENXIO; goto fail; } if (i == 0) - /* disables HV access control and grants access to whole disk */ sc->sc_reg[i].r_flags = 0x2; else sc->sc_reg[i].r_flags = 0; @@ -693,160 +584,70 @@ fail: return (err); } -static int -ps3disk_read(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data) -{ - device_t dev = sc->sc_dev; - struct ps3disk_region *rp = &sc->sc_reg[regidx]; - uint64_t devid = ps3bus_get_device(dev); - int err; - - PS3DISK_LOCK(sc); - - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; - } - - sc->sc_bounce_busy = 1; - - err = lv1_storage_read(devid, rp->r_id, - start_sector, sector_count, rp->r_flags, - sc->sc_bounce_lpar, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not read sectors (0x%08x)\n", err); - err = EIO; - goto out; - } - - DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); - - err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz); - if (err) { - device_printf(dev, "Read request timed out\n"); - err = EIO; - goto out; - } - - if (sc->sc_bounce_busy || sc->sc_bounce_status) { - err = EIO; - } else { - bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - BUS_DMASYNC_POSTREAD); - memcpy(data, sc->sc_bounce, sector_count * sc->sc_blksize); - err = 0; - } - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); -} - -static int -ps3disk_write(struct ps3disk_softc *sc, int regidx, - uint64_t start_sector, uint64_t sector_count, char *data) -{ - device_t dev = sc->sc_dev; - struct ps3disk_region *rp = &sc->sc_reg[regidx]; - uint64_t devid = ps3bus_get_device(dev); - int err; - - PS3DISK_LOCK(sc); - - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; - } - - memcpy(sc->sc_bounce, data, sector_count * sc->sc_blksize); - - bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap, - BUS_DMASYNC_PREWRITE); - - sc->sc_bounce_busy = 1; - - err = lv1_storage_write(devid, rp->r_id, - start_sector, sector_count, rp->r_flags, - sc->sc_bounce_lpar, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not write sectors (0x%08x)\n", err); - err = EIO; - goto out; - } - - DPRINTF(sc, PS3DISK_DEBUG_WRITE, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); - - err = msleep(sc, &sc->sc_mtx, PRIBIO, "write", hz); - if (err) { - device_printf(dev, "Write request timed out\n"); - err = EIO; - goto out; - } - - err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0; - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); -} - -static int -ps3disk_flush(struct ps3disk_softc *sc) +static void +ps3disk_transfer(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - device_t dev = sc->sc_dev; - uint64_t devid = ps3bus_get_device(dev); - int err; + struct bio *bp = (struct bio *)(arg); + struct ps3disk_softc *sc = (struct ps3disk_softc *)bp->bio_disk->d_drv1; + struct ps3disk_region *rp = &sc->sc_reg[bp->bio_disk->d_unit]; + uint64_t devid = ps3bus_get_device(sc->sc_dev); + uint64_t block; + int i, err; - PS3DISK_LOCK(sc); + /* Locks already held by busdma */ + PS3DISK_ASSERT_LOCKED(sc); - if (sc->sc_bounce_busy) { - device_printf(dev, "busy\n"); - PS3DISK_UNLOCK(sc); - return EIO; + if (error) { + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + return; } - sc->sc_bounce_busy = 1; + block = bp->bio_pblkno; + for (i = 0; i < nsegs; i++) { + KASSERT((segs[i].ds_len % sc->sc_blksize) == 0, + ("DMA fragments not blocksize multiples")); + + if (bp->bio_cmd == BIO_READ) { + err = lv1_storage_read(devid, rp->r_id, + block, segs[i].ds_len/sc->sc_blksize, + rp->r_flags, segs[i].ds_addr, + (uint64_t *)&bp->bio_driver2); + } else { + bus_dmamap_sync(sc->sc_dmatag, + (bus_dmamap_t)bp->bio_driver1, + BUS_DMASYNC_PREWRITE); + err = lv1_storage_write(devid, rp->r_id, + block, segs[i].ds_len/sc->sc_blksize, + rp->r_flags, segs[i].ds_addr, + (uint64_t *)&bp->bio_driver2); + } - err = lv1_storage_send_device_command(devid, LV1_STORAGE_ATA_HDDOUT, - 0, 0, 0, 0, &sc->sc_bounce_tag); - if (err) { - device_printf(dev, "Could not flush (0x%08x)\n", err); - err = EIO; - goto out; - } + if (err) { + if (err == LV1_BUSY) { + bioq_remove(&sc->sc_bioq, bp); + bioq_insert_tail(&sc->sc_deferredq, bp); + } else { + bus_dmamap_unload(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + bus_dmamap_destroy(sc->sc_dmatag, (bus_dmamap_t) + bp->bio_driver1); + device_printf(sc->sc_dev, "Could not read " + "sectors (0x%08x)\n", err); + bp->bio_error = EINVAL; + bp->bio_flags |= BIO_ERROR; + bioq_remove(&sc->sc_bioq, bp); + biodone(bp); + } - DPRINTF(sc, PS3DISK_DEBUG_FLUSH, "%s: tag 0x%016lx\n", - __func__, sc->sc_bounce_tag); + break; + } - err = msleep(sc, &sc->sc_mtx, PRIBIO, "flush", hz); - if (err) { - device_printf(dev, "Flush request timed out\n"); - err = EIO; - goto out; + DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n", + __func__, sc->sc_bounce_tag); } - - err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0; - -out: - - sc->sc_bounce_busy = 0; - - PS3DISK_UNLOCK(sc); - - return (err); } #ifdef PS3DISK_DEBUG From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 04:06:33 2011 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 A21821065672; Thu, 23 Jun 2011 04:06:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 594588FC18; Thu, 23 Jun 2011 04:06: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 p5N46Xm8082196; Thu, 23 Jun 2011 04:06:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N46XFC082194; Thu, 23 Jun 2011 04:06:33 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230406.p5N46XFC082194@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 04:06: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: r223462 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 04:06:33 -0000 Author: nwhitehorn Date: Thu Jun 23 04:06:33 2011 New Revision: 223462 URL: http://svn.freebsd.org/changeset/base/223462 Log: Use 4 KB pages for storage bus devices, which seems to be what the HV uses internally. Modified: head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/ps3/ps3bus.c ============================================================================== --- head/sys/powerpc/ps3/ps3bus.c Thu Jun 23 03:37:25 2011 (r223461) +++ head/sys/powerpc/ps3/ps3bus.c Thu Jun 23 04:06:33 2011 (r223462) @@ -629,7 +629,7 @@ ps3bus_get_dma_tag(device_t dev, device_ { struct ps3bus_devinfo *dinfo = device_get_ivars(child); struct ps3bus_softc *sc = device_get_softc(dev); - int i, err, flags; + int i, err, flags, pagesize; if (dinfo->bustype != PS3_BUSTYPE_SYSBUS && dinfo->bustype != PS3_BUSTYPE_STORAGE) @@ -646,9 +646,13 @@ ps3bus_get_dma_tag(device_t dev, device_ dinfo->devtype == PS3_DEVTYPE_USB) flags = 2; /* 8-bit mode */ + pagesize = 24; /* log_2(16 MB) */ + if (dinfo->bustype == PS3_BUSTYPE_STORAGE) + pagesize = 12; /* 4 KB */ + for (i = 0; i < sc->rcount; i++) { err = lv1_allocate_device_dma_region(dinfo->bus, dinfo->dev, - sc->regions[i].mr_size, 24 /* log_2(16 MB) */, flags, + sc->regions[i].mr_size, pagesize, flags, &dinfo->dma_base[i]); if (err != 0) { device_printf(child, From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 04:35:45 2011 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 88276106564A; Thu, 23 Jun 2011 04:35:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 785668FC16; Thu, 23 Jun 2011 04:35: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 p5N4ZjoY083099; Thu, 23 Jun 2011 04:35:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N4Zj6G083097; Thu, 23 Jun 2011 04:35:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106230435.p5N4Zj6G083097@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 04:35: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: r223463 - head/sys/powerpc/ps3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 04:35:45 -0000 Author: nwhitehorn Date: Thu Jun 23 04:35:45 2011 New Revision: 223463 URL: http://svn.freebsd.org/changeset/base/223463 Log: Use atomic operations to mask and unmask IRQs. This prevents a problem (obvious in retrospect) in which interrupts on one CPU that are temporarily masked can end up permanently masked when a handler on another CPU clobbers the interrupt mask register with an old copy. Modified: head/sys/powerpc/ps3/ps3pic.c Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Thu Jun 23 04:06:33 2011 (r223462) +++ head/sys/powerpc/ps3/ps3pic.c Thu Jun 23 04:35:45 2011 (r223463) @@ -56,10 +56,10 @@ static void ps3pic_mask(device_t, u_int) static void ps3pic_unmask(device_t, u_int); struct ps3pic_softc { - uint64_t *bitmap_thread0; - uint64_t *mask_thread0; - uint64_t *bitmap_thread1; - uint64_t *mask_thread1; + volatile uint64_t *bitmap_thread0; + volatile uint64_t *mask_thread0; + volatile uint64_t *bitmap_thread1; + volatile uint64_t *mask_thread1; uint64_t sc_ipi_outlet[2]; int sc_vector[64]; @@ -219,8 +219,8 @@ ps3pic_mask(device_t dev, u_int irq) if (irq == sc->sc_ipi_outlet[0]) return; - sc->mask_thread0[0] &= ~(1UL << (63 - irq)); - sc->mask_thread1[0] &= ~(1UL << (63 - irq)); + atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq)); + atomic_clear_64(&sc->mask_thread1[0], 1UL << (63 - irq)); lv1_get_logical_ppe_id(&ppe); lv1_did_update_interrupt_mask(ppe, 0); @@ -234,8 +234,8 @@ ps3pic_unmask(device_t dev, u_int irq) uint64_t ppe; sc = device_get_softc(dev); - sc->mask_thread0[0] |= (1UL << (63 - irq)); - sc->mask_thread1[0] |= (1UL << (63 - irq)); + atomic_set_64(&sc->mask_thread0[0], 1UL << (63 - irq)); + atomic_set_64(&sc->mask_thread1[0], 1UL << (63 - irq)); lv1_get_logical_ppe_id(&ppe); lv1_did_update_interrupt_mask(ppe, 0); From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 05:24:00 2011 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 5E9AC1065676; Thu, 23 Jun 2011 05:24:00 +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 4FAE28FC13; Thu, 23 Jun 2011 05:24: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 p5N5O0fp084551; Thu, 23 Jun 2011 05:24:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N5O0Rs084548; Thu, 23 Jun 2011 05:24:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201106230524.p5N5O0Rs084548@svn.freebsd.org> From: Alan Cox Date: Thu, 23 Jun 2011 05:24: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: r223464 - 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, 23 Jun 2011 05:24:00 -0000 Author: alc Date: Thu Jun 23 05:23:59 2011 New Revision: 223464 URL: http://svn.freebsd.org/changeset/base/223464 Log: Revert to using the page queues lock in vm_page_clear_dirty_mask() on MIPS. (At present, although atomic_clear_char() is defined by atomic.h on MIPS, it is not actually implemented by support.S.) Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jun 23 04:35:45 2011 (r223463) +++ head/sys/vm/vm_fault.c Thu Jun 23 05:23:59 2011 (r223464) @@ -1095,8 +1095,7 @@ vm_fault_quick_hold_pages(vm_map_t map, * required in order to call vm_page_dirty(). See * vm_page_clear_dirty_mask(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ - defined(__mips__) +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) vm_page_dirty(*mp); #else vm_page_lock_queues(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 23 04:35:45 2011 (r223463) +++ head/sys/vm/vm_page.c Thu Jun 23 05:23:59 2011 (r223464) @@ -2336,8 +2336,7 @@ vm_page_clear_dirty_mask(vm_page_t m, in if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0) m->dirty &= ~pagebits; else { -#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \ - defined(__mips__) +#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) /* * On the aforementioned architectures, the page queues lock * is not required by the following read-modify-write From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 05:28:31 2011 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 A83421065774; Thu, 23 Jun 2011 05:28:31 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 71D838FC12; Thu, 23 Jun 2011 05:28:31 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id B5770290A3B; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id jCQ+ZP9Gc8lf; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 28707290A3A; Thu, 23 Jun 2011 00:28:30 -0500 (CDT) Message-ID: <4E02CEFD.1020606@rice.edu> Date: Thu, 23 Jun 2011 00:28:29 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.15) Gecko/20110328 Thunderbird/3.1.9 MIME-Version: 1.0 To: Adrian Chadd References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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, 23 Jun 2011 05:28:31 -0000 On 06/22/2011 21:36, Adrian Chadd wrote: > Can this commit please be reverted whilst the kinks are worked out for MIPS? I've reverted the MIPS-specific code. Alan From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 06:27:25 2011 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 A6DE1106566B; Thu, 23 Jun 2011 06:27:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 25D7C8FC13; Thu, 23 Jun 2011 06:27:24 +0000 (UTC) Received: by ywf7 with SMTP id 7so820020ywf.13 for ; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=7DsBXRPuiWj/KZOZOxJhmFxLprjZlsNDR+YpoZB1gPA=; b=pM7Lam5nlRxSfKk+qfHO4kEZVK9MJ5CM2sAcYppht03c0UyCn5x+zu5VJiyeBw5ATw xwj87gp6ObPQ3/ZlmPT5FwHlp96lGjtYnb3nyQYJm+VI9rceLS4s2z6F5cKnI98QrQMB 5Iim6a2VgWBokCidxw0wcQNF9gQjYvYo8Io2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=exn/s4CDZNG9wzjuyX7+H1jdqdGeAdy0Z0+6exlZoD6CTXCYDFkI3gvd1R+jGXEbEf bGZx5Ayi1TTjA7YCNUsJUespMaWmWv4PckQ0qo110qq7SU+l2TBabRw8PIeKPx180qIB wRk7xq2fe2U+60iRW20FYccWmd8qekDPR6Ir8= MIME-Version: 1.0 Received: by 10.151.40.16 with SMTP id s16mr1863446ybj.123.1308810444343; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.146.13 with HTTP; Wed, 22 Jun 2011 23:27:24 -0700 (PDT) In-Reply-To: <4E02CEFD.1020606@rice.edu> References: <201106191913.p5JJDOqJ006272@svn.freebsd.org> <4E02CEFD.1020606@rice.edu> Date: Thu, 23 Jun 2011 14:27:24 +0800 X-Google-Sender-Auth: wYLvVnI6dqHyycUz836HPG5aliY Message-ID: From: Adrian Chadd To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223307 - 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, 23 Jun 2011 06:27:25 -0000 On 23 June 2011 13:28, Alan Cox wrote: > On 06/22/2011 21:36, Adrian Chadd wrote: >> >> Can this commit please be reverted whilst the kinks are worked out for >> MIPS? > > I've reverted the MIPS-specific code. Thanks! Adrian From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 06:53:13 2011 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 6E0A6106566B; Thu, 23 Jun 2011 06:53:13 +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 5EBC68FC18; Thu, 23 Jun 2011 06: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 p5N6rDEw087090; Thu, 23 Jun 2011 06:53:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N6rDiK087087; Thu, 23 Jun 2011 06:53:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230653.p5N6rDiK087087@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 06: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: r223465 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 06:53:13 -0000 Author: adrian Date: Thu Jun 23 06:53:13 2011 New Revision: 223465 URL: http://svn.freebsd.org/changeset/base/223465 Log: Fix indenting issues introduced by the previous commit. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 05:23:59 2011 (r223464) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_beacon.c Thu Jun 23 06:53:13 2011 (r223465) @@ -84,9 +84,9 @@ ar5212BeaconInit(struct ath_hal *ah, case HAL_M_HOSTAP: case HAL_M_IBSS: bt.bt_nextdba = (next_beacon - - ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ break; } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 05:23:59 2011 (r223464) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c Thu Jun 23 06:53:13 2011 (r223465) @@ -93,9 +93,9 @@ ar5416BeaconInit(struct ath_hal *ah, /* fall thru... */ case HAL_M_HOSTAP: bt.bt_nextdba = (next_beacon - - ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_dma_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_nextswba = (next_beacon - - ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ + ah->ah_config.ah_sw_beacon_response_time) << 3; /* 1/8 TU */ bt.bt_flags |= AR_TIMER_MODE_TBTT | AR_TIMER_MODE_DBA | AR_TIMER_MODE_SWBA; From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 06:55:29 2011 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 91E2C106566B; Thu, 23 Jun 2011 06:55:29 +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 806C48FC13; Thu, 23 Jun 2011 06:55: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 p5N6tT76087203; Thu, 23 Jun 2011 06:55:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N6tTr6087189; Thu, 23 Jun 2011 06:55:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106230655.p5N6tTr6087189@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 06:55: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: r223466 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5312 ar5416 ar9001 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 06:55:29 -0000 Author: adrian Date: Thu Jun 23 06:55:29 2011 New Revision: 223466 URL: http://svn.freebsd.org/changeset/base/223466 Log: Re-introduce a global ath_hal_debug again for now, whilst I figure out what to do about the few cases where the HAL state isn't available (regdomain) or isn't yet setup (probe/attach.) The global ath_hal_debug now affects all instances of the HAL. This also restores the ability for probe/attach debugging to work; as the sysctl tree may not be attached at that point. Users can just set the global "hw.ath.hal.debug" to a suitable value to enable probe/attach related debugging. Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5112.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 06:55:29 2011 (r223466) @@ -498,10 +498,29 @@ extern void ath_hal_free(void *); /* common debugging interfaces */ #ifdef AH_DEBUG #include "ah_debug.h" +extern int ath_hal_debug; /* Global debug flags */ + +/* + * This is used for global debugging, when ahp doesn't yet have the + * related debugging state. For example, during probe/attach. + */ +#define HALDEBUG_G(_ah, __m, ...) \ + do { \ + if ((__m) == HAL_DEBUG_UNMASKABLE || \ + ath_hal_debug & (__m)) { \ + DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ + } \ + } while (0); + +/* + * This is used for local debugging, when ahp isn't NULL and + * thus may have debug flags set. + */ #define HALDEBUG(_ah, __m, ...) \ do { \ if ((__m) == HAL_DEBUG_UNMASKABLE || \ - ((_ah != AH_NULL) && (((struct ath_hal*)_ah)->ah_config.ah_debug & (__m)))) { \ + ath_hal_debug & (__m) || \ + (_ah)->ah_config.ah_debug & (__m)) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jun 23 06:55:29 2011 (r223466) @@ -167,7 +167,7 @@ isEepromValid(struct ath_hal *ah) if (regDomainPairs[i].regDmnEnum == rd) return AH_TRUE; } - HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, + HALDEBUG_G(ah, HAL_DEBUG_REGDOMAIN, "%s: invalid regulatory domain/country code 0x%x\n", __func__, rd); return AH_FALSE; } @@ -609,7 +609,7 @@ ath_hal_mapgsm(int sku, int freq) return 1544 + freq; if (sku == SKU_SR9) return 3344 - freq; - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot map freq %u unknown gsm sku %u\n", __func__, freq, sku); return freq; Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -181,14 +181,14 @@ ar5210Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; int i; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: devid 0x%x sc %p st %p sh %p\n", __func__, devid, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5210)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: no memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -200,13 +200,13 @@ ar5211Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5211)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); ecode = HAL_ENOMEM; goto bad; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5112.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5112.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5212/ar5112.c Thu Jun 23 06:55:29 2011 (r223466) @@ -611,7 +611,7 @@ getFullPwrTable(uint16_t numPcdacs, uint uint16_t idxR = 1; if (numPcdacs < 2) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: at least 2 pcdac values needed [%d]\n", __func__, numPcdacs); return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -317,13 +317,13 @@ ar5212Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -71,13 +71,13 @@ ar5312Attach(uint16_t devid, HAL_SOFTC s uint16_t eeval; HAL_STATUS ecode; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, st, (void*) sh); /* NB: memory is returned zero'd */ ahp = ath_hal_malloc(sizeof (struct ath_hal_5212)); if (ahp == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -241,7 +241,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ @@ -250,7 +250,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s sizeof(ar5416Addac) ); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -78,13 +78,13 @@ ar9130Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -101,13 +101,13 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp5416 = ath_hal_malloc(sizeof (struct ath_hal_5416)); if (ahp5416 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -120,13 +120,13 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s int8_t pwr_table_offset; uint8_t pwr; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9280 = ath_hal_malloc(sizeof (struct ath_hal_9280)); if (ahp9280 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -118,13 +118,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s HAL_STATUS ecode; HAL_BOOL rfStatus; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9285 = ath_hal_malloc(sizeof (struct ath_hal_9285)); if (ahp9285 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jun 23 06:53:13 2011 (r223465) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jun 23 06:55:29 2011 (r223466) @@ -119,13 +119,13 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s HAL_BOOL rfStatus; int8_t pwr_table_offset; - HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + HALDEBUG_G(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", __func__, sc, (void*) st, (void*) sh); /* NB: memory is returned zero'd */ ahp9287 = ath_hal_malloc(sizeof (struct ath_hal_9287)); if (ahp9287 == AH_NULL) { - HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + HALDEBUG_G(AH_NULL, HAL_DEBUG_ANY, "%s: cannot allocate memory for state block\n", __func__); *status = HAL_ENOMEM; return AH_NULL; From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 07:54:03 2011 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 6B4371065672; Thu, 23 Jun 2011 07:54:03 +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 598698FC0C; Thu, 23 Jun 2011 07: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 p5N7s3qv088942; Thu, 23 Jun 2011 07:54:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N7s3AJ088933; Thu, 23 Jun 2011 07:54:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106230754.p5N7s3AJ088933@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Jun 2011 07: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: r223467 - in head/sys: conf dev/usb dev/usb/template modules/usb/template X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 07:54:03 -0000 Author: hselasky Date: Thu Jun 23 07:54:03 2011 New Revision: 223467 URL: http://svn.freebsd.org/changeset/base/223467 Log: - Add more USB templates for various USB device classes - Add basic template support for USB 3.0 - Export definition of template sysctl numbers through usb_ioctl.h MFC after: 7 days Added: head/sys/dev/usb/template/usb_template_audio.c (contents, props changed) head/sys/dev/usb/template/usb_template_kbd.c (contents, props changed) head/sys/dev/usb/template/usb_template_modem.c (contents, props changed) head/sys/dev/usb/template/usb_template_mouse.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/template/usb_template.c (contents, props changed) head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/template/usb_template_cdce.c (contents, props changed) head/sys/dev/usb/template/usb_template_msc.c (contents, props changed) head/sys/dev/usb/template/usb_template_mtp.c (contents, props changed) head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/template/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/conf/files Thu Jun 23 07:54:03 2011 (r223467) @@ -1991,8 +1991,12 @@ dev/usb/quirk/usb_quirk.c optional usb # # USB templates # -dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template.c optional usb_template +dev/usb/template/usb_template_audio.c optional usb_template dev/usb/template/usb_template_cdce.c optional usb_template +dev/usb/template/usb_template_kbd.c optional usb_template +dev/usb/template/usb_template_modem.c optional usb_template +dev/usb/template/usb_template_mouse.c optional usb_template dev/usb/template/usb_template_msc.c optional usb_template dev/usb/template/usb_template_mtp.c optional usb_template # Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template.c Thu Jun 23 07:54:03 2011 (r223467) @@ -49,6 +49,7 @@ #include #include +#include #include #include #include "usbdevs.h" @@ -141,6 +142,31 @@ usb_make_raw_desc(struct usb_temp_setup ud->bSlaveInterface[0] += temp->bInterfaceNumber; } + + /* check if we have got an interface association descriptor */ + + if ((raw[0] >= sizeof(struct usb_interface_assoc_descriptor)) && + (raw[1] == UDESC_IFACE_ASSOC)) { + struct usb_interface_assoc_descriptor *iad = (void *)dst; + + /* update the interface number */ + + iad->bFirstInterface += + temp->bInterfaceNumber; + } + + /* check if we have got a call management descriptor */ + + if ((raw[0] >= sizeof(struct usb_cdc_cm_descriptor)) && + (raw[1] == UDESC_CS_INTERFACE) && + (raw[2] == UDESCSUB_CDC_CM)) { + struct usb_cdc_cm_descriptor *ccd = (void *)dst; + + /* update the interface number */ + + ccd->bDataInterface += + temp->bInterfaceNumber; + } } temp->size += len; } @@ -476,6 +502,10 @@ usb_make_device_desc(struct usb_temp_set USETW(utd->udd.bcdUSB, 0x0250); utd->udd.bMaxPacketSize = 255; /* 512 bytes */ break; + case USB_SPEED_SUPER: + USETW(utd->udd.bcdUSB, 0x0300); + utd->udd.bMaxPacketSize = 9; /* 2**9 = 512 bytes */ + break; default: temp->err = USB_ERR_INVAL; break; @@ -1303,15 +1333,27 @@ usb_temp_setup_by_index(struct usb_devic usb_error_t err; switch (index) { - case 0: + case USB_TEMP_MSC: err = usb_temp_setup(udev, &usb_template_msc); break; - case 1: + case USB_TEMP_CDCE: err = usb_temp_setup(udev, &usb_template_cdce); break; - case 2: + case USB_TEMP_MTP: err = usb_temp_setup(udev, &usb_template_mtp); break; + case USB_TEMP_MODEM: + err = usb_temp_setup(udev, &usb_template_modem); + break; + case USB_TEMP_AUDIO: + err = usb_temp_setup(udev, &usb_template_audio); + break; + case USB_TEMP_KBD: + err = usb_temp_setup(udev, &usb_template_kbd); + break; + case USB_TEMP_MOUSE: + err = usb_temp_setup(udev, &usb_template_mouse); + break; default: return (USB_ERR_INVAL); } Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template.h Thu Jun 23 07:54:03 2011 (r223467) @@ -30,6 +30,10 @@ #ifndef _USB_TEMPLATE_H_ #define _USB_TEMPLATE_H_ +#ifndef USB_TEMPLATE_VENDOR +#define USB_TEMPLATE_VENDOR 0x0001 +#endif + typedef const void *(usb_temp_get_string_desc_t)(uint16_t lang_id, uint8_t string_index); typedef const void *(usb_temp_get_vendor_desc_t)(const struct usb_device_request *req, uint16_t *plen); @@ -94,10 +98,14 @@ struct usb_temp_data { /* prototypes */ +extern const struct usb_temp_device_desc usb_template_audio; extern const struct usb_temp_device_desc usb_template_cdce; -extern const struct usb_temp_device_desc usb_template_msc; /* Mass Storage Class */ -extern const struct usb_temp_device_desc usb_template_mtp; /* Message Transfer - * Protocol */ +extern const struct usb_temp_device_desc usb_template_kbd; +extern const struct usb_temp_device_desc usb_template_modem; +extern const struct usb_temp_device_desc usb_template_mouse; +extern const struct usb_temp_device_desc usb_template_msc; +extern const struct usb_temp_device_desc usb_template_mtp; + usb_error_t usb_temp_setup(struct usb_device *, const struct usb_temp_device_desc *); void usb_temp_unsetup(struct usb_device *); Added: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,400 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Audio Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_AUDIO_LANG, + INDEX_AUDIO_MIXER, + INDEX_AUDIO_RECORD, + INDEX_AUDIO_PLAYBACK, + INDEX_AUDIO_PRODUCT, + INDEX_AUDIO_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_AUDIO_PRODUCT \ + 'A', 0, 'u', 0, 'd', 0, 'i', 0, 'o', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_AUDIO_MIXER \ + 'M', 0, 'i', 0, 'x', 0, 'e', 0, 'r', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +#define STRING_AUDIO_RECORD \ + 'R', 0, 'e', 0, 'c', 0, 'o', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +#define STRING_AUDIO_PLAYBACK \ + 'P', 0, 'l', 0, 'a', 0, 'y', 0, 'b', 0, 'a', 0, 'c', 0, 'k', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_AUDIO_MIXER, string_audio_mixer); +USB_MAKE_STRING_DESC(STRING_AUDIO_RECORD, string_audio_record); +USB_MAKE_STRING_DESC(STRING_AUDIO_PLAYBACK, string_audio_playback); +USB_MAKE_STRING_DESC(STRING_AUDIO_PRODUCT, string_audio_product); + +/* prototypes */ + +/* Audio Mixer description structures */ + +static const uint8_t audio_raw_desc_0[] = { + 0x0a, 0x24, 0x01, 0x00, 0x01, 0xa9, 0x00, 0x02, + 0x01, 0x02 +}; + +static const uint8_t audio_raw_desc_1[] = { + 0x0c, 0x24, 0x02, 0x01, 0x01, 0x01, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_2[] = { + 0x0c, 0x24, 0x02, 0x02, 0x01, 0x02, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_3[] = { + 0x0c, 0x24, 0x02, 0x03, 0x03, 0x06, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_4[] = { + 0x0c, 0x24, 0x02, 0x04, 0x05, 0x06, 0x00, 0x02, + 0x03, 0x00, 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_5[] = { + 0x09, 0x24, 0x03, 0x05, 0x05, 0x06, 0x00, 0x01, + 0x00 +}; + +static const uint8_t audio_raw_desc_6[] = { + 0x09, 0x24, 0x03, 0x06, 0x01, 0x03, 0x00, 0x09, + 0x00 +}; + +static const uint8_t audio_raw_desc_7[] = { + 0x09, 0x24, 0x03, 0x07, 0x01, 0x01, 0x00, 0x08, + 0x00 +}; + +static const uint8_t audio_raw_desc_8[] = { + 0x09, 0x24, 0x05, 0x08, 0x03, 0x0a, 0x0b, 0x0c, + 0x00 +}; + +static const uint8_t audio_raw_desc_9[] = { + 0x0a, 0x24, 0x06, 0x09, 0x0f, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_10[] = { + 0x0a, 0x24, 0x06, 0x0a, 0x02, 0x01, 0x43, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_11[] = { + 0x0a, 0x24, 0x06, 0x0b, 0x03, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_12[] = { + 0x0a, 0x24, 0x06, 0x0c, 0x04, 0x01, 0x01, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_13[] = { + 0x0a, 0x24, 0x06, 0x0d, 0x02, 0x01, 0x03, 0x00, + 0x00, 0x00 +}; + +static const uint8_t audio_raw_desc_14[] = { + 0x0a, 0x24, 0x06, 0x0e, 0x03, 0x01, 0x01, 0x02, + 0x02, 0x00 +}; + +static const uint8_t audio_raw_desc_15[] = { + 0x0f, 0x24, 0x04, 0x0f, 0x03, 0x01, 0x0d, 0x0e, + 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +static const void *audio_raw_iface_0_desc[] = { + audio_raw_desc_0, + audio_raw_desc_1, + audio_raw_desc_2, + audio_raw_desc_3, + audio_raw_desc_4, + audio_raw_desc_5, + audio_raw_desc_6, + audio_raw_desc_7, + audio_raw_desc_8, + audio_raw_desc_9, + audio_raw_desc_10, + audio_raw_desc_11, + audio_raw_desc_12, + audio_raw_desc_13, + audio_raw_desc_14, + audio_raw_desc_15, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = audio_raw_iface_0_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_MIXER, +}; + +static const uint8_t audio_raw_desc_20[] = { + 0x07, 0x24, 0x01, 0x01, 0x03, 0x01, 0x00 + +}; + +static const uint8_t audio_raw_desc_21[] = { + 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01, + /* 48kHz */ + 0x80, 0xbb, 0x00 +}; + +static const uint8_t audio_raw_desc_22[] = { + 0x07, 0x25, 0x01, 0x00, 0x01, 0x04, 0x00 +}; + +static const void *audio_raw_iface_1_desc[] = { + audio_raw_desc_20, + audio_raw_desc_21, + NULL, +}; + +static const void *audio_raw_ep_1_desc[] = { + audio_raw_desc_22, + NULL, +}; + +static const struct usb_temp_packet_size audio_isoc_mps = { + .mps[USB_SPEED_FULL] = 0xC8, + .mps[USB_SPEED_HIGH] = 0xC8, +}; + +static const struct usb_temp_interval audio_isoc_interval = { + .bInterval[USB_SPEED_FULL] = 1, /* 1:1 */ + .bInterval[USB_SPEED_HIGH] = 4, /* 1:8 */ +}; + +static const struct usb_temp_endpoint_desc audio_isoc_out_ep = { + .ppRawDesc = audio_raw_ep_1_desc, + .pPacketSize = &audio_isoc_mps, + .pIntervals = &audio_isoc_interval, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_ISOCHRONOUS | UE_ISO_ADAPT, +}; + +static const struct usb_temp_endpoint_desc *audio_iface_1_ep[] = { + &audio_isoc_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_1_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_PLAYBACK, +}; + +static const struct usb_temp_interface_desc audio_iface_1_alt_1 = { + .ppEndpoints = audio_iface_1_ep, + .ppRawDesc = audio_raw_iface_1_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_PLAYBACK, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const uint8_t audio_raw_desc_30[] = { + 0x07, 0x24, 0x01, 0x07, 0x01, 0x01, 0x00 + +}; + +static const uint8_t audio_raw_desc_31[] = { + 0x0b, 0x24, 0x02, 0x01, 0x02, 0x02, 0x10, 0x01, + /* 48kHz */ + 0x80, 0xbb, 0x00 +}; + +static const uint8_t audio_raw_desc_32[] = { + 0x07, 0x25, 0x01, 0x01, 0x00, 0x00, 0x00 +}; + +static const void *audio_raw_iface_2_desc[] = { + audio_raw_desc_30, + audio_raw_desc_31, + NULL, +}; + +static const void *audio_raw_ep_2_desc[] = { + audio_raw_desc_32, + NULL, +}; + +static const struct usb_temp_endpoint_desc audio_isoc_in_ep = { + .ppRawDesc = audio_raw_ep_2_desc, + .pPacketSize = &audio_isoc_mps, + .pIntervals = &audio_isoc_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_ISOCHRONOUS | UE_ISO_ADAPT, +}; + +static const struct usb_temp_endpoint_desc *audio_iface_2_ep[] = { + &audio_isoc_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc audio_iface_2_alt_0 = { + .ppEndpoints = NULL, /* no endpoints */ + .ppRawDesc = NULL, /* no raw descriptors */ + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_RECORD, +}; + +static const struct usb_temp_interface_desc audio_iface_2_alt_1 = { + .ppEndpoints = audio_iface_2_ep, + .ppRawDesc = audio_raw_iface_2_desc, + .bInterfaceClass = 1, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 0, + .iInterface = INDEX_AUDIO_RECORD, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const struct usb_temp_interface_desc *audio_interfaces[] = { + &audio_iface_0, + &audio_iface_1_alt_0, + &audio_iface_1_alt_1, + &audio_iface_2_alt_0, + &audio_iface_2_alt_1, + NULL, +}; + +static const struct usb_temp_config_desc audio_config_desc = { + .ppIfaceDesc = audio_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_AUDIO_PRODUCT, +}; + +static const struct usb_temp_config_desc *audio_configs[] = { + &audio_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t audio_get_string_desc; + +const struct usb_temp_device_desc usb_template_audio = { + .getStringDesc = &audio_get_string_desc, + .ppConfigDesc = audio_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x000A, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_AUDIO_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * audio_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +audio_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_AUDIO_MAX] = { + [INDEX_AUDIO_LANG] = &string_lang, + [INDEX_AUDIO_MIXER] = &string_audio_mixer, + [INDEX_AUDIO_RECORD] = &string_audio_record, + [INDEX_AUDIO_PLAYBACK] = &string_audio_playback, + [INDEX_AUDIO_PRODUCT] = &string_audio_product, + }; + + if (string_index == 0) { + return (&string_lang); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_AUDIO_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Thu Jun 23 06:55:29 2011 (r223466) +++ head/sys/dev/usb/template/usb_template_cdce.c Thu Jun 23 07:54:03 2011 (r223467) @@ -264,7 +264,7 @@ static const struct usb_temp_config_desc const struct usb_temp_device_desc usb_template_cdce = { .getStringDesc = ð_get_string_desc, .ppConfigDesc = eth_configs, - .idVendor = 0x0001, + .idVendor = USB_TEMPLATE_VENDOR, .idProduct = 0x0001, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, Added: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,222 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Keyboard Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_LANG, + INDEX_KEYBOARD, + INDEX_PRODUCT, + INDEX_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_PRODUCT \ + 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_KEYBOARD \ + 'K', 0, 'e', 0, 'y', 0, 'b', 0, 'o', 0, 'a', 0, 'r', 0, 'd', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_KEYBOARD, string_keyboard); +USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); + +/* prototypes */ + +static const struct usb_temp_packet_size keyboard_intr_mps = { + .mps[USB_SPEED_LOW] = 16, + .mps[USB_SPEED_FULL] = 16, + .mps[USB_SPEED_HIGH] = 16, +}; + +static const struct usb_temp_interval keyboard_intr_interval = { + .bInterval[USB_SPEED_LOW] = 2, /* ms */ + .bInterval[USB_SPEED_FULL] = 2, + .bInterval[USB_SPEED_HIGH] = 2 * 8, +}; + +static uint8_t keyboard_hid_descriptor[] = { + 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, + 0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, + 0x75, 0x08, 0x81, 0x01, 0x95, 0x03, 0x75, 0x01, + 0x05, 0x08, 0x19, 0x01, 0x29, 0x03, 0x91, 0x02, + 0x95, 0x05, 0x75, 0x01, 0x91, 0x01, 0x95, 0x06, + 0x75, 0x08, 0x15, 0x00, 0x26, 0xff, 0x00, 0x05, + 0x07, 0x19, 0x00, 0x2a, 0xff, 0x00, 0x81, 0x00, + 0xc0 +}; + +static const struct usb_temp_endpoint_desc keyboard_ep_0 = { + .ppRawDesc = NULL, /* no raw descriptors */ + .pPacketSize = &keyboard_intr_mps, + .pIntervals = &keyboard_intr_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc *keyboard_endpoints[] = { + &keyboard_ep_0, + NULL, +}; + +static const uint8_t keyboard_raw_desc[] = { + 0x09, 0x21, 0x10, 0x01, 0x00, 0x01, 0x22, sizeof(keyboard_hid_descriptor), + 0x00 +}; + +static const void *keyboard_iface_0_desc[] = { + keyboard_raw_desc, + NULL, +}; + +static const struct usb_temp_interface_desc keyboard_iface_0 = { + .ppRawDesc = keyboard_iface_0_desc, + .ppEndpoints = keyboard_endpoints, + .bInterfaceClass = 3, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 1, + .iInterface = INDEX_KEYBOARD, +}; + +static const struct usb_temp_interface_desc *keyboard_interfaces[] = { + &keyboard_iface_0, + NULL, +}; + +static const struct usb_temp_config_desc keyboard_config_desc = { + .ppIfaceDesc = keyboard_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PRODUCT, +}; + +static const struct usb_temp_config_desc *keyboard_configs[] = { + &keyboard_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t keyboard_get_string_desc; +static usb_temp_get_vendor_desc_t keyboard_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_kbd = { + .getStringDesc = &keyboard_get_string_desc, + .getVendorDesc = &keyboard_get_vendor_desc, + .ppConfigDesc = keyboard_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x00CB, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * keyboard_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +keyboard_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + if ((req->bmRequestType == 0x81) && (req->bRequest == 0x06) && + (req->wValue[0] == 0x00) && (req->wValue[1] == 0x22) && + (req->wIndex[1] == 0) && (req->wIndex[0] == 0)) { + + *plen = sizeof(keyboard_hid_descriptor); + return (keyboard_hid_descriptor); + } + return (NULL); +} + +/*------------------------------------------------------------------------* + * keyboard_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +keyboard_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[INDEX_MAX] = { + [INDEX_LANG] = &string_lang, + [INDEX_KEYBOARD] = &string_keyboard, + [INDEX_PRODUCT] = &string_product, + }; + + if (string_index == 0) { + return (&string_lang); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < INDEX_MAX) { + return (ptr[string_index]); + } + return (NULL); +} Added: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_modem.c Thu Jun 23 07:54:03 2011 (r223467) @@ -0,0 +1,252 @@ +#include +__FBSDID("$FreeBSD$"); + +/*- + * Copyright (c) 2010 Hans Petter Selasky. 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. + */ + +/* + * This file contains the USB template for an USB Modem Device. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +enum { + INDEX_LANG, + INDEX_MODEM, + INDEX_PRODUCT, + INDEX_MAX, +}; + +#define STRING_LANG \ + 0x09, 0x04, /* American English */ + +#define STRING_PRODUCT \ + 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ + 'T', 0, 'e', 0, 's', 0, 't', 0, ' ', 0, \ + 'D', 0, 'e', 0, 'v', 0, 'i', 0, 'c', 0, 'e', 0, ' ', 0, + +#define STRING_MODEM \ + 'M', 0, 'o', 0, 'd', 0, 'e', 0, 'm', 0, ' ', 0, \ + 'i', 0, 'n', 0, 't', 0, 'e', 0, 'r', 0, 'f', 0, 'a', 0, 'c', 0, 'e', 0, + +/* make the real string descriptors */ + +USB_MAKE_STRING_DESC(STRING_LANG, string_lang); +USB_MAKE_STRING_DESC(STRING_MODEM, string_modem); +USB_MAKE_STRING_DESC(STRING_PRODUCT, string_product); + +#define MODEM_IFACE_0 0 +#define MODEM_IFACE_1 1 + +/* prototypes */ + +static const struct usb_temp_packet_size modem_bulk_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const struct usb_temp_packet_size modem_intr_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 8, + .mps[USB_SPEED_HIGH] = 8, +}; + +static const struct usb_temp_interval modem_intr_interval = { + .bInterval[USB_SPEED_LOW] = 10, + .bInterval[USB_SPEED_FULL] = 10, + .bInterval[USB_SPEED_HIGH] = 10 * 8, +}; + +static const struct usb_temp_endpoint_desc modem_ep_0 = { + .pPacketSize = &modem_intr_mps, + .pIntervals = &modem_intr_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc modem_ep_1 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc modem_ep_2 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_0_ep[] = { + &modem_ep_0, + NULL, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_1_ep[] = { + &modem_ep_1, + &modem_ep_2, + NULL, +}; + +static const uint8_t modem_raw_desc_0[] = { + 0x05, 0x24, 0x00, 0x10, 0x01 +}; + +static const uint8_t modem_raw_desc_1[] = { + 0x05, 0x24, 0x06, MODEM_IFACE_0, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_2[] = { + 0x05, 0x24, 0x01, 0x03, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_3[] = { + 0x04, 0x24, 0x02, 0x07 +}; + +static const void *modem_iface_0_desc[] = { + &modem_raw_desc_0, + &modem_raw_desc_1, + &modem_raw_desc_2, + &modem_raw_desc_3, + NULL, +}; + +static const struct usb_temp_interface_desc modem_iface_0 = { + .ppRawDesc = modem_iface_0_desc, + .ppEndpoints = modem_iface_0_ep, + .bInterfaceClass = 2, + .bInterfaceSubClass = 2, + .bInterfaceProtocol = 1, + .iInterface = INDEX_MODEM, +}; + +static const struct usb_temp_interface_desc modem_iface_1 = { + .ppEndpoints = modem_iface_1_ep, + .bInterfaceClass = 10, + .bInterfaceSubClass = 0, + .bInterfaceProtocol = 0, + .iInterface = INDEX_MODEM, +}; + +static const struct usb_temp_interface_desc *modem_interfaces[] = { + &modem_iface_0, + &modem_iface_1, + NULL, +}; + +static const struct usb_temp_config_desc modem_config_desc = { + .ppIfaceDesc = modem_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = INDEX_PRODUCT, +}; + +static const struct usb_temp_config_desc *modem_configs[] = { + &modem_config_desc, + NULL, +}; + +static usb_temp_get_string_desc_t modem_get_string_desc; +static usb_temp_get_vendor_desc_t modem_get_vendor_desc; + +const struct usb_temp_device_desc usb_template_modem = { + .getStringDesc = &modem_get_string_desc, + .getVendorDesc = &modem_get_vendor_desc, + .ppConfigDesc = modem_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x000E, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_COMM, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = 0, + .iProduct = INDEX_PRODUCT, + .iSerialNumber = 0, +}; + +/*------------------------------------------------------------------------* + * modem_get_vendor_desc + * + * Return values: + * NULL: Failure. No such vendor descriptor. + * Else: Success. Pointer to vendor descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +modem_get_vendor_desc(const struct usb_device_request *req, uint16_t *plen) +{ + return (NULL); +} + +/*------------------------------------------------------------------------* + * modem_get_string_desc *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 08:33:48 2011 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 07A5A106566B; Thu, 23 Jun 2011 08:33:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id A970C8FC15; Thu, 23 Jun 2011 08:33:47 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 8595425D389C; Thu, 23 Jun 2011 08:17:11 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id B151215A2484; Thu, 23 Jun 2011 08:17:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id OcnUYerx838h; Thu, 23 Jun 2011 08:17:09 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9E85615A2475; Thu, 23 Jun 2011 08:17:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201106230524.p5N5O0Rs084548@svn.freebsd.org> Date: Thu, 23 Jun 2011 08:17:08 +0000 Content-Transfer-Encoding: 7bit Message-Id: <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> To: Alan Cox X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223464 - 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, 23 Jun 2011 08:33:48 -0000 On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: > Author: alc > Date: Thu Jun 23 05:23:59 2011 > New Revision: 223464 > URL: http://svn.freebsd.org/changeset/base/223464 > > Log: > Revert to using the page queues lock in vm_page_clear_dirty_mask() on > MIPS. (At present, although atomic_clear_char() is defined by atomic.h > on MIPS, it is not actually implemented by support.S.) Thanks, and good catch on the atomics even if not planned, just in time for 9.0:) /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 09:42:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57EB3106564A; Thu, 23 Jun 2011 09:42:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 486C68FC13; Thu, 23 Jun 2011 09:42: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 p5N9ggfU092199; Thu, 23 Jun 2011 09:42:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9ggYc092197; Thu, 23 Jun 2011 09:42:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106230942.p5N9ggYc092197@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 23 Jun 2011 09:42: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: r223469 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 09:42:42 -0000 Author: glebius Date: Thu Jun 23 09:42:41 2011 New Revision: 223469 URL: http://svn.freebsd.org/changeset/base/223469 Log: Be consistent with r160968: keep autoSrcAddr flag untouched when node receives NGM_SHUTDOWN. Submitted by: pluknet Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Thu Jun 23 09:40:46 2011 (r223468) +++ head/sys/netgraph/ng_ether.c Thu Jun 23 09:42:41 2011 (r223469) @@ -718,7 +718,6 @@ ng_ether_shutdown(node_p node) (void)ifpromisc(priv->ifp, 0); priv->promisc = 0; } - priv->autoSrcAddr = 1; /* reset auto-src-addr flag */ NG_NODE_REVIVE(node); /* Signal ng_rmnode we are persisant */ return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 09:43:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080031065670; Thu, 23 Jun 2011 09:43:54 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id EC72D8FC13; Thu, 23 Jun 2011 09:43: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 p5N9hrrh092268; Thu, 23 Jun 2011 09:43:53 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9hrvA092266; Thu, 23 Jun 2011 09:43:53 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106230943.p5N9hrvA092266@svn.freebsd.org> From: Andreas Tobler Date: Thu, 23 Jun 2011 09:43: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: r223470 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 09:43:54 -0000 Author: andreast Date: Thu Jun 23 09:43:53 2011 New Revision: 223470 URL: http://svn.freebsd.org/changeset/base/223470 Log: Add leading zeros when printing the stackframe on __powerpc64__. Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Thu Jun 23 09:42:41 2011 (r223469) +++ head/sys/powerpc/powerpc/db_trace.c Thu Jun 23 09:43:53 2011 (r223470) @@ -200,7 +200,7 @@ db_backtrace(struct thread *td, db_addr_ } #ifdef __powerpc64__ - db_printf("0x%16lx: ", stackframe); + db_printf("0x%016lx: ", stackframe); #else db_printf("0x%08x: ", stackframe); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 09:46:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B28D106564A; Thu, 23 Jun 2011 09:46:12 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB7E8FC1E; Thu, 23 Jun 2011 09:46: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 p5N9kCWA092390; Thu, 23 Jun 2011 09:46:12 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5N9kC4H092388; Thu, 23 Jun 2011 09:46:12 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106230946.p5N9kC4H092388@svn.freebsd.org> From: Andreas Tobler Date: Thu, 23 Jun 2011 09:46:12 +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: r223471 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 09:46:12 -0000 Author: andreast Date: Thu Jun 23 09:46:12 2011 New Revision: 223471 URL: http://svn.freebsd.org/changeset/base/223471 Log: Fix merge typo. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jun 23 09:43:53 2011 (r223470) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jun 23 09:46:12 2011 (r223471) @@ -1715,7 +1715,7 @@ moea64_kextract(mmu_t mmu, vm_offset_t v pvo = moea64_pvo_find_va(kernel_pmap, va); KASSERT(pvo != NULL, ("moea64_kextract: no addr found for %#" PRIxPTR, va)); - pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) + (va - PVO_VADDR(pvo)); + pa = (pvo->pvo_pte.lpte.pte_lo & LPTE_RPGN) | (va - PVO_VADDR(pvo)); PMAP_UNLOCK(kernel_pmap); return (pa); } From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 10:33:54 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE75106564A for ; Thu, 23 Jun 2011 10:33:54 +0000 (UTC) (envelope-from vadim@nuclight.avtf.net) Received: from nuclight.avtf.net (nuclight.avtf.net [82.117.70.99]) by mx1.freebsd.org (Postfix) with ESMTP id 397EE8FC1B for ; Thu, 23 Jun 2011 10:33:52 +0000 (UTC) Received: from kernblitz.nuclight.avtf.net (vadim@localhost [127.0.0.1]) by nuclight.avtf.net (8.14.4/8.14.4) with ESMTP id p5NAXkn4098189; Thu, 23 Jun 2011 17:33:46 +0700 (NOVST) (envelope-from vadim@kernblitz.nuclight.avtf.net) Received: (from vadim@localhost) by kernblitz.nuclight.avtf.net (8.14.4/8.14.4/Submit) id p5NAXjDd098186; Thu, 23 Jun 2011 17:33:45 +0700 (NOVST) (envelope-from vadim) Message-Id: <201106231033.p5NAXjDd098186@kernblitz.nuclight.avtf.net> To: Gleb Smirnoff From: Vadim Goncharov In-Reply-To: =?UTF-8?Q?=3C201106230942=2Ep5N9ggYc092197=5F=5F43508=2E856?= =?UTF-8?Q?7821824=241308822179=24gmane=24org=40svn=2Efreebsd=2Eorg=3E?= References: <201106230942.p5N9ggYc092197__43508.8567821824$1308822179$gmane$org@svn.freebsd.org> X-Comment-To: Gleb Smirnoff Date: Thu, 23 Jun 2011 17:33:45 +0700 User-Agent: slrn/0.9.9p1 (FreeBSD) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-all@FreeBSD.org Subject: Re: svn commit: r223469 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: "SVN commit messages 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, 23 Jun 2011 10:33:54 -0000 Hi Gleb Smirnoff! On Thu, 23 Jun 2011 09:42:42 +0000 (UTC); Gleb Smirnoff wrote: > Log: > Be consistent with r160968: keep autoSrcAddr flag untouched when > node receives NGM_SHUTDOWN. > > Submitted by: pluknet > Modified: > head/sys/netgraph/ng_ether.c > Modified: head/sys/netgraph/ng_ether.c > ============================================================================== > --- head/sys/netgraph/ng_ether.c Thu Jun 23 09:40:46 2011 (r223468) > +++ head/sys/netgraph/ng_ether.c Thu Jun 23 09:42:41 2011 (r223469) > @@ -718,7 +718,6 @@ ng_ether_shutdown(node_p node) > (void)ifpromisc(priv->ifp, 0); > priv->promisc = 0; > } > - priv->autoSrcAddr = 1; /* reset auto-src-addr flag */ > NG_NODE_REVIVE(node); /* Signal ng_rmnode we are persisant */ Then manual page must also be updated as this was documented behaviour in the SHUTDOWN section. -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight] From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 10:35:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 889131065673; Thu, 23 Jun 2011 10:35:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 787ED8FC12; Thu, 23 Jun 2011 10:35: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 p5NAZjYJ093859; Thu, 23 Jun 2011 10:35:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NAZjEH093855; Thu, 23 Jun 2011 10:35:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106231035.p5NAZjEH093855@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 23 Jun 2011 10:35: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: r223472 - head/sys/dev/usb/template X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 10:35:45 -0000 Author: hselasky Date: Thu Jun 23 10:35:45 2011 New Revision: 223472 URL: http://svn.freebsd.org/changeset/base/223472 Log: - Add some comments about the origin of some USB descriptors. MFC after: 7 days Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_mouse.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_audio.c Thu Jun 23 10:35:45 2011 (r223472) @@ -95,7 +95,12 @@ USB_MAKE_STRING_DESC(STRING_AUDIO_PRODUC /* prototypes */ -/* Audio Mixer description structures */ +/* + * Audio Mixer description structures + * + * Some of the audio descriptors were dumped + * from a Creative Labs USB audio device. + */ static const uint8_t audio_raw_desc_0[] = { 0x0a, 0x24, 0x01, 0x00, 0x01, 0xa9, 0x00, 0x02, Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_kbd.c Thu Jun 23 10:35:45 2011 (r223472) @@ -94,6 +94,8 @@ static const struct usb_temp_interval ke .bInterval[USB_SPEED_HIGH] = 2 * 8, }; +/* The following HID descriptor was dumped from a HP keyboard. */ + static uint8_t keyboard_hid_descriptor[] = { 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01, Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Thu Jun 23 09:46:12 2011 (r223471) +++ head/sys/dev/usb/template/usb_template_mouse.c Thu Jun 23 10:35:45 2011 (r223472) @@ -82,6 +82,8 @@ USB_MAKE_STRING_DESC(STRING_PRODUCT, str /* prototypes */ +/* The following HID descriptor was dumped from a HP mouse. */ + static uint8_t mouse_hid_descriptor[] = { 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x03, From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 10:43:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A17106566B; Thu, 23 Jun 2011 10:43:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E1F1F8FC17; Thu, 23 Jun 2011 10:43: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 p5NAhaFO094823; Thu, 23 Jun 2011 10:43:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NAha34094821; Thu, 23 Jun 2011 10:43:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106231043.p5NAha34094821@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 23 Jun 2011 10:43: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: r223473 - 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, 23 Jun 2011 10:43:37 -0000 Author: glebius Date: Thu Jun 23 10:43:36 2011 New Revision: 223473 URL: http://svn.freebsd.org/changeset/base/223473 Log: Document that autoSrcAddr isn't re-enabled on NGM_SHUTDOWN. Submitted by: Vadim Goncharov Modified: head/share/man/man4/ng_ether.4 Modified: head/share/man/man4/ng_ether.4 ============================================================================== --- head/share/man/man4/ng_ether.4 Thu Jun 23 10:35:45 2011 (r223472) +++ head/share/man/man4/ng_ether.4 Thu Jun 23 10:43:36 2011 (r223473) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 4, 2006 +.Dd June 23, 2011 .Dt NG_ETHER 4 .Os .Sh NAME @@ -183,7 +183,6 @@ Detach from underlying Ethernet interfac Upon receipt of the .Dv NGM_SHUTDOWN control message, all hooks are disconnected, promiscuous mode is disabled, -and the source address override flag is re-enabled, but the node is not removed. Node can be shut down only using .Dv NGM_ETHER_DETACH From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 12:11:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 554901065670; Thu, 23 Jun 2011 12:11:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 457F48FC0C; Thu, 23 Jun 2011 12:11: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 p5NCBiQf099141; Thu, 23 Jun 2011 12:11:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NCBiQ3099139; Thu, 23 Jun 2011 12:11:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106231211.p5NCBiQ3099139@svn.freebsd.org> From: Adrian Chadd Date: Thu, 23 Jun 2011 12:11: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: r223474 - 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: Thu, 23 Jun 2011 12:11:44 -0000 Author: adrian Date: Thu Jun 23 12:11:43 2011 New Revision: 223474 URL: http://svn.freebsd.org/changeset/base/223474 Log: add missing #define for the non-debug case. 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 Thu Jun 23 10:43:36 2011 (r223473) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Jun 23 12:11:43 2011 (r223474) @@ -529,6 +529,7 @@ extern void DO_HALDEBUG(struct ath_hal * __printflike(3,4); #else #define HALDEBUG(_ah, __m, _fmt, ...) +#define HALDEBUG_G(_ah, __m, _fmt, ...) #endif /* AH_DEBUG */ /* From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 15:10:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F88106566C; Thu, 23 Jun 2011 15:10:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D635A8FC17; Thu, 23 Jun 2011 15:10: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 p5NFAiP5004457; Thu, 23 Jun 2011 15:10:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NFAixO004455; Thu, 23 Jun 2011 15:10:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106231510.p5NFAixO004455@svn.freebsd.org> From: Alexander Motin Date: Thu, 23 Jun 2011 15:10: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: r223475 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 15:10:45 -0000 Author: mav Date: Thu Jun 23 15:10:44 2011 New Revision: 223475 URL: http://svn.freebsd.org/changeset/base/223475 Log: Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI device to never complete, that caused probe process (system boot) stuck. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Thu Jun 23 12:11:43 2011 (r223474) +++ head/sys/cam/ata/ata_xpt.c Thu Jun 23 15:10:44 2011 (r223475) @@ -1678,7 +1678,8 @@ ata_action(union ccb *start_ccb) xpt_done(start_ccb); break; } - /* FALLTHROUGH */ + xpt_action_default(start_ccb); + break; } case XPT_DEV_ADVINFO: { From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 15:26:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D457106566C; Thu, 23 Jun 2011 15:26:02 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id CA1788FC16; Thu, 23 Jun 2011 15:26:01 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5NFPvIZ073373 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 08:26:01 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E02989F.6040703@FreeBSD.org> Date: Thu, 23 Jun 2011 08:25:51 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> <4E02989F.6040703@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Jung-uk Kim Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 15:26:02 -0000 On Jun 22, 2011, at 6:36 PM, Alexander Motin wrote: > Marcel Moolenaar wrote: >> On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >>> Marcel Moolenaar wrote: >>>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>>> I just realized kern_clocksource.c was excluded for arm and ia64. =20= >>>>> Here is updated patch. Please ignore the previous one. >>>> Any reason why we're not adding kern_clocksource.c for them? >>> Their event timers code still waits for refactoring. I have neither >>> documentation nor hardware for them. Help would be appreciated. >>=20 >> Can you give me a pointer to a document orpage that describes >> what is being refactored, why and how? >=20 > In short, timer management code was unified and formalized. Instead of > direct programming periodic timers from MD code and calling hard-/ > stat-/ profclock() from there, timer hardware should be exposed to the > MI kernel using sys/timeet.h API to allow kern_clocksource.c manage = it. > Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() > callbacks from MD initialization code, and cpu_idleclock() and > cpu_activeclock() from MD cpu_idle(). >=20 > Here is some references: > man 4 eventtimers > = http://wiki.freebsd.org/201010DevSummit?action=3DAttachFile&do=3Dview&targ= et=3Dtimers.pdf > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D209371 > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D212541 >=20 > All architectures except ia64 and non-Marvell arm are already done, so > you may took any of them as reference. Ask me if you have any = questions. Can you give a quick outline of how all the various clock related initializations and support code relate, interact or even conflict? It's getting rather convoluted and want to make sure I get the ordering and timing right. Also: The ITC on ia64 is a per-CPU, one short and periodic timer that has a fixed frequency. Though the architecture does not guarantee that counters are synchronized, nor that all CPUs in a system run at the same frequency which means that the ITCs may not all run at the same frequency. Does the et code work with that or do I need to impose a restriction on what hardware configurations to support and/or revert to having the ITC be a global timer and run only on the BSP? Thanks, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 15:28:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E113D1065673; Thu, 23 Jun 2011 15:28:54 +0000 (UTC) (envelope-from sanpei@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id CFD488FC19; Thu, 23 Jun 2011 15:28: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 p5NFSsCh005012; Thu, 23 Jun 2011 15:28:54 GMT (envelope-from sanpei@svn.freebsd.org) Received: (from sanpei@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NFSse9005008; Thu, 23 Jun 2011 15:28:54 GMT (envelope-from sanpei@svn.freebsd.org) Message-Id: <201106231528.p5NFSse9005008@svn.freebsd.org> From: MIHIRA Sanpei Yoshiro Date: Thu, 23 Jun 2011 15:28: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: r223476 - in stable/8: share/man/man4 sys/dev/usb 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: Thu, 23 Jun 2011 15:28:55 -0000 Author: sanpei Date: Thu Jun 23 15:28:54 2011 New Revision: 223476 URL: http://svn.freebsd.org/changeset/base/223476 Log: Merge r216057 from head: Add new device ids. Buffalo (Melco Inc.) WLI-UC-G PR: 141777 Modified: stable/8/share/man/man4/rum.4 stable/8/sys/dev/usb/usbdevs stable/8/sys/dev/usb/wlan/if_rum.c Modified: stable/8/share/man/man4/rum.4 ============================================================================== --- stable/8/share/man/man4/rum.4 Thu Jun 23 15:10:44 2011 (r223475) +++ stable/8/share/man/man4/rum.4 Thu Jun 23 15:28:54 2011 (r223476) @@ -93,6 +93,7 @@ including: .It "Buffalo WLI-U2-SG54HP" Ta USB .It "Buffalo WLI-U2-SG54HG" Ta USB .It "Buffalo WLI-U2-G54HP" Ta USB +.It "Buffalo WLI-UC-G" Ta USB .It "CNet CWD-854 ver F" Ta USB .It "Conceptronic C54RU ver 2" Ta USB .It "Corega CG-WLUSB2GO" Ta USB Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Jun 23 15:10:44 2011 (r223475) +++ stable/8/sys/dev/usb/usbdevs Thu Jun 23 15:28:54 2011 (r223476) @@ -2156,6 +2156,7 @@ product MELCO SG54HG 0x00f4 WLI-U2-SG54 product MELCO WLRUCG 0x0116 WLR-UC-G product MELCO WLRUCGAOSS 0x0119 WLR-UC-G-AOSS product MELCO WLIUCAG300N 0x012e WLI-UC-AG300N +product MELCO WLIUCG 0x0137 WLI-UC-G product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 product MELCO WLIUCGN 0x015d WLI-UC-GN Modified: stable/8/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_rum.c Thu Jun 23 15:10:44 2011 (r223475) +++ stable/8/sys/dev/usb/wlan/if_rum.c Thu Jun 23 15:28:54 2011 (r223476) @@ -118,6 +118,7 @@ static const struct usb_device_id rum_de RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, WLIUCG), RUM_DEV(MELCO, WLRUCG), RUM_DEV(MELCO, WLRUCGAOSS), RUM_DEV(MSI, RT2573_1), From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 15:53:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC059106566B; Thu, 23 Jun 2011 15:53:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id DB3288FC12; Thu, 23 Jun 2011 15:53: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 p5NFrHht005778; Thu, 23 Jun 2011 15:53:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NFrHuC005776; Thu, 23 Jun 2011 15:53:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106231553.p5NFrHuC005776@svn.freebsd.org> From: John Baldwin Date: Thu, 23 Jun 2011 15:53: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: r223477 - head/sys/boot/i386/zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 15:53:18 -0000 Author: jhb Date: Thu Jun 23 15:53:17 2011 New Revision: 223477 URL: http://svn.freebsd.org/changeset/base/223477 Log: The recent change to increase the zfsboot size to 64k made a few BIOSes unhappy (probably they don't handle crossing the 64k boundary, etc.). Fix this by changing zfsldr to use a loop reading from the disk one sector at a time. To avoid trashing the saved copy of the MBR which is used for disk I/O, read zfsboot2 at address 0x9000. This has the advantage that BTX no longer needs to be relocated as it is read into the correct location. However, the loop to relocate zfsboot2.bin can now cross a 64k boundary, so change it to use relative segments instead. (This will need further work if zfsboot2.bin ever exceeds 64k.) While here, stop storing a relocated copy of zfsldr at 0x700. This was only used by the xread hack which has recently been removed (and even that use was dubious). Also, include the BIOS error code as hex when reporting read errors to aid in debugging. Much thanks to Henri Hennebert for patiently testing various iterations of the patch as well as fixing the zfsboot2.bin relocation to use relative segments. MFC after: 1 week Modified: head/sys/boot/i386/zfsboot/zfsldr.S Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Thu Jun 23 15:28:54 2011 (r223476) +++ head/sys/boot/i386/zfsboot/zfsldr.S Thu Jun 23 15:53:17 2011 (r223477) @@ -16,7 +16,6 @@ */ /* Memory Locations */ - .set MEM_REL,0x700 # Relocation address .set MEM_ARG,0x900 # Arguments .set MEM_ORG,0x7c00 # Origin .set MEM_BUF,0x8000 # Load area @@ -91,26 +90,18 @@ main: cld # String ops inc mov %cx,%ss # Set up mov $start,%sp # stack /* - * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets - * %cx == 0x100. - */ - mov %sp,%si # Source - mov $MEM_REL,%di # Destination - incb %ch # Word count - rep # Copy - movsw # code -/* * If we are on a hard drive, then load the MBR and look for the first * FreeBSD slice. We use the fake partition entry below that points to * the MBR when we call nread. The first pass looks for the first active * FreeBSD slice. The second pass looks for the first non-active FreeBSD * slice if the first one fails. */ - mov $part4,%si # Partition + mov $part4,%si # Dummy partition cmpb $0x80,%dl # Hard drive? jb main.4 # No - movb $0x1,%dh # Block count - callw nread # Read MBR + xor %eax,%eax # Read MBR + movl $MEM_BUF,%ebx # from first + callw nread # sector mov $0x1,%cx # Two passes main.1: mov $MEM_BUF+PRT_OFF,%si # Partition table movb $0x1,%dh # Partition @@ -139,52 +130,51 @@ main.4: xor %dx,%dx # Partition:drive /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 64 sectors starting at sector 1024 + * for, so go ahead and load up the 128 sectors starting at sector 1024 * (i.e. after the two vdev labels). We don't have do anything fancy * here to allow for an extra copy of boot1 and a partition table * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x8000. The first part of boot2 is BTX, which wants to run + * all at 0x9000. The first part of boot2 is BTX, which wants to run * at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the - * binary to 0xc000. After we have moved the client, we relocate BTX - * itself to 0x9000 - doing it in this order means that none of the - * memcpy regions overlap which would corrupt the copy. Normally, BTX - * clients start at MEM_USR, or 0xa000, but when we use btxld to - * create zfsboot2, we use an entry point of 0x2000. That entry point is - * relative to MEM_USR; thus boot2.bin starts at 0xc000. + * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, + * but when we use btxld to create zfsboot2, we use an entry point of + * 0x2000. That entry point is relative to MEM_USR; thus boot2.bin + * starts at 0xc000. * * The load area and the target area for the client overlap so we have * to use a decrementing string move. We also play segment register * games with the destination address for the move so that the client * can be larger than 16k (which would overflow the zero segment since - * the client starts at 0xc000). Relocating BTX is easy since the load - * area and target area do not overlap. + * the client starts at 0xc000). */ main.5: mov %dx,MEM_ARG # Save args - movb $NSECT,%dh # Sector count + mov $NSECT,%cx # Sector count movl $1024,%eax # Offset to boot2 - callw nread.1 # Read disk -main.6: mov $MEM_BUF,%si # BTX (before reloc) - mov 0xa(%si),%bx # Get BTX length and set + mov $MEM_BTX,%ebx # Destination buffer +main.6: pushal # Save params + callw nread # Read disk + popal # Restore + incl %eax # Advance to + add $SIZ_SEC,%ebx # next sector + loop main.6 # If not last, read another + mov MEM_BTX+0xa,%bx # Get BTX length mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load - add $MEM_BUF,%si # area + mov %di,%si # End of load area, 0x9000 rel sub %bx,%di # End of client, 0xc000 rel mov %di,%cx # Size of inc %cx # client + mov $(MEM_BTX)>>4,%dx # Segment + mov %dx,%ds # addressing 0x9000 mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment mov %dx,%es # addressing 0xc000 std # Move with decrement rep # Relocate movsb # client - mov %ds,%dx # Back to - mov %dx,%es # zero segment - mov $MEM_BUF,%si # BTX (before reloc) - mov $MEM_BTX,%di # BTX - mov %bx,%cx # Get BTX length - cld # Increment this time - rep # Relocate - movsb # BTX + cld # Back to increment + xor %dx,%dx # Back + mov %ds,%dx # to zero + mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. @@ -211,32 +201,35 @@ seta20.3: sti # Enable interrupts /* * Trampoline used to call read from within zfsldr. Sets up an EDD - * packet on the stack and passes it to read. + * packet on the stack and passes it to read. We assume that the + * destination address is always segment-aligned. * * %eax - int - LBA to read in relative to partition start + * %ebx - ptr - destination address * %dl - byte - drive to read from - * %dh - byte - num sectors to read * %si - ptr - MBR partition entry */ -nread: xor %eax,%eax # Sector offset in partition -nread.1: xor %ecx,%ecx # Get +nread: xor %ecx,%ecx # Get addl 0x8(%si),%eax # LBA adc $0,%ecx pushl %ecx # Starting absolute block pushl %eax # block number - push %es # Address of - push $MEM_BUF # transfer buffer - xor %ax,%ax # Number of - movb %dh,%al # blocks to - push %ax # transfer + shr $4,%ebx # Convert to segment + push %bx # Address of + push $0 # transfer buffer + push $0x1 # Read 1 sector push $0x10 # Size of packet mov %sp,%bp # Packet pointer callw read # Read from disk + jc nread.1 # If error, fail lea 0x10(%bp),%sp # Clear stack - jnc return # If success, return - mov $msg_read,%si # Otherwise, set the error - # message and fall through to - # the error routine + ret # If success, return +nread.1: mov %ah,%al # Format + mov $read_err,%di # error + call hex8 # code + mov $msg_read,%si # Set the error message and + # fall through to the error + # routine /* * Print out the error message pointed to by %ds:(%si) followed * by a prompt, wait for a keypress, and then reboot the machine. @@ -259,14 +252,6 @@ putstr: lodsb # Get char jne putstr.0 # No /* - * Overused return code. ereturn is used to return an error from the - * read function. Since we assume putstr succeeds, we (ab)use the - * same code when we return from putstr. - */ -ereturn: movb $0x1,%ah # Invalid - stc # argument -return: retw # To caller -/* * Reads sectors from the disk. If EDD is enabled, then check if it is * installed and use it if it is. If it is not installed or not enabled, then * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to @@ -294,14 +279,30 @@ read: cmpb $0x80,%dl # Hard drive? retw # To caller read.1: mov $msg_chs,%si jmp error -msg_chs: .asciz "CHS not supported" + +/* + * AL to hex, saving the result to [EDI]. + */ +hex8: push %ax # Save + shrb $0x4,%al # Do upper + call hex8.1 # 4 + pop %ax # Restore +hex8.1: andb $0xf,%al # Get lower 4 + cmpb $0xa,%al # Convert + sbbb $0x69,%al # to hex + das # digit + orb $0x20,%al # To lower case + stosb # Save char + ret # (Recursive) /* Messages */ -msg_read: .asciz "Read" -msg_part: .asciz "Boot" +msg_chs: .asciz "CHS not supported" +msg_read: .ascii "Read error: " +read_err: .asciz "XX" +msg_part: .asciz "Boot error" -prompt: .asciz " error\r\n" +prompt: .asciz "\r\n" .org PRT_OFF,0x90 From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 16:11:27 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55780106566B; Thu, 23 Jun 2011 16:11:27 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id C6F078FC14; Thu, 23 Jun 2011 16:11:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NG0ApD047404; Thu, 23 Jun 2011 20:00:10 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NG0A9i047403; Thu, 23 Jun 2011 20:00:10 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 20:00:10 +0400 From: Andrey Chernov To: Alexander Motin Message-ID: <20110623160010.GA47278@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106231510.p5NFAixO004455@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: r223475 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 16:11:27 -0000 On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Jun 23 15:10:44 2011 > New Revision: 223475 > URL: http://svn.freebsd.org/changeset/base/223475 > > Log: > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > device to never complete, that caused probe process (system boot) stuck. With that commit I have no more those "run_interrupt_driven_hooks:..." messages, but still have hang at boot related to DVD (no hang if DVDs are physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no locks are shown by 'show lock'. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 16:21:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E39B106566B; Thu, 23 Jun 2011 16:21:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5E71C8FC21; Thu, 23 Jun 2011 16:21: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 p5NGLhbI006637; Thu, 23 Jun 2011 16:21:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NGLhF2006635; Thu, 23 Jun 2011 16:21:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106231621.p5NGLhF2006635@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 Jun 2011 16:21: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: r223478 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 16:21:43 -0000 Author: marcel Date: Thu Jun 23 16:21:43 2011 New Revision: 223478 URL: http://svn.freebsd.org/changeset/base/223478 Log: Unblock the outgoing thread after we performed pmap_switch() to switch the region registers. pmap_switch() returns the pmap for which the region register are currently programmed, which needs to be re-programmed on the CPU the ougoing thread gets switched in. This change does not noticibly change anything or fix known bugs, but does give me a warm fuzzy feeling by being more correct. Modified: head/sys/ia64/ia64/machdep.c Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Thu Jun 23 15:53:17 2011 (r223477) +++ head/sys/ia64/ia64/machdep.c Thu Jun 23 16:21:43 2011 (r223478) @@ -470,12 +470,12 @@ cpu_switch(struct thread *old, struct th if (PCPU_GET(fpcurthread) == old) old->td_frame->tf_special.psr |= IA64_PSR_DFH; if (!savectx(oldpcb)) { - atomic_store_rel_ptr(&old->td_lock, mtx); - newpcb = new->td_pcb; oldpcb->pcb_current_pmap = pmap_switch(newpcb->pcb_current_pmap); + atomic_store_rel_ptr(&old->td_lock, mtx); + #if defined(SCHED_ULE) && defined(SMP) while (atomic_load_acq_ptr(&new->td_lock) == &blocked_lock) cpu_spinwait(); From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 16:25:00 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD7561065670; Thu, 23 Jun 2011 16:25:00 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6B18FC1B; Thu, 23 Jun 2011 16:24:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NGOwde047698; Thu, 23 Jun 2011 20:24:58 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NGOw9F047697; Thu, 23 Jun 2011 20:24:58 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 20:24:58 +0400 From: Andrey Chernov To: Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20110623162458.GA47670@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> <20110623160010.GA47278@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110623160010.GA47278@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r223475 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 16:25:00 -0000 On Thu, Jun 23, 2011 at 08:00:10PM +0400, Andrey Chernov wrote: > On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > > Author: mav > > Date: Thu Jun 23 15:10:44 2011 > > New Revision: 223475 > > URL: http://svn.freebsd.org/changeset/base/223475 > > > > Log: > > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > > device to never complete, that caused probe process (system boot) stuck. > > With that commit I have no more those "run_interrupt_driven_hooks:..." > messages, but still have hang at boot related to DVD (no hang if DVDs are > physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs > detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in > the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no > locks are shown by 'show lock'. More about "caplck": it was cdopen() who calls cam_periph_hold() and sleeps there forever. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 16:34:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A3FD106564A; Thu, 23 Jun 2011 16:34:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 39FCB8FC16; Thu, 23 Jun 2011 16:34: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 p5NGYgEn007390; Thu, 23 Jun 2011 16:34:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NGYgTV007387; Thu, 23 Jun 2011 16:34:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106231634.p5NGYgTV007387@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 16:34: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: r223479 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 16:34:42 -0000 Author: nwhitehorn Date: Thu Jun 23 16:34:41 2011 New Revision: 223479 URL: http://svn.freebsd.org/changeset/base/223479 Log: Clear any outstanding atomic reservations when traps are taken. This fixes some interesting bugs (mostly on SMP systems) with atomic operations silently failing in interrupt heavy situations, especially when using overflow pages. Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 16:21:43 2011 (r223478) +++ head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 16:34:41 2011 (r223479) @@ -748,6 +748,8 @@ k_trap: /* Call C interrupt dispatcher: */ trapagain: addi %r3,%r1,8 + addi %r4,%r1,-4 /* Clear any existing reservations */ + stwcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) .globl CNAME(trapexit) /* backtrace code sentinel */ CNAME(trapexit): Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 16:21:43 2011 (r223478) +++ head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 16:34:41 2011 (r223479) @@ -508,6 +508,8 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 + addi %r4,%r1,-8 /* Clear any existing reservations */ + stdcx. %r3,0,%r4 bl CNAME(powerpc_interrupt) nop From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 16:57:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390261065670; Thu, 23 Jun 2011 16:57:05 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 63ADD8FC12; Thu, 23 Jun 2011 16:57:04 +0000 (UTC) Received: by fxm11 with SMTP id 11so2082315fxm.13 for ; Thu, 23 Jun 2011 09:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=rx55yDT4P9+naxxIwJxoIEE70mjnuQlYeSCr6rnlCp8=; b=lODCAODRjDd9dOJbscfskZEUlPju9DCjRxU+EkFmQ6t9PPEtSj9lG9joiNV1AKdXFR B0Ae5be9KetoqE4I8DUOJMiq+N01pq3HSslAHSzAdTTHToHhKH5Es5JYeUG83ptFM2ur Nb1jLrKYtPCgOe+w8o9muRcE++k9khE9MFZqo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=BzmPn5ubwlsu5gTv8WegbDGyZeTszFPjsPEkorGeVElkMnstwB92TZKlGayLIK5UlU bRGsHBSrnx4ha5dSLmM6RRGAbLUJoB8mzzQ9MesZkB0EkzOVK0rirphpcRqEPk4IyVX9 TWIAfi5CJHRyLahfRju4Ku8SXbPZJc2XK3Ntk= Received: by 10.223.5.212 with SMTP id 20mr2969573faw.40.1308848223345; Thu, 23 Jun 2011 09:57:03 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id q14sm1104011faa.3.2011.06.23.09.57.00 (version=SSLv3 cipher=OTHER); Thu, 23 Jun 2011 09:57:01 -0700 (PDT) Sender: Alexander Motin Message-ID: <4E03701B.8090103@FreeBSD.org> Date: Thu, 23 Jun 2011 19:55:55 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Marcel Moolenaar References: <201106221640.p5MGejHY057164@svn.freebsd.org> <4E021C8E.8010904@FreeBSD.org> <201106221455.07540.jkim@FreeBSD.org> <201106221924.50458.jkim@FreeBSD.org> <4E028921.2040805@FreeBSD.org> <8B9DCBA3-C3EC-43EE-8BEC-858A280A2096@xcllnt.net> <4E02989F.6040703@FreeBSD.org> <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> In-Reply-To: <6D159261-7C57-4509-B41B-E440DBB4CBEA@xcllnt.net> X-Enigmail-Version: 0.96.0 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 Subject: Re: svn commit: r223426 - in head/sys: dev/acpica kern 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: Thu, 23 Jun 2011 16:57:05 -0000 Marcel Moolenaar wrote: > On Jun 22, 2011, at 6:36 PM, Alexander Motin wrote: >> Marcel Moolenaar wrote: >>> On Jun 22, 2011, at 5:30 PM, Alexander Motin wrote: >>>> Marcel Moolenaar wrote: >>>>> On Jun 22, 2011, at 4:24 PM, Jung-uk Kim wrote: >>>>>> I just realized kern_clocksource.c was excluded for arm and ia64. >>>>>> Here is updated patch. Please ignore the previous one. >>>>> Any reason why we're not adding kern_clocksource.c for them? >>>> Their event timers code still waits for refactoring. I have neither >>>> documentation nor hardware for them. Help would be appreciated. >>> Can you give me a pointer to a document orpage that describes >>> what is being refactored, why and how? >> In short, timer management code was unified and formalized. Instead of >> direct programming periodic timers from MD code and calling hard-/ >> stat-/ profclock() from there, timer hardware should be exposed to the >> MI kernel using sys/timeet.h API to allow kern_clocksource.c manage it. >> Last require calling its cpu_initclocks_bsp() and cpu_initclocks_ap() >> callbacks from MD initialization code, and cpu_idleclock() and >> cpu_activeclock() from MD cpu_idle(). >> >> Here is some references: >> man 4 eventtimers >> http://wiki.freebsd.org/201010DevSummit?action=AttachFile&do=view&target=timers.pdf >> http://svnweb.freebsd.org/base?view=revision&revision=209371 >> http://svnweb.freebsd.org/base?view=revision&revision=212541 >> >> All architectures except ia64 and non-Marvell arm are already done, so >> you may took any of them as reference. Ask me if you have any questions. > > Can you give a quick outline of how all the various clock > related initializations and support code relate, interact > or even conflict? It's getting rather convoluted and want > to make sure I get the ordering and timing right. During probe, every event timer driver initializes hardware and calls et_register(). After probe done, on SI_SUB_CLOCKS SYSINIT stage MI cpu_initclocks_bsp() called from MD cpu_initclocks() chooses the best timer, chooses best hz, stathz and profhz values according to timer capabilities and starts timer. If timer is per-CPU, it starts only BSP one. Later, on SMP APs startup, when each CPU launched, cpu_initclocks_ap() is called to start per-CPU timers there. MI code no longer calls hard-/stat-/profclock(). Instead it calls registered callback function. Callback function expects to be called in hardware interrupt context: td_intr_nesting_level should be incremented and td_intr_frame should contain interrupt trapframe pointer. You may see lapic_handle_timer() in x86/x86/local_apic.c as workaround example, if needed. cpu_startprofclock() and cpu_stopprofclock() are MI now and should be removed from MD code. MI cpu_idleclock() and cpu_activeclock() should be called from MD cpu_idle() on per-CPU basis to reprogram timer when CPU enters/exits sleep state. They should be called within critical section to delay context switch on wakeup until all skipped during sleep time events are handled (by the cpu_activeclock()). Timer calls are serialized by caller by holding spin lock (per-CPU locks for per-CPU timers). Due to disabled interrupts, you are not allowed to sleep, wait for IPIs delivery or do anything else, that may cause deadlock with other CPUs. Depending on hardware implementation, you may need to take care to not loose events on short time intervals. It is especially important in one-shot mode, as timer won't be reloaded in that case. > Also: The ITC on ia64 is a per-CPU, one short and periodic > timer that has a fixed frequency. Though the architecture > does not guarantee that counters are synchronized, nor > that all CPUs in a system run at the same frequency which > means that the ITCs may not all run at the same frequency. > Does the et code work with that or do I need to impose a > restriction on what hardware configurations to support > and/or revert to having the ITC be a global timer and run > only on the BSP? Event timer API operates in terms of bintime time intervals. It doesn't depend on timer base frequency. kern_clocksource.c uses that frequency only to calculate more suitable hz/stathz/profhz values. It will survive wrong value there, or even zero, if frequency is unknown. If base frequency differs between CPUs, event timer driver should just properly handle requested bintime value, using proper base frequency when programming timer. In one-shot mode kern_clocksource.c doesn't depend on timer precision. In periodic mode it does, but some drift between CPUs is acceptable. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 17:21:49 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C676106566C; Thu, 23 Jun 2011 17:21:49 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 9FAE38FC08; Thu, 23 Jun 2011 17:21:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p5NHLlbE048183; Thu, 23 Jun 2011 21:21:47 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p5NHLkYI048182; Thu, 23 Jun 2011 21:21:46 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Jun 2011 21:21:46 +0400 From: Andrey Chernov To: Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20110623172146.GA48158@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201106231510.p5NFAixO004455@svn.freebsd.org> <20110623160010.GA47278@vniz.net> <20110623162458.GA47670@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110623162458.GA47670@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r223475 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 17:21:49 -0000 Here is old cd0 probe message with old kernel when it was probed, just in case it helps (nothing unusual with it, and it still works under Win7): cd0 at ata2 bus 0 scbus2 target 0 lun 0 cd0: Removable CD-ROM SCSI-0 device cd0: 100.000MB/s transfers (UDMA5, ATAPI 12bytes, PIO 65534bytes) cd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed On Thu, Jun 23, 2011 at 08:24:58PM +0400, Andrey Chernov wrote: > On Thu, Jun 23, 2011 at 08:00:10PM +0400, Andrey Chernov wrote: > > On Thu, Jun 23, 2011 at 03:10:44PM +0000, Alexander Motin wrote: > > > Author: mav > > > Date: Thu Jun 23 15:10:44 2011 > > > New Revision: 223475 > > > URL: http://svn.freebsd.org/changeset/base/223475 > > > > > > Log: > > > Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI > > > device to never complete, that caused probe process (system boot) stuck. > > > > With that commit I have no more those "run_interrupt_driven_hooks:..." > > messages, but still have hang at boot related to DVD (no hang if DVDs are > > physically unplugged). Moreover, I have only 1 of 2 plain ATA DVDs > > detected in probe messages as cd1 (no cd0 there). DDB's ps show sleep in > > the xpt_thrd (xpt_scanner_thread) at "ccb_scan" and sleep at "caplck", no > > locks are shown by 'show lock'. > > More about "caplck": it was cdopen() who calls cam_periph_hold() and > sleeps there forever. > > -- > http://ache.vniz.net/ -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 17:28:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098DF1065670; Thu, 23 Jun 2011 17:28:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E8D2C8FC13; Thu, 23 Jun 2011 17:28: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 p5NHSkjm010158; Thu, 23 Jun 2011 17:28:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NHSkp3010143; Thu, 23 Jun 2011 17:28:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106231728.p5NHSkp3010143@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 23 Jun 2011 17:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223480 - in vendor-sys/acpica/dist: . compiler generate/unix generate/unix/acpibin generate/unix/acpiexec generate/unix/acpihelp generate/unix/acpinames generate/unix/acpisrc generate/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 17:28:47 -0000 Author: jkim Date: Thu Jun 23 17:28:46 2011 New Revision: 223480 URL: http://svn.freebsd.org/changeset/base/223480 Log: Import ACPICA 20110623. Added: vendor-sys/acpica/dist/generate/unix/acpibin/ vendor-sys/acpica/dist/generate/unix/acpibin/Makefile (contents, props changed) vendor-sys/acpica/dist/generate/unix/acpihelp/ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile (contents, props changed) vendor-sys/acpica/dist/tools/acpibin/ vendor-sys/acpica/dist/tools/acpibin/Makefile (contents, props changed) vendor-sys/acpica/dist/tools/acpibin/abcompare.c (contents, props changed) vendor-sys/acpica/dist/tools/acpibin/abmain.c (contents, props changed) vendor-sys/acpica/dist/tools/acpibin/acpibin.h (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ vendor-sys/acpica/dist/tools/acpihelp/Makefile (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/acpihelp.h (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahamlops.c (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahaslkey.c (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahaslops.c (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahdecode.c (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahmain.c (contents, props changed) vendor-sys/acpica/dist/tools/acpihelp/ahpredef.c (contents, props changed) Deleted: vendor-sys/acpica/dist/osunixxf.c vendor-sys/acpica/dist/tools/acpiexec/osunixdir.c vendor-sys/acpica/dist/tools/acpisrc/osunixdir.c Modified: vendor-sys/acpica/dist/README vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/compiler/Makefile vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/aslerror.c vendor-sys/acpica/dist/compiler/aslstubs.c vendor-sys/acpica/dist/generate/unix/Makefile vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpinames/Makefile vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile vendor-sys/acpica/dist/generate/unix/acpixtract/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/generate/unix/readme.txt vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/platform/acenv.h vendor-sys/acpica/dist/include/platform/aclinux.h vendor-sys/acpica/dist/include/platform/acmsvc.h vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsrepair2.c vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aemain.c vendor-sys/acpica/dist/tools/acpinames/Makefile vendor-sys/acpica/dist/tools/acpinames/anstubs.c vendor-sys/acpica/dist/tools/acpisrc/Makefile vendor-sys/acpica/dist/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/tools/acpixtract/Makefile vendor-sys/acpica/dist/tools/examples/examples.c Modified: vendor-sys/acpica/dist/README ============================================================================== --- vendor-sys/acpica/dist/README Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/README Thu Jun 23 17:28:46 2011 (r223480) @@ -1,79 +1,137 @@ -acpica-unix ------------ +Makefiles for tool generation from the unix tarball +--------------------------------------------------- -This source release includes: +These makefiles are intended to generate the ACPICA utilities in +a Linux or Unix-like environment, from the ACPICA source code +as released in the unix tarball. +Windows binary versions of these tools are available at: -1) a cross-OS AML interpreter +http://www.acpica.org/downloads/binary_tools.php -This is intended to allow commercial and open source operating systems -to be enabled for ACPI. OS specific code is still needed, but the -AML interpreter should greatly improve the development speed of ACPI -support. +Documentation is available at acpica.org: -The AML interpreter source should be integrated into the kernel's -build process. We recommend establishing an automated method for -this, so later versions can also be incorporated easily. Please see -the documentation on the website for API and other implementation -information. +http://www.acpica.org/documentation/ +The acpica/source/tools directory contains the following utilities. +Note: These utilities are tested and supported as 32-bit versions +only. -2) iasl, an ASL compiler/decompiler +acpibin +acpiexec +acpihelp +acpinames +acpisrc +acpixtract +iasl -iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine -Language). This AML is suitable for inclusion as a DSDT in system -firmware. It also can disassemble AML, for debugging purposes. + +Requirements +------------ + +make +gcc compiler (4+) +bison or yacc +flex or lex + + +Configuration +------------- + +The Makefiles contain this configuration information: + +HOST = _LINUX /* Host system, must appear in acenv.h */ +CC = gcc /* C compiler */ + + +1) acpibin, an AML file tool + +acpibin compares AML files, dumps AML binary files to text files, +extracts binary AML from text files, and other AML file +manipulation. To compile: -cd compiler +cd acpica/source/tools/acpibin make +make install /* install the binary to /usr/bin */ -It has been compiled on Linux, but should easily port to other Unix -environments. -Run 'iasl -h' for more information, or download the binary version for -documentation in PDF format. +2) acpiexec, a user-space AML interpreter +acpiexec allows the loading of ACPI tables and execution of control +methods from user space. Useful for debugging AML code and testing +the AML interpreter. Hardware access is simulated. -3) acpisrc, a source code conversion tool +To compile: + +cd acpica/source/tools/acpiexec +make +make install /* install the binary to /usr/bin */ -acpisrc converts the standard form of the acpica source release (included -here) into a version that meets Linux coding guidelines. This consists -mainly of performing a series of string replacements and transformations -to the code. + +3) acpihelp, syntax help for ASL operators and reserved names + +acpihelp displays the syntax for all of the ASL operators, as well +as information about the ASL/ACPI reserved names (4-char names that +start with underscore.) To compile: -cd tools/acpisrc +cd acpica/source/tools/acpihelp make +make install /* install the binary to /usr/bin */ -It has been compiled on Linux, but should easily port to other Unix -environments. +4) acpinames, load and dump acpi namespace -4) acpibin, an AML file tool +acpinames loads an ACPI namespace from a binary ACPI table file. +This is a smaller version of acpiexec that loads an acpi table and +dumps the resulting namespace. It is primarily intended to demonstrate +the configurability of ACPICA. -acpibin compares AML files, dumps AML binary files to text files, -extracts binary AML from text files, and other AML file -manipulation. +To compile: + +cd acpica/source/tools/acpinames +make +make install /* install the binary to /usr/bin */ + + +5) acpisrc, a source code conversion tool + +acpisrc converts the standard form of the acpica source release (included +here) into a version that meets Linux coding guidelines. This consists +mainly of performing a series of string replacements and transformations +to the code. It can also be used to clean the acpica source and generate +statistics. To compile: -cd tools/acpibin +cd acpica/source/tools/acpisrc make +make install /* install the binary to /usr/bin */ -5) acpiexec, a user-space AML interpreter +6) acpixtract, extract binary ACPI tables from an acpidump -acpiexec allows the loading of ACPI tables and execution of control -methods from user space. Useful for debugging AML code and testing -the AML interpreter. +acpixtract is used to extract binary ACPI tables from the ASCII text +output of an acpidump utility (available on several different hosts.) To compile: -cd tools/acpiexec +cd acpica/source/tools/acpixtract make +make install /* install the binary to /usr/bin */ -Thanks -- The ACPI CA Team +7) iasl, an optimizing ASL compiler/disassembler + +iasl compiles ASL (ACPI Source Language) into AML (ACPI Machine +Language). This AML is suitable for inclusion as a DSDT in system +firmware. It also can disassemble AML, for debugging purposes. + +To compile: + +cd acpica/source/compiler +make +make install /* install the binary to /usr/bin */ Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/changes.txt Thu Jun 23 17:28:46 2011 (r223480) @@ -1,7 +1,72 @@ ---------------------------------------- -27 May 2011. Summary of changes for version 20110527: +23 June 2011. Summary of changes for version 20110623: + +1) ACPI CA Core Subsystem: -This release is available at www.acpica.org/downloads +Updated the predefined name repair mechanism to not attempt repair of a _TSS +return object if a _PSS object is present. We can only sort the _TSS return +package if there is no _PSS within the same scope. This is because if _PSS is +present, the ACPI specification dictates that the _TSS Power Dissipation field +is to be ignored, and therefore some BIOSs leave garbage values in the _TSS +Power field(s). In this case, it is best to just return the _TSS package as- +is. Reported by, and fixed with assistance from Fenghua Yu. + +Added an option to globally disable the control method return value validation +and repair. This runtime option can be used to disable return value repair if +this is causing a problem on a particular machine. Also added an option to +AcpiExec (-dr) to set this disable flag. + +All makefiles and project files: Major changes to improve generation of ACPICA +tools. ACPICA BZ 912: + Reduce default optimization levels to improve compatibility + For Linux, add strict-aliasing=0 for gcc 4 + Cleanup and simplify use of command line defines + Cleanup multithread library support + Improve usage messages + +Linux-specific header: update handling of THREAD_ID and pthread. For the 32- +bit case, improve casting to eliminate possible warnings, especially with the +acpica tools. + +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 (VC 9.0): + Non-Debug Version: 90.1K Code, 23.9K Data, 114.0K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + Current Release (VC 9.0): + Non-Debug Version: 90.2K Code, 23.9K Data, 114.1K Total + Debug Version: 165.6K Code, 68.4K Data, 234.0K Total + +2) iASL Compiler/Disassembler and Tools: + +With this release, a new utility named "acpihelp" has been added to the ACPICA +package. This utility summarizes the ACPI specification chapters for the ASL +and AML languages. It generates under Linux/Unix as well as Windows, and +provides the following functionality: + Find/display ASL operator(s) -- with description and syntax. + Find/display ASL keyword(s) -- with exact spelling and descriptions. + Find/display ACPI predefined name(s) -- with description, number + of arguments, and the return value data type. + Find/display AML opcode name(s) -- with opcode, arguments, and grammar. + Decode/display AML opcode -- with opcode name, arguments, and grammar. + +Service Layers: Make multi-thread support configurable. Conditionally compile +the multi-thread support so that threading libraries will not be linked if not +necessary. The only tool that requires multi-thread support is AcpiExec. + +iASL: Update yyerrror/AslCompilerError for "const" errors. Newer versions of +Bison appear to want the interface to yyerror to be a const char * (or at +least this is a problem when generating iASL on some systems.) ACPICA BZ 923 +Pierre Lejeune. + +Tools: Fix for systems where O_BINARY is not defined. Only used for Windows +versions of the tools. + +---------------------------------------- +27 May 2011. Summary of changes for version 20110527: 1) ACPI CA Core Subsystem: Modified: vendor-sys/acpica/dist/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/compiler/Makefile Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/compiler/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -1,18 +1,57 @@ # # iASL compiler/disassembler # +# NOTE: This makefile is intended to be used in the Linux environment, +# with the Linux directory structure. It will not work directly +# on the native ACPICA source tree. +# -PROG= iasl +# +# Configuration +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. +# +PROG = iasl +HOST = _LINUX +NOMAN = YES +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? + +ACPICA_COMPONENTS = ACPICA_SRC = .. -ASL_COMPILER = $(ACPICA_SRC)/compiler ACPICA_COMMON = $(ACPICA_SRC)/common -ACPICA_CORE = $(ACPICA_SRC) +ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS) ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers +ASL_COMPILER = $(ACPICA_SRC)/compiler +INSTALLDIR = /usr/bin +INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) -NOMAN= YES -CFLAGS+= -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include -I../compiler +CFLAGS+= \ + -D$(HOST) \ + -D_GNU_SOURCE \ + -DACPI_ASL_COMPILER \ + -I$(ACPICA_SRC)/include \ + -I$(ASL_COMPILER) + +CWARNINGFLAGS = \ + -ansi \ + -Wall \ + -Wbad-function-cast \ + -Wdeclaration-after-statement \ + -Werror \ + -Wformat=2 \ + -Wmissing-declarations \ + -Wmissing-prototypes \ + -Wstrict-aliasing=0 \ + -Wstrict-prototypes \ + -Wswitch-default \ + -Wpointer-arith \ + -Wundef # # Bison/Flex configuration @@ -23,11 +62,6 @@ YFLAGS+= -v -d -y LEX= flex LFLAGS+= -i -s - -COMPILE = $(CC) -c $(CFLAGS) -o$@ $? -LDFLAGS += -lpthread -lrt - - OBJS = \ adfile.o \ adisasm.o \ @@ -182,7 +216,6 @@ MISC = \ # $(PROG) : $(INTERMEDIATES) $(OBJS) $(CC) $(OBJS) $(LDFLAGS) -o $(PROG) - $(COPYPROG) # @@ -210,16 +243,16 @@ dtparserparse.c : $(ASL_COMPILER)/dtp # by the utilities above and they are not necessarily ANSI C, etc. # aslcompilerlex.o : aslcompilerlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? aslcompilerparse.o : aslcompilerparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? dtparserlex.o : dtparserlex.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? dtparserparse.o : dtparserparse.c - $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $? + $(CC) -c $(CFLAGS) -Wall -Werror -Wstrict-aliasing=0 -o$@ $? # @@ -632,5 +665,8 @@ osunixxf.o : $(ACPICA_OSL)/osunix $(COMPILE) -clean : +clean : rm -f $(PROG) $(PROG).exe $(OBJS) $(INTERMEDIATES) $(MISC) + +install : + $(INSTALLPROG) Modified: vendor-sys/acpica/dist/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.h Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/compiler/aslcompiler.h Thu Jun 23 17:28:46 2011 (r223480) @@ -289,7 +289,7 @@ AslCoreSubsystemError ( int AslCompilererror( - char *s); + const char *s); void AslCommonError ( Modified: vendor-sys/acpica/dist/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslerror.c Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/compiler/aslerror.c Thu Jun 23 17:28:46 2011 (r223480) @@ -620,13 +620,13 @@ AslCoreSubsystemError ( int AslCompilererror ( - char *CompilerMessage) + const char *CompilerMessage) { AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, Gbl_CurrentLineNumber, - Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, - Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, - CompilerMessage); + Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, + Gbl_CurrentColumn, Gbl_Files[ASL_FILE_INPUT].Filename, + ACPI_CAST_PTR (char, CompilerMessage)); return 0; } Modified: vendor-sys/acpica/dist/compiler/aslstubs.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslstubs.c Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/compiler/aslstubs.c Thu Jun 23 17:28:46 2011 (r223480) @@ -232,3 +232,20 @@ AcpiTbFindTable ( return (AE_SUPPORT); } +/* OSL interfaces */ + +ACPI_THREAD_ID +AcpiOsGetThreadId ( + void) +{ + return (0xFFFF); +} + +ACPI_STATUS +AcpiOsExecute ( + ACPI_EXECUTE_TYPE Type, + ACPI_OSD_EXEC_CALLBACK Function, + void *Context) +{ + return (AE_SUPPORT); +} Modified: vendor-sys/acpica/dist/generate/unix/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/generate/unix/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -1,28 +1,37 @@ # # Common make for acpica tools and utilities # + +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# include Makefile.config -all: ${DIRS} -${DIRS}: FORCE +all: ${PROGS} +${PROGS}: FORCE @cd $@; make; ls -al $@ clean: FORCE - @for d in ${DIRS}; do \ + @for d in ${PROGS}; do \ (cd $$d; \ if [ $$? -ne 0 ]; then \ - echo "Bad element of DIRS: <$$d>"; \ + echo "Bad element of PROGS: <$$d>"; \ else \ pwd; make clean; \ fi); \ done install: FORCE - @for d in ${DIRS}; do \ + @for d in ${PROGS}; do \ (cd $$d; \ if [ $$? -ne 0 ]; then \ - echo "Bad element of DIRS: <$$d>"; \ + echo "Bad element of PROGS: <$$d>"; \ else \ pwd; make install; \ fi); \ Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Thu Jun 23 17:28:46 2011 (r223480) @@ -2,76 +2,94 @@ # Makefile.config # # Common configuration and setup file to generate the ACPICA tools and -# utilities: acpiexec, acpisrc, acpixtract, and the iASL compiler. +# utilities: the iASL compiler, acpiexec, acpihelp, acpinames, acpisrc, +# acpixtract, acpibin. # # This file is included by the individual makefiles for each tool. # # +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# + +# # Configuration -# Note: gcc should be version 4 or greater, otherwise some of the -# options used won't be recognized (see below) +# Notes: +# gcc should be version 4 or greater, otherwise some of the options +# used will not be recognized. +# Global optimization flags (such as -O2, -Os) are not used, since +# they cause issues on some compilers. +# The _GNU_SOURCE symbol is required for many hosts. # +PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl + HOST = _CYGWIN CC = gcc -ACPICA_SRC = ../../../source -DIRS = acpiexec acpinames acpisrc acpixtract iasl -INSTALLDIR = /usr/bin +COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? # # Common defines # -ASL_COMPILER = $(ACPICA_SRC)/compiler +ACPICA_SRC = ../../../source ACPICA_COMMON = $(ACPICA_SRC)/common ACPICA_CORE = $(ACPICA_SRC)/components ACPICA_TOOLS = $(ACPICA_SRC)/tools ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers -COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $? +ASL_COMPILER = $(ACPICA_SRC)/compiler COPYPROG = @mkdir -p ../bin; rm -f ../bin/$(PROG); cp --remove-destination $(PROG) ../bin +INSTALLDIR = /usr/bin INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR) - # # Common compiler flags. The warning flags in addition to -Wall are not # automatically included in -Wall. # -CFLAGS+= -Os -D$(HOST) -I$(ACPICA_SRC)/include -D_GNU_SOURCE +CFLAGS += \ + -D$(HOST) \ + -D_GNU_SOURCE \ + -I$(ACPICA_SRC)/include + CWARNINGFLAGS = \ - -ansi \ - -Wall \ - -Wbad-function-cast \ - -Wdeclaration-after-statement \ - -Werror \ - -Wformat=2 \ - -Wmissing-declarations \ - -Wmissing-prototypes \ - -Wstrict-aliasing=0 \ - -Wstrict-prototypes \ - -Wswitch-default \ - -Wpointer-arith \ - -Wundef + -ansi \ + -Wall \ + -Wbad-function-cast \ + -Wdeclaration-after-statement \ + -Werror \ + -Wformat=2 \ + -Wmissing-declarations \ + -Wmissing-prototypes \ + -Wstrict-aliasing=0 \ + -Wstrict-prototypes \ + -Wswitch-default \ + -Wpointer-arith \ + -Wundef # # gcc 4+ flags # -CWARNINGFLAGS+= \ - -Waddress \ - -Waggregate-return \ - -Wchar-subscripts \ - -Wempty-body \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wmissing-field-initializers \ - -Wmissing-parameter-type \ - -Wnested-externs \ - -Wold-style-declaration \ - -Wold-style-definition \ - -Wredundant-decls \ - -Wtype-limits +CWARNINGFLAGS += \ + -Waddress \ + -Waggregate-return \ + -Wchar-subscripts \ + -Wempty-body \ + -Wlogical-op \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-parameter-type \ + -Wnested-externs \ + -Wold-style-declaration \ + -Wold-style-definition \ + -Wredundant-decls \ + -Wtype-limits # # Extra warning flags (possible future use) # -#CWARNINGFLAGS+= \ +#CWARNINGFLAGS += \ # -Wcast-qual \ # -Wconversion # -Wshadow \ @@ -88,12 +106,11 @@ CWARNINGFLAGS+= \ # # Berkeley yacc configuration # -#YACC= byacc -#YFLAGS+= -v -d +#YACC= byacc +#YFLAGS += -v -d # -YACC= bison -YFLAGS+= -v -d -y - -LEX= flex -LFLAGS+= -i -s +YACC= bison +YFLAGS += -v -d -y +LEX= flex +LFLAGS += -i -s Added: vendor-sys/acpica/dist/generate/unix/acpibin/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/generate/unix/acpibin/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -0,0 +1,109 @@ +# +# acpibin - Binary ACPI table utility +# + +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# +include ../Makefile.config +PROG = acpibin + +# +# Flags specific to acpibin +# +CFLAGS+= \ + -DACPI_BIN_APP \ + -I$(ACPICA_TOOLS)/acpibin + +OBJS = \ + abcompare.o \ + abmain.o \ + utalloc.o \ + utcache.o \ + utdebug.o \ + utdecode.o \ + utglobal.o \ + utlock.o \ + utmath.o \ + utmisc.o \ + utmutex.o \ + utstate.o \ + utxferror.o \ + osunixxf.o \ + getopt.o + +# +# Root rule +# +$(PROG) : $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) + $(COPYPROG) + +# +# acpibin source +# +abcompare.o : $(ACPICA_TOOLS)/acpibin/abcompare.c + $(COMPILE) + +abmain.o : $(ACPICA_TOOLS)/acpibin/abmain.c + $(COMPILE) + +# +# ACPICA core source - common +# +getopt.o : $(ACPICA_COMMON)/getopt.c + $(COMPILE) + +# +# ACPICA core source +# +utalloc.o : $(ACPICA_CORE)/utilities/utalloc.c + $(COMPILE) + +utcache.o : $(ACPICA_CORE)/utilities/utcache.c + $(COMPILE) + +utdebug.o : $(ACPICA_CORE)/utilities/utdebug.c + $(COMPILE) + +utdecode.o : $(ACPICA_CORE)/utilities/utdecode.c + $(COMPILE) + +utglobal.o : $(ACPICA_CORE)/utilities/utglobal.c + $(COMPILE) + +utlock.o : $(ACPICA_CORE)/utilities/utlock.c + $(COMPILE) + +utmath.o : $(ACPICA_CORE)/utilities/utmath.c + $(COMPILE) + +utmisc.o : $(ACPICA_CORE)/utilities/utmisc.c + $(COMPILE) + +utmutex.o : $(ACPICA_CORE)/utilities/utmutex.c + $(COMPILE) + +utstate.o : $(ACPICA_CORE)/utilities/utstate.c + $(COMPILE) + +utxferror.o : $(ACPICA_CORE)/utilities/utxferror.c + $(COMPILE) + +# +# Unix OS services layer (OSL) +# +osunixxf.o : $(ACPICA_OSL)/osunixxf.c + $(COMPILE) + + +clean : + rm -f $(PROG) $(PROG).exe $(OBJS) + +install : + $(INSTALLPROG) Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -1,15 +1,27 @@ # -# AcpiExec utility +# acpiexec: ACPI execution simulator. Runs ACPICA code in user +# space. Loads ACPI tables, displays the namespace, and allows +# execution of control methods. # -include ../Makefile.config +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# +include ../Makefile.config PROG = acpiexec - # # Flags specific to acpiexec utility # -CFLAGS+= -DACPI_EXEC_APP -I$(ACPICA_TOOLS)/acpiexec +CFLAGS+= \ + -DACPI_EXEC_APP \ + -I$(ACPICA_TOOLS)/acpiexec +LDFLAGS += -lpthread -lrt OBJS = \ aeexec.o \ @@ -165,15 +177,13 @@ OBJS = \ utxferror.o \ utxface.o - # # Root rule # $(PROG) : $(OBJS) - $(CC) $(LDFLAGS) $(OBJS) -lpthread -o $(PROG) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) $(COPYPROG) - # # acpiexec source # @@ -189,14 +199,12 @@ aemain.o : $(ACPICA_TOOLS)/acpi aetables.o : $(ACPICA_TOOLS)/acpiexec/aetables.c $(COMPILE) - # # ACPICA core source - common # getopt.o : $(ACPICA_COMMON)/getopt.c $(COMPILE) - # # ACPICA core source # @@ -638,7 +646,6 @@ utxferror.o : $(ACPICA_CORE)/utili utxface.o : $(ACPICA_CORE)/utilities/utxface.c $(COMPILE) - # # Unix OS services layer (OSL) # @@ -646,8 +653,8 @@ osunixxf.o : $(ACPICA_OSL)/osunix $(COMPILE) -clean : +clean : rm -f $(PROG) $(PROG).exe $(OBJS) -install : +install : $(INSTALLPROG) Added: vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -0,0 +1,72 @@ +# +# acpihelp - ACPI Help utility. Displays ASL operator syntax and +# information about ACPI predefined names. +# + +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# +include ../Makefile.config +PROG = acpihelp + +# +# Flags specific to acpihelp +# +CFLAGS+= \ + -DACPI_HELP_APP \ + -I$(ACPICA_TOOLS)/acpihelp + +OBJS = \ + ahamlops.o \ + ahaslkey.o \ + ahaslops.o \ + ahdecode.o \ + ahpredef.o \ + ahmain.o \ + getopt.o + +# +# Root rule +# +$(PROG) : $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) + $(COPYPROG) + +# +# acpihelp source +# +ahamlops.o : $(ACPICA_TOOLS)/acpihelp/ahamlops.c + $(COMPILE) + +ahaslkey.o : $(ACPICA_TOOLS)/acpihelp/ahaslkey.c + $(COMPILE) + +ahaslops.o : $(ACPICA_TOOLS)/acpihelp/ahaslops.c + $(COMPILE) + +ahdecode.o : $(ACPICA_TOOLS)/acpihelp/ahdecode.c + $(COMPILE) + +ahpredef.o : $(ACPICA_TOOLS)/acpihelp/ahpredef.c + $(COMPILE) + +ahmain.o : $(ACPICA_TOOLS)/acpihelp/ahmain.c + $(COMPILE) + +# +# ACPICA core source - common +# +getopt.o : $(ACPICA_COMMON)/getopt.c + $(COMPILE) + + +clean : + rm -f $(PROG) $(PROG).exe $(OBJS) + +install : + $(INSTALLPROG) Modified: vendor-sys/acpica/dist/generate/unix/acpinames/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/generate/unix/acpinames/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -1,15 +1,26 @@ # -# AcpiNames utility +# acpinames - Load ACPI table and dump namespace. This is a subset +# of the AcpiExec functionality, it is intended to demonstrate +# the configurability of ACPICA. # -include ../Makefile.config +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. +# +include ../Makefile.config PROG = acpinames - # # Flags specific to acpinames utility # -CFLAGS+= -DACPI_APPLICATION -DACPI_SINGLE_THREADED -DACPI_DEBUGGER -I$(ACPICA_TOOLS)/acpinames +CFLAGS+= \ + -DACPI_NAMES_APP \ + -I$(ACPICA_TOOLS)/acpinames OBJS = \ anmain.o \ @@ -76,15 +87,13 @@ OBJS = \ utxferror.o \ utxface.o - # # Root rule # $(PROG) : $(OBJS) - $(CC) $(LDFLAGS) $(OBJS) -lpthread -o $(PROG) + $(CC) $(LDFLAGS) $(OBJS) -o $(PROG) $(COPYPROG) - # # acpinames source # @@ -97,14 +106,12 @@ anstubs.o : $(ACPICA_TOOLS)/acpi antables.o : $(ACPICA_TOOLS)/acpinames/antables.c $(COMPILE) - # # ACPICA core source - common # getopt.o : $(ACPICA_COMMON)/getopt.c $(COMPILE) - # # ACPICA core source # @@ -282,7 +289,6 @@ utxferror.o : $(ACPICA_CORE)/utili utxface.o : $(ACPICA_CORE)/utilities/utxface.c $(COMPILE) - # # Unix OS services layer (OSL) # @@ -290,8 +296,8 @@ osunixxf.o : $(ACPICA_OSL)/osunix $(COMPILE) -clean : +clean : rm -f $(PROG) $(PROG).exe $(OBJS) -install : +install : $(INSTALLPROG) Modified: vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile Thu Jun 23 16:34:41 2011 (r223479) +++ vendor-sys/acpica/dist/generate/unix/acpisrc/Makefile Thu Jun 23 17:28:46 2011 (r223480) @@ -1,15 +1,24 @@ # -# acpisrc utility +# acpisrc - ACPICA source code conversion utility # -include ../Makefile.config +# +# Note: This makefile is intended to be used from within the native +# ACPICA directory structure, from under generate/unix. It specifically +# places all object files in a generate/unix subdirectory, not within +# the various ACPICA source directories. This prevents collisions +# between different compilations of the same source file with different +# compile options, and prevents pollution of the source code. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 17:30:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17F9A106567A; Thu, 23 Jun 2011 17:30:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E24998FC1C; Thu, 23 Jun 2011 17:30: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 p5NHUYsu010253; Thu, 23 Jun 2011 17:30:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NHUYYR010252; Thu, 23 Jun 2011 17:30:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106231730.p5NHUYYR010252@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 23 Jun 2011 17:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223481 - vendor-sys/acpica/20110623 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 17:30:35 -0000 Author: jkim Date: Thu Jun 23 17:30:34 2011 New Revision: 223481 URL: http://svn.freebsd.org/changeset/base/223481 Log: Tag ACPICA 20110623. Added: vendor-sys/acpica/20110623/ - copied from r223480, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 17:42:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E165106566B; Thu, 23 Jun 2011 17:42:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1FD8FC13; Thu, 23 Jun 2011 17:42: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 p5NHgRtp010609; Thu, 23 Jun 2011 17:42:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NHgREN010607; Thu, 23 Jun 2011 17:42:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201106231742.p5NHgREN010607@svn.freebsd.org> From: Jack F Vogel Date: Thu, 23 Jun 2011 17:42: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: r223482 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 17:42:27 -0000 Author: jfv Date: Thu Jun 23 17:42:27 2011 New Revision: 223482 URL: http://svn.freebsd.org/changeset/base/223482 Log: Put back the global for rx processing due to popular demand. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Jun 23 17:30:34 2011 (r223481) +++ head/sys/dev/e1000/if_igb.c Thu Jun 23 17:42:27 2011 (r223482) @@ -346,6 +346,10 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_hea static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); +/* How many packets rxeof tries to clean at a time */ +static int igb_rx_process_limit = 100; +TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); + /********************************************************************* * Device identification routine * @@ -465,7 +469,7 @@ igb_attach(device_t dev) /* Sysctl for limiting the amount of work done in the taskqueue */ igb_set_sysctl_value(adapter, "rx_processing_limit", "max number of rx packets to process", - &adapter->rx_process_limit, 100); + &adapter->rx_process_limit, igb_rx_process_limit); /* * Validate number of transmit and receive descriptors. It From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 18:41:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 970E51065673; Thu, 23 Jun 2011 18:41:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 506FA8FC1B; Thu, 23 Jun 2011 18:41:29 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5NIVa0p009926 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 12:31:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> Date: Thu, 23 Jun 2011 12:30:45 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 23 Jun 2011 12:31:38 -0600 (MDT) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223464 - 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, 23 Jun 2011 18:41:29 -0000 On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >=20 > On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >=20 >> Author: alc >> Date: Thu Jun 23 05:23:59 2011 >> New Revision: 223464 >> URL: http://svn.freebsd.org/changeset/base/223464 >>=20 >> Log: >> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >> MIPS. (At present, although atomic_clear_char() is defined by = atomic.h >> on MIPS, it is not actually implemented by support.S.) >=20 > Thanks, > and good catch on the atomics even if not planned, just in time for = 9.0:) Yea, there's some work there to fix them... Not sure we can even fix = some of them atomically... Warner= From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 20:03:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B1FC1065670; Thu, 23 Jun 2011 20:03:29 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh5.mail.rice.edu (mh5.mail.rice.edu [128.42.199.32]) by mx1.freebsd.org (Postfix) with ESMTP id 2297D8FC15; Thu, 23 Jun 2011 20:03:29 +0000 (UTC) Received: from mh5.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh5.mail.rice.edu (Postfix) with ESMTP id 7E41829011B; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh5.mail.rice.edu, auth channel Received: from mh5.mail.rice.edu ([127.0.0.1]) by mh5.mail.rice.edu (mh5.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id pmwLqZW9DZc1; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) Received: from [10.74.20.46] (staff-74-dun20-046.rice.edu [10.74.20.46]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh5.mail.rice.edu (Postfix) with ESMTPSA id 3CDC429011A; Thu, 23 Jun 2011 15:03:28 -0500 (CDT) Message-ID: <4E039C0F.10505@rice.edu> Date: Thu, 23 Jun 2011 15:03:27 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Warner Losh References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r223464 - 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, 23 Jun 2011 20:03:29 -0000 On 6/23/2011 1:30 PM, Warner Losh wrote: > On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: > >> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >> >>> Author: alc >>> Date: Thu Jun 23 05:23:59 2011 >>> New Revision: 223464 >>> URL: http://svn.freebsd.org/changeset/base/223464 >>> >>> Log: >>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>> MIPS. (At present, although atomic_clear_char() is defined by atomic.h >>> on MIPS, it is not actually implemented by support.S.) >> Thanks, >> and good catch on the atomics even if not planned, just in time for 9.0:) > Yea, there's some work there to fix them... Not sure we can even fix some of them atomically... > I'm not sure that I understand what you mean by the second statement. Can you elaborate? The 8- and 16-bit operations should be no less "atomic" than the 32- and 64-bit operations. In general, regardless of the size of the operation, the "sc" instruction may fail and the whole operation has to be restarted if another processor (or I/O device) performs a concurrent, cache coherent store to the same location (or even cache line) as the "ll" and "sc" instructions are operating on. On the other hand, if the "sc" instruction succeeds, whether you used it to change all of the 32 bits or just 8 of the 32 bits, it should appear as an atomic change to any other processor. Alan > Warner From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 20:31:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 313341065670; Thu, 23 Jun 2011 20:31:53 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC6F8FC14; Thu, 23 Jun 2011 20:31: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 p5NKVrSp015460; Thu, 23 Jun 2011 20:31:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NKVqCd015456; Thu, 23 Jun 2011 20:31:52 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201106232031.p5NKVqCd015456@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 23 Jun 2011 20:31:52 +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: r223483 - in head/sys/modules: cxgbe/if_cxgbe nfscl nfscommon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 20:31:53 -0000 Author: uqs Date: Thu Jun 23 20:31:52 2011 New Revision: 223483 URL: http://svn.freebsd.org/changeset/base/223483 Log: Fix make buildworld -DMODULES_WITH_WORLD Sort opt_ srcs Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile head/sys/modules/nfscl/Makefile head/sys/modules/nfscommon/Makefile Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -10,6 +10,7 @@ SRCS = t4_main.c t4_sge.c t4_l2t.c SRCS+= t4_hw.c SRCS+= device_if.h bus_if.h pci_if.h SRCS+= opt_inet.h +SRCS+= opt_ofed.h CFLAGS+= -I${CXGBE} Modified: head/sys/modules/nfscl/Makefile ============================================================================== --- head/sys/modules/nfscl/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/nfscl/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -14,13 +14,14 @@ SRCS= vnode_if.h \ nfs_clsubs.c \ nfs_clvfsops.c \ nfs_clvnops.c \ + opt_bootp.h \ opt_inet.h \ opt_inet6.h \ - opt_bootp.h \ - opt_nfsroot.h \ + opt_kdtrace.h \ + opt_kgssapi.h \ opt_nfs.h \ - opt_ufs.h \ - opt_kgssapi.h + opt_nfsroot.h \ + opt_ufs.h .if !defined(KERNBUILDDIR) NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel Modified: head/sys/modules/nfscommon/Makefile ============================================================================== --- head/sys/modules/nfscommon/Makefile Thu Jun 23 17:42:27 2011 (r223482) +++ head/sys/modules/nfscommon/Makefile Thu Jun 23 20:31:52 2011 (r223483) @@ -7,9 +7,10 @@ SRCS= vnode_if.h \ nfs_commonkrpc.c \ nfs_commonport.c \ nfs_commonsubs.c \ - opt_kgssapi.h \ - opt_ufs.h \ opt_inet6.h \ - opt_nfs.h + opt_kdtrace.h \ + opt_kgssapi.h \ + opt_nfs.h \ + opt_ufs.h .include From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 20:54:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4FF106564A; Thu, 23 Jun 2011 20:54:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5D16D8FC1A; Thu, 23 Jun 2011 20:54: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 p5NKsiIc016108; Thu, 23 Jun 2011 20:54:44 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NKsiZo016106; Thu, 23 Jun 2011 20:54:44 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106232054.p5NKsiZo016106@svn.freebsd.org> From: Dimitry Andric Date: Thu, 23 Jun 2011 20:54: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: r223484 - head/contrib/binutils/gas/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 20:54:44 -0000 Author: dim Date: Thu Jun 23 20:54:44 2011 New Revision: 223484 URL: http://svn.freebsd.org/changeset/base/223484 Log: Make GNU as recognize the ARM 'rrx' mnemonic, which can be generated by clang for certain expressions. Code taken from Apple cctools (GPLv2). Submitted by: damjan.marion@gmail.com Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Thu Jun 23 20:31:52 2011 (r223483) +++ head/contrib/binutils/gas/config/tc-arm.c Thu Jun 23 20:54:44 2011 (r223484) @@ -9974,6 +9974,13 @@ do_t_rbit (void) } static void +do_t_rd_rm (void) +{ + inst.instruction |= inst.operands[0].reg << 8; + inst.instruction |= inst.operands[1].reg; +} + +static void do_t_rev (void) { if (inst.operands[0].reg <= 7 && inst.operands[1].reg <= 7 @@ -14901,6 +14908,9 @@ static const struct asm_opcode insns[] = TCE(rsb, 0600000, ebc00000, 3, (RR, oRR, SH), arit, t_rsb), TC3(rsbs, 0700000, ebd00000, 3, (RR, oRR, SH), arit, t_rsb), + TCE(rrx, 1a00060, ea4f0030, 2, (RR, RR), rd_rm, t_rd_rm), + TCE(rrxs, 1b00060, ea5f0030, 2, (RR, RR), rd_rm, t_rd_rm), + #undef THUMB_VARIANT #define THUMB_VARIANT &arm_ext_v6 TCE(cpy, 1a00000, 4600, 2, (RR, RR), rd_rm, t_cpy), From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 21:14:58 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5FF106566B; Thu, 23 Jun 2011 21:14:58 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.vlsi.ee.noda.tus.ac.jp (sekine00.ee.noda.sut.ac.jp [133.31.107.40]) by mx1.freebsd.org (Postfix) with ESMTP id D893F8FC0A; Thu, 23 Jun 2011 21:14:57 +0000 (UTC) Received: from alph.allbsd.org (p3028-ipbf608funabasi.chiba.ocn.ne.jp [125.175.94.28]) (user=hrs mech=DIGEST-MD5 bits=128) by mail.vlsi.ee.noda.tus.ac.jp (8.14.4/8.14.4) with ESMTP id p5NLEdMZ017333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jun 2011 06:14:49 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id p5NLEbEs014610; Fri, 24 Jun 2011 06:14:39 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Fri, 24 Jun 2011 06:12:56 +0900 (JST) Message-Id: <20110624.061256.691231118744985461.hrs@allbsd.org> To: sanpei@FreeBSD.org From: Hiroki Sato In-Reply-To: <201106231528.p5NFSse9005008@svn.freebsd.org> References: <201106231528.p5NFSse9005008@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Jun_24_06_12_56_2011_896)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.vlsi.ee.noda.tus.ac.jp [133.31.107.40]); Fri, 24 Jun 2011 06:14:49 +0900 (JST) X-Spam-Status: No, score=2.8 required=14.0 tests=BAYES_50, CONTENT_TYPE_PRESENT, RCVD_IN_RP_RNBL, SPF_SOFTFAIL, X_MAILER_PRESENT autolearn=no version=3.3.1 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.vlsi.ee.noda.tus.ac.jp Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r223476 - in stable/8: share/man/man4 sys/dev/usb 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: Thu, 23 Jun 2011 21:14:58 -0000 ----Security_Multipart(Fri_Jun_24_06_12_56_2011_896)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit MIHIRA Sanpei Yoshiro wrote in <201106231528.p5NFSse9005008@svn.freebsd.org>: sa> Author: sanpei sa> Date: Thu Jun 23 15:28:54 2011 sa> New Revision: 223476 sa> URL: http://svn.freebsd.org/changeset/base/223476 sa> sa> Log: sa> Merge r216057 from head: sa> Add new device ids. sa> Buffalo (Melco Inc.) WLI-UC-G sa> sa> PR: 141777 sa> sa> Modified: sa> stable/8/share/man/man4/rum.4 sa> stable/8/sys/dev/usb/usbdevs sa> stable/8/sys/dev/usb/wlan/if_rum.c sa> I am wondering why svn:mergeinfo was not updated by this merge. Did you use svn merge? -- Hiroki ----Security_Multipart(Fri_Jun_24_06_12_56_2011_896)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk4DrFkACgkQTyzT2CeTzy3HfgCdHJ9gUTseFrVC98eg9g+k0+wF KFQAnRuKgAuarg+eNqMDKdwDV+rVLO3b =zgm0 -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Jun_24_06_12_56_2011_896)---- From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 21:18:36 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE8E6106564A; Thu, 23 Jun 2011 21:18:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 869528FC15; Thu, 23 Jun 2011 21:18:36 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5NLG8Nh011366 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 23 Jun 2011 15:16:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <4E039C0F.10505@rice.edu> Date: Thu, 23 Jun 2011 15:15:26 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <80DB2C1D-8C66-440D-ADF3-1FBD24D4D116@bsdimp.com> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> To: Alan Cox X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 23 Jun 2011 15:16:10 -0600 (MDT) Cc: Alan Cox , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , src-committers@FreeBSD.org Subject: Re: svn commit: r223464 - 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, 23 Jun 2011 21:18:36 -0000 On Jun 23, 2011, at 2:03 PM, Alan Cox wrote: > On 6/23/2011 1:30 PM, Warner Losh wrote: >> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >>=20 >>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>>=20 >>>> Author: alc >>>> Date: Thu Jun 23 05:23:59 2011 >>>> New Revision: 223464 >>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>>=20 >>>> Log: >>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() = on >>>> MIPS. (At present, although atomic_clear_char() is defined by = atomic.h >>>> on MIPS, it is not actually implemented by support.S.) >>> Thanks, >>> and good catch on the atomics even if not planned, just in time for = 9.0:) >> Yea, there's some work there to fix them... Not sure we can even fix = some of them atomically... >>=20 >=20 > I'm not sure that I understand what you mean by the second statement. = Can you elaborate? The 8- and 16-bit operations should be no less = "atomic" than the 32- and 64-bit operations. In general, regardless of = the size of the operation, the "sc" instruction may fail and the whole = operation has to be restarted if another processor (or I/O device) = performs a concurrent, cache coherent store to the same location (or = even cache line) as the "ll" and "sc" instructions are operating on. On = the other hand, if the "sc" instruction succeeds, whether you used it to = change all of the 32 bits or just 8 of the 32 bits, it should appear as = an atomic change to any other processor. I was thinking of the unaligned 16-bit case. Properly aligned I suppose = is a requirement, so I retract my statement: those are easy to = implement. Warner= From owner-svn-src-all@FreeBSD.ORG Thu Jun 23 22:21:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7B21065672; Thu, 23 Jun 2011 22:21:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2B9D38FC17; Thu, 23 Jun 2011 22: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 p5NMLTwT019059; Thu, 23 Jun 2011 22:21:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5NMLSFj019042; Thu, 23 Jun 2011 22:21:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106232221.p5NMLSFj019042@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 23 Jun 2011 22:21: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: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2011 22:21:29 -0000 Author: nwhitehorn Date: Thu Jun 23 22:21:28 2011 New Revision: 223485 URL: http://svn.freebsd.org/changeset/base/223485 Log: Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64) instead of a PCPU field for curthread. This averts a race on SMP systems with a high interrupt rate where the thread looking up the value of curthread could be preempted and migrated between obtaining the PCPU pointer and reading the value of pc_curthread, resulting in curthread being observed to be the current thread on the thread's original CPU. This played merry havoc with the system, in particular with mutexes. Many thanks to jhb for helping me work this one out. Note that Book-E is in principle susceptible to the same problem, but has not been modified yet due to lack of Book-E hardware. MFC after: 2 weeks Modified: head/sys/powerpc/aim/copyinout.c head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/aim/swtch32.S head/sys/powerpc/aim/swtch64.S head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/copyinout.c head/sys/powerpc/booke/interrupt.c head/sys/powerpc/booke/trap.c head/sys/powerpc/include/pcpu.h head/sys/powerpc/ofw/ofwcall32.S head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/aim/copyinout.c ============================================================================== --- head/sys/powerpc/aim/copyinout.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/copyinout.c Thu Jun 23 22:21:28 2011 (r223485) @@ -142,7 +142,7 @@ copyout(const void *kaddr, void *udaddr, char *up, *p; size_t l; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -183,7 +183,7 @@ copyin(const void *udaddr, void *kaddr, char *kp, *p; size_t l; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -225,7 +225,7 @@ copyinstr(const void *udaddr, void *kadd size_t l; int rv, c; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; if (setfault(env)) { @@ -267,7 +267,7 @@ subyte(void *addr, int byte) faultbuf env; char *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (char *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -293,7 +293,7 @@ suword32(void *addr, int word) faultbuf env; int *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (int *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -319,7 +319,7 @@ suword(void *addr, long word) faultbuf env; long *p; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -359,7 +359,7 @@ fubyte(const void *addr) u_char *p; int val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (u_char *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -385,7 +385,7 @@ fuword32(const void *addr) faultbuf env; int32_t *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (int32_t *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -411,7 +411,7 @@ fuword(const void *addr) faultbuf env; long *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -444,7 +444,7 @@ casuword32(volatile uint32_t *addr, uint faultbuf env; uint32_t *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (uint32_t *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); @@ -489,7 +489,7 @@ casuword(volatile u_long *addr, u_long o faultbuf env; u_long *p, val; - td = PCPU_GET(curthread); + td = curthread; pm = &td->td_proc->p_vmspace->vm_pmap; p = (u_long *)(USER_ADDR + ((uintptr_t)addr & ~SEGMENT_MASK)); Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/locore32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -181,8 +181,7 @@ setfault: mflr 0 mfcr 12 mfsprg 4,0 - lwz 4,PC_CURTHREAD(4) - lwz 4,TD_PCB(4) + lwz 4,TD_PCB(2) /* curthread = r2 */ stw 3,PCB_ONFAULT(4) stw 0,0(3) stw 1,4(3) Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/locore64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -203,8 +203,7 @@ ASENTRY(setfault) mflr 0 mfcr 12 mfsprg 4,0 - ld 4,PC_CURTHREAD(4) - ld 4,TD_PCB(4) + ld 4,TD_PCB(13) /* curthread = r13 */ std 3,PCB_ONFAULT(4) std 0,0(3) std 1,8(3) Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/machdep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -303,7 +303,7 @@ powerpc_init(vm_offset_t startkernel, vm */ pc = __pcpu; pcpu_init(pc, 0, sizeof(struct pcpu)); - pc->pc_curthread = &thread0; + curthread_reg = pc->pc_curthread = &thread0; pc->pc_cpuid = 0; __asm __volatile("mtsprg 0, %0" :: "r"(pc)); @@ -745,7 +745,7 @@ kcopy(const void *src, void *dst, size_t faultbuf env, *oldfault; int rv; - td = PCPU_GET(curthread); + td = curthread; oldfault = td->td_pcb->pcb_onfault; if ((rv = setfault(env)) != 0) { td->td_pcb->pcb_onfault = oldfault; Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/mp_cpudep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -88,7 +88,7 @@ cpudep_ap_bootstrap(void) msr = PSL_KERNSET & ~PSL_EE; mtmsr(msr); - pcpup->pc_curthread = pcpup->pc_idlethread; + curthread_reg = pcpup->pc_curthread = pcpup->pc_idlethread; pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; sp = pcpup->pc_curpcb->pcb_sp; Modified: head/sys/powerpc/aim/swtch32.S ============================================================================== --- head/sys/powerpc/aim/swtch32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/swtch32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -69,7 +69,7 @@ * void cpu_throw(struct thread *old, struct thread *new) */ ENTRY(cpu_throw) - mr %r15, %r4 + mr %r2, %r4 b cpu_switchin /* @@ -89,10 +89,9 @@ ENTRY(cpu_switch) mflr %r16 /* Save the link register */ stw %r16,PCB_LR(%r6) stw %r1,PCB_SP(%r6) /* Save the stack pointer */ - stw %r2,PCB_TOC(%r6) /* Save the TOC pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ - mr %r15,%r4 /* and the new thread ptr in scratch */ + mr %r2,%r4 /* and the new thread ptr in curthread */ mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ @@ -122,24 +121,24 @@ cpu_switchin: lis %r6,blocked_lock@ha addi %r6,%r6,blocked_lock@l blocked_loop: - lwz %r7,TD_LOCK(%r15) + lwz %r7,TD_LOCK(%r2) cmpw %r6,%r7 beq blocked_loop #endif mfsprg %r7,0 /* Get the pcpu pointer */ - stw %r15,PC_CURTHREAD(%r7) /* Store new current thread */ - lwz %r17,TD_PCB(%r15) /* Store new current PCB */ + stw %r2,PC_CURTHREAD(%r7) /* Store new current thread */ + lwz %r17,TD_PCB(%r2) /* Store new current PCB */ stw %r17,PC_CURPCB(%r7) - mr %r3,%r15 /* Get new thread ptr */ + mr %r3,%r2 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ lwz %r6, PCB_FLAGS(%r17) /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU beq .L3 - mr %r3,%r15 /* Pass curthread to enable_fpu */ + mr %r3,%r2 /* Pass curthread to enable_fpu */ bl enable_fpu .L3: @@ -147,7 +146,7 @@ blocked_loop: /* Restore Altivec context if needed */ andi. %r6, %r6, PCB_VEC beq .L4 - mr %r3,%r15 /* Pass curthread to enable_vec */ + mr %r3,%r2 /* Pass curthread to enable_vec */ bl enable_vec /* thread to restore is in r3 */ @@ -163,7 +162,6 @@ blocked_loop: mtsr USER_SR,%r5 isync lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ - lwz %r2,PCB_TOC(%r3) /* Load the TOC pointer */ /* * Perform a dummy stwcx. to clear any reservations we may have * inherited from the previous thread. It doesn't matter if the Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/swtch64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -69,7 +69,7 @@ * void cpu_throw(struct thread *old, struct thread *new) */ ENTRY(cpu_throw) - mr %r15, %r4 + mr %r13, %r4 b cpu_switchin /* @@ -83,7 +83,6 @@ ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ - std %r13,PCB_CONTEXT+1*8(%r6) std %r14,PCB_CONTEXT+2*8(%r6) std %r15,PCB_CONTEXT+3*8(%r6) std %r16,PCB_CONTEXT+4*8(%r6) @@ -111,7 +110,7 @@ ENTRY(cpu_switch) std %r2,PCB_TOC(%r6) /* Save the TOC pointer */ mr %r14,%r3 /* Copy the old thread ptr... */ - mr %r15,%r4 /* and the new thread ptr in scratch */ + mr %r13,%r4 /* and the new thread ptr in curthread*/ mr %r16,%r5 /* and the new lock */ mr %r17,%r6 /* and the PCB */ @@ -148,19 +147,19 @@ cpu_switchin: lis %r6,blocked_lock@ha addi %r6,%r6,blocked_lock@l blocked_loop: - ld %r7,TD_LOCK(%r15) + ld %r7,TD_LOCK(%r13) cmpd %r6,%r7 beq blocked_loop #endif mfsprg %r7,0 /* Get the pcpu pointer */ - std %r15,PC_CURTHREAD(%r7) /* Store new current thread */ - ld %r17,TD_PCB(%r15) /* Store new current PCB */ + std %r13,PC_CURTHREAD(%r7) /* Store new current thread */ + ld %r17,TD_PCB(%r13) /* Store new current PCB */ std %r17,PC_CURPCB(%r7) stdu %r1,-48(%r1) - mr %r3,%r15 /* Get new thread ptr */ + mr %r3,%r13 /* Get new thread ptr */ bl pmap_activate /* Activate the new address space */ nop @@ -168,7 +167,7 @@ blocked_loop: /* Restore FPU context if needed */ andi. %r6, %r6, PCB_FPU beq .L3 - mr %r3,%r15 /* Pass curthread to enable_fpu */ + mr %r3,%r13 /* Pass curthread to enable_fpu */ bl enable_fpu nop @@ -177,7 +176,7 @@ blocked_loop: /* Restore Altivec context if needed */ andi. %r6, %r6, PCB_VEC beq .L4 - mr %r3,%r15 /* Pass curthread to enable_vec */ + mr %r3,%r13 /* Pass curthread to enable_vec */ bl enable_vec nop @@ -186,7 +185,6 @@ blocked_loop: addi %r1,%r1,48 mr %r3,%r17 /* Recover PCB ptr */ ld %r12,PCB_CONTEXT(%r3) /* Load the non-volatile GP regs. */ - ld %r13,PCB_CONTEXT+1*8(%r3) ld %r14,PCB_CONTEXT+2*8(%r3) ld %r15,PCB_CONTEXT+3*8(%r3) ld %r16,PCB_CONTEXT+4*8(%r3) Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap.c Thu Jun 23 22:21:28 2011 (r223485) @@ -149,7 +149,7 @@ trap(struct trapframe *frame) PCPU_INC(cnt.v_trap); - td = PCPU_GET(curthread); + td = curthread; p = td->td_proc; type = ucode = frame->exc; @@ -452,7 +452,7 @@ syscall(struct trapframe *frame) struct syscall_args sa; int error; - td = PCPU_GET(curthread); + td = curthread; td->td_frame = frame; #ifdef __powerpc64__ @@ -600,7 +600,7 @@ badaddr_read(void *addr, size_t size, in /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = 0; Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap_subr32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -155,9 +155,15 @@ stw %r28,FRAME_AIM_DAR+8(1); \ stw %r29,FRAME_AIM_DSISR+8(1); /* save dsisr/srr0/srr1 */ \ stw %r30,FRAME_SRR0+8(1); \ - stw %r31,FRAME_SRR1+8(1) + stw %r31,FRAME_SRR1+8(1); \ + lwz %r2,PC_CURTHREAD(%r2) /* set curthread pointer */ #define FRAME_LEAVE(savearea) \ +/* Disable exceptions: */ \ + mfmsr %r2; \ + andi. %r2,%r2,~PSL_EE@l; \ + mtmsr %r2; \ + isync; \ /* Now restore regs: */ \ lwz %r2,FRAME_SRR0+8(%r1); \ lwz %r3,FRAME_SRR1+8(%r1); \ @@ -209,7 +215,7 @@ mtsprg3 %r3; \ /* Disable translation, machine check and recoverability: */ \ mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ + andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ mtmsr %r2; \ isync; \ /* Decide whether we return to user mode: */ \ @@ -764,8 +770,8 @@ CNAME(trapexit): bf 17,1f /* branch if PSL_PR is false */ GET_CPUINFO(%r3) /* get per-CPU pointer */ - lwz %r4, PC_CURTHREAD(%r3) /* deref to get curthread */ - lwz %r4, TD_FLAGS(%r4) /* get thread flags value */ + lwz %r4, TD_FLAGS(%r2) /* get thread flags value + * (r2 is curthread) */ lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l and. %r4,%r4,%r5 Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/aim/trap_subr64.S Thu Jun 23 22:21:28 2011 (r223485) @@ -179,9 +179,15 @@ restore_kernsrs: std %r28,FRAME_AIM_DAR+48(1); \ std %r29,FRAME_AIM_DSISR+48(1); /* save dsisr/srr0/srr1 */ \ std %r30,FRAME_SRR0+48(1); \ - std %r31,FRAME_SRR1+48(1) + std %r31,FRAME_SRR1+48(1); \ + ld %r13,PC_CURTHREAD(%r2) /* set kernel curthread */ #define FRAME_LEAVE(savearea) \ +/* Disable exceptions: */ \ + mfmsr %r2; \ + andi. %r2,%r2,~PSL_EE@l; \ + mtmsr %r2; \ + isync; \ /* Now restore regs: */ \ ld %r2,FRAME_SRR0+48(%r1); \ ld %r3,FRAME_SRR1+48(%r1); \ @@ -233,7 +239,7 @@ restore_kernsrs: mtsprg3 %r3; \ /* Disable translation, machine check and recoverability: */ \ mfmsr %r2; \ - andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_EE|PSL_ME|PSL_RI)@l; \ + andi. %r2,%r2,~(PSL_DR|PSL_IR|PSL_ME|PSL_RI)@l; \ mtmsr %r2; \ isync; \ /* Decide whether we return to user mode: */ \ @@ -526,8 +532,7 @@ CNAME(trapexit): bf 17,1f /* branch if PSL_PR is false */ GET_CPUINFO(%r3) /* get per-CPU pointer */ - ld %r4, PC_CURTHREAD(%r3) /* deref to get curthread */ - lwz %r4, TD_FLAGS(%r4) /* get thread flags value */ + lwz %r4, TD_FLAGS(%r13) /* get thread flags value */ lis %r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@h ori %r5,%r5, (TDF_ASTPENDING|TDF_NEEDRESCHED)@l and. %r4,%r4,%r5 Modified: head/sys/powerpc/booke/copyinout.c ============================================================================== --- head/sys/powerpc/booke/copyinout.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/copyinout.c Thu Jun 23 22:21:28 2011 (r223485) @@ -87,7 +87,7 @@ copyout(const void *kaddr, void *udaddr, if (!is_uaddr(udaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -109,7 +109,7 @@ copyin(const void *udaddr, void *kaddr, if (!is_uaddr(udaddr) || is_uaddr(kaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -135,7 +135,7 @@ copyinstr(const void *udaddr, void *kadd if (!is_uaddr(udaddr) || is_uaddr(kaddr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -175,7 +175,7 @@ subyte(void *addr, int byte) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -197,7 +197,7 @@ suword(void *addr, long word) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -228,7 +228,7 @@ fubyte(const void *addr) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -251,7 +251,7 @@ fuword(const void *addr) if (!is_uaddr(addr)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; @@ -288,7 +288,7 @@ casuword(volatile u_long *addr, u_long o if (!((vm_offset_t)addr <= VM_MAXUSER_ADDRESS)) return (EFAULT); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = NULL; Modified: head/sys/powerpc/booke/interrupt.c ============================================================================== --- head/sys/powerpc/booke/interrupt.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/interrupt.c Thu Jun 23 22:21:28 2011 (r223485) @@ -118,7 +118,7 @@ powerpc_decr_interrupt(struct trapframe struct thread *td; struct trapframe *oldframe; - td = PCPU_GET(curthread); + td = curthread; critical_enter(); atomic_add_int(&td->td_intr_nesting_level, 1); oldframe = td->td_intr_frame; Modified: head/sys/powerpc/booke/trap.c ============================================================================== --- head/sys/powerpc/booke/trap.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/booke/trap.c Thu Jun 23 22:21:28 2011 (r223485) @@ -145,7 +145,7 @@ trap(struct trapframe *frame) PCPU_INC(cnt.v_trap); - td = PCPU_GET(curthread); + td = curthread; p = td->td_proc; type = frame->exc; @@ -382,7 +382,7 @@ syscall(struct trapframe *frame) struct syscall_args sa; int error; - td = PCPU_GET(curthread); + td = curthread; td->td_frame = frame; error = syscallenter(td, &sa); @@ -480,7 +480,7 @@ badaddr_read(void *addr, size_t size, in /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); - td = PCPU_GET(curthread); + td = curthread; if (setfault(env)) { td->td_pcb->pcb_onfault = 0; Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/include/pcpu.h Thu Jun 23 22:21:28 2011 (r223485) @@ -135,6 +135,14 @@ struct pmap; #ifdef _KERNEL #define pcpup ((struct pcpu *) powerpc_get_pcpup()) +#ifdef __powerpc64__ +register struct thread *curthread_reg __asm("%r13"); +#else +register struct thread *curthread_reg __asm("%r2"); +#endif +#ifdef AIM /* Book-E not yet adapted */ +#define curthread curthread_reg +#endif #define PCPU_GET(member) (pcpup->pc_ ## member) Modified: head/sys/powerpc/ofw/ofwcall32.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall32.S Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/ofw/ofwcall32.S Thu Jun 23 22:21:28 2011 (r223485) @@ -87,10 +87,11 @@ ASENTRY(ofwcall) * later. */ mr %r5,%r1 - lis %r1,(ofwstk+OFWSTKSZ-16)@ha - addi %r1,%r1,(ofwstk+OFWSTKSZ-16)@l - stw %r5,8(%r1) /* Save real stack pointer */ - stw %r6,12(%r1) /* Save old MSR */ + lis %r1,(ofwstk+OFWSTKSZ-32)@ha + addi %r1,%r1,(ofwstk+OFWSTKSZ-32)@l + stw %r5,20(%r1) /* Save real stack pointer */ + stw %r2,24(%r1) /* Save curthread */ + stw %r6,28(%r1) /* Save old MSR */ li %r5,0 stw %r5,4(%r1) stw %r5,0(%r1) @@ -100,8 +101,9 @@ ASENTRY(ofwcall) bctrl /* Reload stack pointer and MSR from the OFW stack */ - lwz %r6,12(%r1) - lwz %r1,8(%r1) + lwz %r6,28(%r1) + lwz %r2,24(%r1) + lwz %r1,20(%r1) /* Now set the real MSR */ mtmsr %r6 Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Thu Jun 23 20:54:44 2011 (r223484) +++ head/sys/powerpc/powerpc/mp_machdep.c Thu Jun 23 22:21:28 2011 (r223485) @@ -96,10 +96,6 @@ machdep_ap_bootstrap(void) printf("SMP: AP CPU #%d launched\n", PCPU_GET(cpuid)); mtx_unlock_spin(&ap_boot_mtx); - /* Initialize curthread */ - PCPU_SET(curthread, PCPU_GET(idlethread)); - PCPU_SET(curpcb, curthread->td_pcb); - /* Start per-CPU event timers. */ cpu_initclocks_ap(); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 02:30:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249FB106564A; Fri, 24 Jun 2011 02:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 08FE08FC0A; Fri, 24 Jun 2011 02:30: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 p5O2U2fv026334; Fri, 24 Jun 2011 02:30:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O2U2Qf026289; Fri, 24 Jun 2011 02:30:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240230.p5O2U2Qf026289@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 02:30: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: r223486 - in head: sys/dev/sound/usb sys/dev/usb sys/dev/usb/input sys/dev/usb/net sys/dev/usb/serial sys/dev/usb/storage sys/dev/usb/wlan sys/netgraph/bluetooth/drivers/ubt sys/netgrap... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 02:30:03 -0000 Author: hselasky Date: Fri Jun 24 02:30:02 2011 New Revision: 223486 URL: http://svn.freebsd.org/changeset/base/223486 Log: - Move all USB device ID arrays into so-called sections, sorted according to the mode which they support: host, device or dual mode - Add generic tool to extract these data: tools/bus_autoconf Discussed with: imp Suggested by: Robert Millan PR: misc/157903 MFC after: 14 days Added: head/tools/tools/bus_autoconf/ head/tools/tools/bus_autoconf/Makefile (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.c (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.h (contents, props changed) head/tools/tools/bus_autoconf/bus_autoconf.sh (contents, props changed) Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/input/atp.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/usbdi.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/sound/usb/uaudio.c Fri Jun 24 02:30:02 2011 (r223486) @@ -531,6 +531,15 @@ static driver_t uaudio_driver = { .size = sizeof(struct uaudio_softc), }; +static const STRUCT_USB_HOST_ID __used uaudio_devs[] = { + /* Generic USB audio class match */ + {USB_IFACE_CLASS(UICLASS_AUDIO), + USB_IFACE_SUBCLASS(UISUBCLASS_AUDIOCONTROL),}, + /* Generic USB MIDI class match */ + {USB_IFACE_CLASS(UICLASS_AUDIO), + USB_IFACE_SUBCLASS(UISUBCLASS_MIDISTREAM),}, +}; + static int uaudio_probe(device_t dev) { Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/input/atp.c Fri Jun 24 02:30:02 2011 (r223486) @@ -240,7 +240,7 @@ struct atp_dev_params { }, }; -static const struct usb_device_id atp_devs[] = { +static const STRUCT_USB_HOST_ID atp_devs[] = { /* Core Duo MacBook & MacBook Pro */ { USB_VPI(USB_VENDOR_APPLE, 0x0217, ATP_DEV_PARAMS_0) }, { USB_VPI(USB_VENDOR_APPLE, 0x0218, ATP_DEV_PARAMS_0) }, Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/input/uhid.c Fri Jun 24 02:30:02 2011 (r223486) @@ -607,29 +607,33 @@ uhid_ioctl(struct usb_fifo *fifo, u_long return (error); } +static const STRUCT_USB_HOST_ID uhid_devs[] = { + /* generic HID class */ + {USB_IFACE_CLASS(UICLASS_HID),}, + /* the Xbox 360 gamepad doesn't use the HID class */ + {USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(UISUBCLASS_XBOX360_CONTROLLER), + USB_IFACE_PROTOCOL(UIPROTO_XBOX360_GAMEPAD),}, +}; + static int uhid_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->info.bInterfaceClass != UICLASS_HID) { - /* the Xbox 360 gamepad doesn't use the HID class */ + error = usbd_lookup_id_by_uaa(uhid_devs, sizeof(uhid_devs), uaa); + if (error) + return (error); - if ((uaa->info.bInterfaceClass != UICLASS_VENDOR) || - (uaa->info.bInterfaceSubClass != UISUBCLASS_XBOX360_CONTROLLER) || - (uaa->info.bInterfaceProtocol != UIPROTO_XBOX360_GAMEPAD)) { - return (ENXIO); - } - } - if (usb_test_quirk(uaa, UQ_HID_IGNORE)) { + if (usb_test_quirk(uaa, UQ_HID_IGNORE)) return (ENXIO); - } + return (BUS_PROBE_GENERIC); } Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_aue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -110,7 +110,7 @@ SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, /* * Various supported device vendors/products. */ -static const struct usb_device_id aue_devs[] = { +static const STRUCT_USB_HOST_ID aue_devs[] = { #define AUE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } AUE_DEV(3COM, 3C460B, AUE_FLAG_PII), AUE_DEV(ABOCOM, DSB650TX_PNA, 0), Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_axe.c Fri Jun 24 02:30:02 2011 (r223486) @@ -133,7 +133,7 @@ SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, /* * Various supported device vendors/products. */ -static const struct usb_device_id axe_devs[] = { +static const STRUCT_USB_HOST_ID axe_devs[] = { #define AXE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } AXE_DEV(ABOCOM, UF200, 0), AXE_DEV(ACERCM, EP1427X2, 0), Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_cdce.c Fri Jun 24 02:30:02 2011 (r223486) @@ -263,7 +263,7 @@ static const struct usb_ether_methods cd .ue_setpromisc = cdce_setpromisc, }; -static const struct usb_device_id cdce_devs[] = { +static const STRUCT_USB_HOST_ID cdce_host_devs[] = { {USB_VPI(USB_VENDOR_ACERLABS, USB_PRODUCT_ACERLABS_M5632, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_AMBIT, USB_PRODUCT_AMBIT_NTL_250, CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQLINUX, CDCE_FLAG_NO_UNION)}, @@ -277,7 +277,9 @@ static const struct usb_device_id cdce_d {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLA300, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC700, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SLC750, CDCE_FLAG_ZAURUS | CDCE_FLAG_NO_UNION)}, +}; +static const STRUCT_USB_DUAL_ID cdce_dual_devs[] = { {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, 0)}, {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_MOBILE_DIRECT_LINE_MODEL, 0)}, {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_NETWORK_CONTROL_MODEL, 0)}, @@ -472,8 +474,12 @@ static int cdce_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; - return (usbd_lookup_id_by_uaa(cdce_devs, sizeof(cdce_devs), uaa)); + error = usbd_lookup_id_by_uaa(cdce_host_devs, sizeof(cdce_host_devs), uaa); + if (error) + error = usbd_lookup_id_by_uaa(cdce_dual_devs, sizeof(cdce_dual_devs), uaa); + return (error); } static void Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_cue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); /* Belkin F5U111 adapter covered by NETMATE entry */ -static const struct usb_device_id cue_devs[] = { +static const STRUCT_USB_HOST_ID cue_devs[] = { #define CUE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } CUE_DEV(CATC, NETMATE), CUE_DEV(CATC, NETMATE2), Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_ipheth.c Fri Jun 24 02:30:02 2011 (r223486) @@ -148,7 +148,7 @@ static const struct usb_ether_methods ip USB_IFACE_CLASS(c), USB_IFACE_SUBCLASS(sc), \ USB_IFACE_PROTOCOL(pt) -static const struct usb_device_id ipheth_devs[] = { +static const STRUCT_USB_HOST_ID ipheth_devs[] = { {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, IPHETH_USBINTF_PROTO)}, Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_kue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/products. */ -static const struct usb_device_id kue_devs[] = { +static const STRUCT_USB_HOST_ID kue_devs[] = { #define KUE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } KUE_DEV(3COM, 3C19250), KUE_DEV(3COM, 3C460), Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_mos.c Fri Jun 24 02:30:02 2011 (r223486) @@ -146,7 +146,7 @@ SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, /* Various supported device vendors/products. */ -static const struct usb_device_id mos_devs[] = { +static const STRUCT_USB_HOST_ID mos_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7730, MCS7730)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7830, MCS7830)}, {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_LN030, MCS7830)}, Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_rue.c Fri Jun 24 02:30:02 2011 (r223486) @@ -108,7 +108,7 @@ SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, * Various supported device vendors/products. */ -static const struct usb_device_id rue_devs[] = { +static const STRUCT_USB_HOST_ID rue_devs[] = { {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUAKTX, 0)}, {USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_USBKR100, 0)}, {USB_VPI(USB_VENDOR_OQO, USB_PRODUCT_OQO_ETHER01, 0)}, Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/if_udav.c Fri Jun 24 02:30:02 2011 (r223486) @@ -199,7 +199,7 @@ SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug #define UDAV_CLRBIT(sc, reg, x) \ udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) & ~(x)) -static const struct usb_device_id udav_devs[] = { +static const STRUCT_USB_HOST_ID udav_devs[] = { /* ShanTou DM9601 USB NIC */ {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, 0)}, /* ShanTou ST268 USB NIC */ Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/net/uhso.c Fri Jun 24 02:30:02 2011 (r223486) @@ -247,7 +247,7 @@ static char *uhso_port_type_sysctl[] = { /* ifnet device unit allocations */ static struct unrhdr *uhso_ifnet_unit = NULL; -static const struct usb_device_id uhso_devs[] = { +static const STRUCT_USB_HOST_ID uhso_devs[] = { #define UHSO_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } /* Option GlobeSurfer iCON 7.2 */ UHSO_DEV(OPTION, GSICON72, UHSO_STATIC_IFACE), Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/u3g.c Fri Jun 24 02:30:02 2011 (r223486) @@ -182,7 +182,7 @@ MODULE_DEPEND(u3g, ucom, 1, 1, 1); MODULE_DEPEND(u3g, usb, 1, 1, 1); MODULE_VERSION(u3g, 1); -static const struct usb_device_id u3g_devs[] = { +static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } U3G_DEV(ACERP, H10, 0), U3G_DEV(AIRPLUS, MCD650, 0), Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uark.c Fri Jun 24 02:30:02 2011 (r223486) @@ -170,7 +170,7 @@ MODULE_DEPEND(uark, ucom, 1, 1, 1); MODULE_DEPEND(uark, usb, 1, 1, 1); MODULE_VERSION(uark, 1); -static const struct usb_device_id uark_devs[] = { +static const STRUCT_USB_HOST_ID uark_devs[] = { {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, }; Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ubsa.c Fri Jun 24 02:30:02 2011 (r223486) @@ -239,7 +239,7 @@ static const struct ucom_callback ubsa_c .ucom_poll = &ubsa_poll, }; -static const struct usb_device_id ubsa_devs[] = { +static const STRUCT_USB_HOST_ID ubsa_devs[] = { /* AnyData ADU-500A */ {USB_VPI(USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_500A, 0)}, /* AnyData ADU-E100A/H */ Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uchcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -204,7 +204,7 @@ static const struct uchcom_divider_recor #define NUM_DIVIDERS (sizeof (dividers) / sizeof (dividers[0])) -static const struct usb_device_id uchcom_devs[] = { +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)}, }; Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ucycom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -180,7 +180,7 @@ MODULE_VERSION(ucycom, 1); /* * Supported devices */ -static const struct usb_device_id ucycom_devs[] = { +static const STRUCT_USB_HOST_ID ucycom_devs[] = { {USB_VPI(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, MODEL_CY7C64013)}, }; Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uftdi.c Fri Jun 24 02:30:02 2011 (r223486) @@ -206,7 +206,7 @@ MODULE_DEPEND(uftdi, ucom, 1, 1, 1); MODULE_DEPEND(uftdi, usb, 1, 1, 1); MODULE_VERSION(uftdi, 1); -static struct usb_device_id uftdi_devs[] = { +static STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v,p,t) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, UFTDI_TYPE_##t) } UFTDI_DEV(ATMEL, STK541, 8U232AM), Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ugensa.c Fri Jun 24 02:30:02 2011 (r223486) @@ -154,7 +154,7 @@ MODULE_DEPEND(ugensa, ucom, 1, 1, 1); MODULE_DEPEND(ugensa, usb, 1, 1, 1); MODULE_VERSION(ugensa, 1); -static const struct usb_device_id ugensa_devs[] = { +static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)}, {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)}, {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)}, Modified: head/sys/dev/usb/serial/uipaq.c ============================================================================== --- head/sys/dev/usb/serial/uipaq.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uipaq.c Fri Jun 24 02:30:02 2011 (r223486) @@ -153,7 +153,7 @@ static const struct ucom_callback uipaq_ * support the same hardware. Numeric values are used where no usbdevs * entries exist. */ -static const struct usb_device_id uipaq_devs[] = { +static const STRUCT_USB_HOST_ID uipaq_devs[] = { /* Socket USB Sync */ {USB_VPI(0x0104, 0x00be, 0)}, /* USB Sync 0301 */ Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/ulpt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -483,24 +483,39 @@ ulpt_ioctl(struct usb_fifo *fifo, u_long return (ENODEV); } +static const STRUCT_USB_HOST_ID ulpt_devs[] = { + /* Uni-directional USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_UNI)}, + + /* Bi-directional USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)}, + + /* 1284 USB printer */ + {USB_IFACE_CLASS(UICLASS_PRINTER), + USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_1284)}, +}; + static int ulpt_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((uaa->info.bInterfaceClass == UICLASS_PRINTER) && - (uaa->info.bInterfaceSubClass == UISUBCLASS_PRINTER) && - ((uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_UNI) || - (uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_BI) || - (uaa->info.bInterfaceProtocol == UIPROTO_PRINTER_1284))) { - return (0); - } - return (ENXIO); + + error = usbd_lookup_id_by_uaa(ulpt_devs, sizeof(ulpt_devs), uaa); + if (error) + return (error); + + return (BUS_PROBE_GENERIC); } static int Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umcs.c Fri Jun 24 02:30:02 2011 (r223486) @@ -253,7 +253,7 @@ static struct ucom_callback umcs7840_cal .ucom_poll = &umcs7840_poll, }; -static const struct usb_device_id umcs7840_devs[] = { +static const STRUCT_USB_HOST_ID umcs7840_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7820, 0)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7840, 0)}, }; Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umct.c Fri Jun 24 02:30:02 2011 (r223486) @@ -192,7 +192,7 @@ static const struct ucom_callback umct_c .ucom_poll = &umct_poll, }; -static const struct usb_device_id umct_devs[] = { +static const STRUCT_USB_HOST_ID umct_devs[] = { {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, 0)}, {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_SITECOM_USB232, 0)}, {USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_DU_H3SP_USB232, 0)}, Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umodem.c Fri Jun 24 02:30:02 2011 (r223486) @@ -123,7 +123,7 @@ SYSCTL_INT(_hw_usb_umodem, OID_AUTO, deb &umodem_debug, 0, "Debug level"); #endif -static const struct usb_device_id umodem_devs[] = { +static const STRUCT_USB_HOST_ID umodem_devs[] = { /* Generic Modem class match */ {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL), Modified: head/sys/dev/usb/serial/umoscom.c ============================================================================== --- head/sys/dev/usb/serial/umoscom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/umoscom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -280,7 +280,7 @@ MODULE_DEPEND(umoscom, ucom, 1, 1, 1); MODULE_DEPEND(umoscom, usb, 1, 1, 1); MODULE_VERSION(umoscom, 1); -static const struct usb_device_id umoscom_devs[] = { +static const STRUCT_USB_HOST_ID umoscom_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)} }; Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uplcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -247,7 +247,7 @@ static struct ucom_callback uplcom_callb #define UPLCOM_DEV(v,p) \ { USB_VENDOR(USB_VENDOR_##v), USB_PRODUCT(USB_PRODUCT_##v##_##p) } -static const struct usb_device_id uplcom_devs[] = { +static const STRUCT_USB_HOST_ID uplcom_devs[] = { UPLCOM_DEV(ACERP, S81), /* BenQ S81 phone */ UPLCOM_DEV(ADLINK, ND6530), /* ADLINK ND-6530 USB-Serial */ UPLCOM_DEV(ALCATEL, OT535), /* Alcatel One Touch 535/735 */ Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uslcom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -173,7 +173,7 @@ static struct ucom_callback uslcom_callb .ucom_poll = &uslcom_poll, }; -static const struct usb_device_id uslcom_devs[] = { +static const STRUCT_USB_HOST_ID uslcom_devs[] = { #define USLCOM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } USLCOM_DEV(BALTECH, CARDREADER), USLCOM_DEV(CLIPSAL, 5500PCU), Modified: head/sys/dev/usb/serial/uvisor.c ============================================================================== --- head/sys/dev/usb/serial/uvisor.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uvisor.c Fri Jun 24 02:30:02 2011 (r223486) @@ -253,7 +253,7 @@ MODULE_DEPEND(uvisor, ucom, 1, 1, 1); MODULE_DEPEND(uvisor, usb, 1, 1, 1); MODULE_VERSION(uvisor, 1); -static const struct usb_device_id uvisor_devs[] = { +static const STRUCT_USB_HOST_ID uvisor_devs[] = { #define UVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4), UVISOR_DEV(ALPHASMART, DANA_SYNC, UVISOR_FLAG_PALM4), Modified: head/sys/dev/usb/serial/uvscom.c ============================================================================== --- head/sys/dev/usb/serial/uvscom.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/serial/uvscom.c Fri Jun 24 02:30:02 2011 (r223486) @@ -233,7 +233,7 @@ static const struct ucom_callback uvscom .ucom_poll = &uvscom_poll, }; -static const struct usb_device_id uvscom_devs[] = { +static const STRUCT_USB_HOST_ID uvscom_devs[] = { /* SUNTAC U-Cable type A4 */ {USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS144L4, 0)}, /* SUNTAC U-Cable type D2 */ Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/storage/umass.c Fri Jun 24 02:30:02 2011 (r223486) @@ -721,6 +721,11 @@ MODULE_VERSION(umass, 1); * USB device probe/attach/detach */ +static const STRUCT_USB_HOST_ID __used umass_devs[] = { + /* generic mass storage class */ + {USB_IFACE_CLASS(UICLASS_MASS),}, +}; + static uint16_t umass_get_proto(struct usb_interface *iface) { Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/usbdi.h Fri Jun 24 02:30:02 2011 (r223486) @@ -228,6 +228,18 @@ struct usb_config { }; /* + * Use these macro when defining USB device ID arrays if you want to + * have your driver module automatically loaded in host, device or + * both modes respectivly: + */ +#define STRUCT_USB_HOST_ID \ + struct usb_device_id __section("usb_host_id") +#define STRUCT_USB_DEVICE_ID \ + struct usb_device_id __section("usb_device_id") +#define STRUCT_USB_DUAL_ID \ + struct usb_device_id __section("usb_dual_id") + +/* * The following structure is used when looking up an USB driver for * an USB device. It is inspired by the Linux structure called * "usb_device_id". Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_rum.c Fri Jun 24 02:30:02 2011 (r223486) @@ -85,7 +85,7 @@ SYSCTL_INT(_hw_usb_rum, OID_AUTO, debug, "Debug level"); #endif -static const struct usb_device_id rum_devs[] = { +static const STRUCT_USB_HOST_ID rum_devs[] = { #define RUM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUM_DEV(ABOCOM, HWU54DM), RUM_DEV(ABOCOM, RT2573_2), Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_run.c Fri Jun 24 02:30:02 2011 (r223486) @@ -96,7 +96,7 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, */ #define RUN_CMDQ_GET(c) (atomic_fetchadd_32((c), 1) & RUN_CMDQ_MASQ) -static const struct usb_device_id run_devs[] = { +static const STRUCT_USB_HOST_ID run_devs[] = { #define RUN_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } RUN_DEV(ABOCOM, RT2770), RUN_DEV(ABOCOM, RT2870), Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_uath.c Fri Jun 24 02:30:02 2011 (r223486) @@ -167,7 +167,7 @@ enum { (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) /* recognized device vendors/products */ -static const struct usb_device_id uath_devs[] = { +static const STRUCT_USB_HOST_ID uath_devs[] = { #define UATH_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } UATH_DEV(ACCTON, SMCWUSBG), UATH_DEV(ACCTON, SMCWUSBTG2), Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -170,7 +170,7 @@ static int upgt_tx_start(struct upgt_sof static const char *upgt_fwname = "upgt-gw3887"; -static const struct usb_device_id upgt_devs_2[] = { +static const STRUCT_USB_HOST_ID upgt_devs[] = { #define UPGT_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } /* version 2 devices */ UPGT_DEV(ACCTON, PRISM_GT), @@ -236,7 +236,7 @@ upgt_match(device_t dev) if (uaa->info.bIfaceIndex != UPGT_IFACE_INDEX) return (ENXIO); - return (usbd_lookup_id_by_uaa(upgt_devs_2, sizeof(upgt_devs_2), uaa)); + return (usbd_lookup_id_by_uaa(upgt_devs, sizeof(upgt_devs), uaa)); } static int Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_ural.c Fri Jun 24 02:30:02 2011 (r223486) @@ -91,7 +91,7 @@ SYSCTL_INT(_hw_usb_ural, OID_AUTO, debug ((rssi) - (RAL_NOISE_FLOOR + RAL_RSSI_CORR)) : 0) /* various supported device vendors/products */ -static const struct usb_device_id ural_devs[] = { +static const STRUCT_USB_HOST_ID ural_devs[] = { #define URAL_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } URAL_DEV(ASUS, WL167G), URAL_DEV(ASUS, RT2570), Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Jun 24 02:30:02 2011 (r223486) @@ -102,7 +102,7 @@ TUNABLE_INT("hw.usb.urtw.preamble_mode", { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, URTW_REV_RTL8187L) } #define URTW_REV_RTL8187B 0 #define URTW_REV_RTL8187L 1 -static const struct usb_device_id urtw_devs[] = { +static const STRUCT_USB_HOST_ID urtw_devs[] = { URTW_DEV_B(NETGEAR, WG111V3), URTW_DEV_B(REALTEK, RTL8187B_0), URTW_DEV_B(REALTEK, RTL8187B_1), Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Jun 24 02:30:02 2011 (r223486) @@ -200,7 +200,7 @@ static const struct zyd_phy_pair zyd_def { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211) } #define ZYD_ZD1211B_DEV(v,p) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, ZYD_ZD1211B) } -static const struct usb_device_id zyd_devs[] = { +static const STRUCT_USB_HOST_ID zyd_devs[] = { /* ZYD_ZD1211 */ ZYD_ZD1211_DEV(3COM2, 3CRUSB10075), ZYD_ZD1211_DEV(ABOCOM, WL54), Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Fri Jun 24 02:30:02 2011 (r223486) @@ -382,14 +382,14 @@ static const struct usb_config ubt_conf * where VENDOR_ID and PRODUCT_ID are hex numbers. */ -static const struct usb_device_id ubt_ignore_devs[] = +static const STRUCT_USB_HOST_ID ubt_ignore_devs[] = { /* AVM USB Bluetooth-Adapter BlueFritz! v1.0 */ { USB_VPI(USB_VENDOR_AVM, 0x2200, 0) }, }; /* List of supported bluetooth devices */ -static const struct usb_device_id ubt_devs[] = +static const STRUCT_USB_HOST_ID ubt_devs[] = { /* Generic Bluetooth class devices */ { USB_IFACE_CLASS(UDCLASS_WIRELESS), Modified: head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Thu Jun 23 22:21:28 2011 (r223485) +++ head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Fri Jun 24 02:30:02 2011 (r223486) @@ -180,7 +180,7 @@ MODULE_DEPEND(ubtbcmfw, usb, 1, 1, 1); static int ubtbcmfw_probe(device_t dev) { - const struct usb_device_id devs[] = { + static const STRUCT_USB_HOST_ID devs[] = { /* Broadcom BCM2033 devices only */ { USB_VPI(USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033, 0) }, }; Added: head/tools/tools/bus_autoconf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/Makefile Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,43 @@ +# $FreeBSD$ +# +# Copyright (c) 2011 Hans Petter Selasky. 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. +# + +# +# Example on how to use: +# +# make clean all install +# +# ./bus_autoconf.sh /boot/kernel/*.ko | less +# + +PROG= bus_autoconf +MAN= +BINDIR?= /usr/local/bin + +SRCS= bus_autoconf.c + +WARNS= 6 + +.include Added: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,321 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. 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. + */ + +/* + * Disclaimer: This utility and format is subject to change and not a + * comitted interface. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bus_autoconf.h" + +static char *type; +static char *file_name; +static char *module; +static const char *mode; + +static int +usb_compare(const void *_a, const void *_b) +{ + const struct usb_device_id *a = _a; + const struct usb_device_id *b = _b; + + if (a->idVendor > b->idVendor) + return (1); + if (a->idVendor < b->idVendor) + return (-1); + if (a->idProduct > b->idProduct) + return (1); + if (a->idProduct < b->idProduct) + return (-1); + if (a->bDeviceClass > b->bDeviceClass) + return (1); + if (a->bDeviceClass < b->bDeviceClass) + return (-1); + if (a->bDeviceSubClass > b->bDeviceSubClass) + return (1); + if (a->bDeviceSubClass < b->bDeviceSubClass) + return (-1); + if (a->bDeviceProtocol > b->bDeviceProtocol) + return (1); + if (a->bDeviceProtocol < b->bDeviceProtocol) + return (-1); + if (a->bInterfaceClass > b->bInterfaceClass) + return (1); + if (a->bInterfaceClass < b->bInterfaceClass) + return (-1); + if (a->bInterfaceSubClass > b->bInterfaceSubClass) + return (1); + if (a->bInterfaceSubClass < b->bInterfaceSubClass) + return (-1); + if (a->bInterfaceProtocol > b->bInterfaceProtocol) + return (1); + if (a->bInterfaceProtocol < b->bInterfaceProtocol) + return (-1); + + return (0); +} + +static void +usb_sort(struct usb_device_id *id, uint32_t nid) +{ + qsort(id, nid, sizeof(*id), &usb_compare); +} + +struct usb_info { + uint8_t is_iface; + uint8_t is_any; + uint8_t is_vp; + uint8_t is_dev; +}; + +static void +usb_dump_sub(struct usb_device_id *id, struct usb_info *pinfo) +{ +#if USB_HAVE_COMPAT_LINUX + if (id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) + id->match_flag_vendor = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) + id->match_flag_product = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) + id->match_flag_dev_lo = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) + id->match_flag_dev_hi = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) + id->match_flag_dev_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) + id->match_flag_dev_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) + id->match_flag_dev_protocol = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) + id->match_flag_int_class = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) + id->match_flag_int_subclass = 1; + if (id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) + id->match_flag_int_protocol = 1; +#endif + + pinfo->is_iface = id->match_flag_int_class | + id->match_flag_int_protocol | + id->match_flag_int_subclass; + + pinfo->is_dev = id->match_flag_dev_class | + id->match_flag_dev_subclass; + + pinfo->is_vp = id->match_flag_vendor | + id->match_flag_product; + + pinfo->is_any = pinfo->is_vp + pinfo->is_dev + pinfo->is_iface; +} + +static uint32_t +usb_dump(struct usb_device_id *id, uint32_t nid) +{ + uint32_t n = 1; + struct usb_info info; + + usb_dump_sub(id, &info); + + if (info.is_iface) { + printf("nomatch 10 {\n" + " match \"system\" \"USB\";\n" + " match \"subsystem\" \"INTERFACE\";\n" + " match \"mode\" \"%s\";\n", mode); + } else if (info.is_any) { + printf("nomatch 10 {\n" + " match \"system\" \"USB\";\n" + " match \"subsystem\" \"DEVICE\";\n" + " match \"mode\" \"%s\";\n", mode); + } else { + return (n); + } + + if (id->match_flag_vendor) { + printf(" match \"vendor\" \"0x%04x\";\n", + id->idVendor); + } + if (id->match_flag_product) { + uint32_t x; + + if (info.is_any == 1 && info.is_vp == 1) { + /* try to join similar entries */ + while (n < nid) { + usb_dump_sub(id + n, &info); + + if (info.is_any != 1 || info.is_vp != 1) + break; + if (id[n].idVendor != id[0].idVendor) + break; + n++; + } + /* restore infos */ + usb_dump_sub(id, &info); + } + if (n == 1) { + printf(" match \"product\" \"0x%04x\";\n", + id->idProduct); + } else { + printf(" match \"product\" \"("); + + for (x = 0; x != n; x++) { + printf("0x%04x%s", id[x].idProduct, + (x == (n - 1)) ? "" : "|"); + } + + printf(")\";\n"); + } + } + if (id->match_flag_dev_class) { + printf(" match \"devclass\" \"0x%02x\";\n", + id->bDeviceClass); + } + if (id->match_flag_dev_subclass) { + printf(" match \"devsubclass\" \"0x%02x\";\n", + id->bDeviceSubClass); + } + if (id->match_flag_int_class) { + printf(" match \"intclass\" \"0x%02x\";\n", + id->bInterfaceClass); + } + if (id->match_flag_int_subclass) { + printf(" match \"intsubclass\" \"0x%02x\";\n", + id->bInterfaceSubClass); + } + if (id->match_flag_int_protocol) { + printf(" match \"intprotocol\" \"0x%02x\";\n", + id->bInterfaceProtocol); + } + printf(" action \"kldload %s\";\n" + "};\n\n", module); + + return (n); +} + +static void +usb_parse_and_dump(int f, off_t size) +{ + struct usb_device_id *id; + uint32_t nid; + uint32_t x; + + if (size % sizeof(struct usb_device_id)) { + errx(EX_NOINPUT, "Size is not divisible by %d", + (int)sizeof(struct usb_device_id)); + } + lseek(f, 0, SEEK_SET); + + id = malloc(size); + if (id == NULL) { + errx(EX_SOFTWARE, "Out of memory"); + } + if (read(f, id, size) != size) { + err(EX_NOINPUT, "Cannot read all data"); + } + nid = size / sizeof(*id); + + usb_sort(id, nid); + + for (x = 0; x != nid;) + x += usb_dump(id + x, nid - x); + + free(id); +} + +static void +usage(void) +{ + fprintf(stderr, + "bus_autoconf - devd config file generator\n" + " -i \n" + " -m \n" + " -t \n" + " -h show usage\n" + ); + exit(EX_USAGE); +} + +int +main(int argc, char **argv) +{ + const char *params = "i:m:ht:"; + int c; + int f; + off_t off; + + while ((c = getopt(argc, argv, params)) != -1) { + switch (c) { + case 'i': + file_name = optarg; + break; + case 't': + type = optarg; + break; + case 'm': + module = optarg; + break; + default: + usage(); + break; + } + } + + if (type == NULL || module == NULL || file_name == NULL) + usage(); + + f = open(file_name, O_RDONLY); + if (f < 0) + err(EX_NOINPUT, "Cannot open file '%s'", file_name); + + off = lseek(f, 0, SEEK_END); + if (off <= 0) + err(EX_NOINPUT, "Cannot seek to end of file"); + + if (strcmp(type, "usb_host") == 0) { + mode = "host"; + usb_parse_and_dump(f, off); + } else if (strcmp(type, "usb_device") == 0) { + mode = "device"; + usb_parse_and_dump(f, off); + } else if (strcmp(type, "usb_dual") == 0) { + mode = "(host|device)"; + usb_parse_and_dump(f, off); + } else { + err(EX_USAGE, "Unsupported structure type: %s", type); + } + + close(f); + + return (0); +} Added: head/tools/tools/bus_autoconf/bus_autoconf.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/bus_autoconf/bus_autoconf.h Fri Jun 24 02:30:02 2011 (r223486) @@ -0,0 +1,83 @@ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2011 Hans Petter Selasky. 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. + */ + +#ifndef _BUS_AUTOCONF_H_ +#define _BUS_AUTOCONF_H_ + +/* Make sure we get the have compat linux definition. */ +#include + +struct usb_device_id { + + /* Hook for driver specific information */ + unsigned long driver_info; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 02:56:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2050D106564A; Fri, 24 Jun 2011 02:56:25 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0EF998FC13; Fri, 24 Jun 2011 02:56: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 p5O2uO12027096; Fri, 24 Jun 2011 02:56:24 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O2uOpW027094; Fri, 24 Jun 2011 02:56:24 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240256.p5O2uOpW027094@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 02:56: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: r223487 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 02:56:25 -0000 Author: rodrigc Date: Fri Jun 24 02:56:24 2011 New Revision: 223487 URL: http://svn.freebsd.org/changeset/base/223487 Log: Bring back synchnet() implementation from older tftp implementation. The synchnet() function was converted to a no-op when the new TFTP implementation was committed to FreeBSD. However, this function, as it was in the older code, is needed in order to synchronize between the tftpd server and tftp clients, which may be buggy. Specifically, we had a buggy TFTP client which would send TFTP ACK packets for non-TFTP packets, which would cause the count of packets to get out of whack, causing transfers to fail with the new TFTPD implementation. Obtained from: Juniper Networks Submitted by: Santhanakrishnan Balraj Modified: head/libexec/tftpd/tftp-file.c Modified: head/libexec/tftpd/tftp-file.c ============================================================================== --- head/libexec/tftpd/tftp-file.c Fri Jun 24 02:30:02 2011 (r223486) +++ head/libexec/tftpd/tftp-file.c Fri Jun 24 02:56:24 2011 (r223487) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include #include @@ -249,9 +251,34 @@ read_close(void) } +/* When an error has occurred, it is possible that the two sides + * are out of synch. Ie: that what I think is the other side's + * response to packet N is really their response to packet N-1. + * + * So, to try to prevent that, we flush all the input queued up + * for us on the network connection on our host. + * + * We return the number of packets we flushed (mostly for reporting + * when trace is active). + */ + int -synchnet(int peer __unused) +synchnet(int peer) /* socket to flush */ { - - return 0; + int i, j = 0; + char rbuf[MAXPKTSIZE]; + struct sockaddr_storage from; + socklen_t fromlen; + + while (1) { + (void) ioctl(peer, FIONREAD, &i); + if (i) { + j++; + fromlen = sizeof from; + (void) recvfrom(peer, rbuf, sizeof (rbuf), 0, + (struct sockaddr *)&from, &fromlen); + } else { + return(j); + } + } } From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 03:31:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BED41106564A; Fri, 24 Jun 2011 03:31:40 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 99A038FC13; Fri, 24 Jun 2011 03:31:39 +0000 (UTC) Received: by wwe6 with SMTP id 6so2337520wwe.31 for ; Thu, 23 Jun 2011 20:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=do5RqvBDQw9GB9Q2JhbOs2FAoI9AbgMvtrcnRXGIclw=; b=mm8XmdY9go+WXAU3hxrYSb9vVwGnuCBzs+LaclGL4xs0B7colfPyZlcyq86CV3WGri Pe219AF7m26N/8JgtNIo14XuBj5IvmPZF2rtMCzyCEMvjsZRqnL2I6vfdIYO6aaZxId7 7kVunW+yJA0pAQEYrh/iahcSCuZeXC8temaWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=H1PcGOSWuBEViee/LRXhP3Rht6V5l0PqpqC0hZAANYBzh2StDmntxWswCFOx5GE0FZ xJlbYfLh37JTl7rI3fqgRsqPMH1eubteuGqskCMgpqwG1rKUbJ7XEXWNVIypu3i9fFEF QNDL1QPVcTM5JbHBEVpqIJNx/PyptW3CBJvs0= MIME-Version: 1.0 Received: by 10.216.68.6 with SMTP id k6mr6237wed.85.1308884697347; Thu, 23 Jun 2011 20:04:57 -0700 (PDT) Received: by 10.216.166.195 with HTTP; Thu, 23 Jun 2011 20:04:57 -0700 (PDT) In-Reply-To: <4E039C0F.10505@rice.edu> References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> Date: Fri, 24 Jun 2011 08:34:57 +0530 Message-ID: From: "Jayachandran C." To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r223464 - 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: Fri, 24 Jun 2011 03:31:40 -0000 On Fri, Jun 24, 2011 at 1:33 AM, Alan Cox wrote: > On 6/23/2011 1:30 PM, Warner Losh wrote: >> >> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >> >>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>> >>>> Author: alc >>>> Date: Thu Jun 23 05:23:59 2011 >>>> New Revision: 223464 >>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>> >>>> Log: >>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>>> MIPS. =A0(At present, although atomic_clear_char() is defined by atomi= c.h >>>> on MIPS, it is not actually implemented by support.S.) >>> >>> Thanks, >>> and good catch on the atomics even if not planned, just in time for 9.0= :) >> >> Yea, there's some work there to fix them... =A0Not sure we can even fix = some >> of them atomically... >> > > I'm not sure that I understand what you mean by the second statement. =A0= Can > you elaborate? =A0The 8- and 16-bit operations should be no less "atomic"= than > the 32- and 64-bit operations. =A0In general, regardless of the size of t= he > operation, the "sc" instruction may fail and the whole operation has to b= e > restarted if another processor (or I/O device) performs a concurrent, cac= he > coherent store to the same location (or even cache line) as the "ll" and > "sc" instructions are operating on. =A0On the other hand, if the "sc" > instruction succeeds, whether you used it to change all of the 32 bits or > just 8 of the 32 bits, it should appear as an atomic change to any other > processor. I will try out an implementation and see if this works on XLR, if so this is something we can add to support.S JC. From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 03:50:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8681F106564A; Fri, 24 Jun 2011 03:50:55 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 73BC58FC18; Fri, 24 Jun 2011 03:50: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 p5O3otop028957; Fri, 24 Jun 2011 03:50:55 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O3otfc028955; Fri, 24 Jun 2011 03:50:55 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240350.p5O3otfc028955@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 03:50: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: r223488 - 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, 24 Jun 2011 03:50:55 -0000 Author: rodrigc Date: Fri Jun 24 03:50:54 2011 New Revision: 223488 URL: http://svn.freebsd.org/changeset/base/223488 Log: Fixes to newer tftp code in libstand: (1) Coding style changes. (2) If the server does not acknowledge any blocksize option, revert to the default blocksize of 512 bytes. (3) Send ACK if the first packet happens to be the last packet. (4) Do not accept blocksize greater than what was requested. (5) Drop any unwanted OACK received if a tftp transfer is already in progress. (6) Terminate incomplete transfers with a special no-error ERROR packet. Otherwise we rely on the tftp server to time out, which it does eventually, after re-sending the last packet several times and spamming the system log about it every time. This idea is borrowed from the PXE client, which does exactly that. Submitted by: Alexander Kabaev Reviewed and Tested by: Santhanakrishnan Balraj Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Fri Jun 24 02:56:24 2011 (r223487) +++ head/lib/libstand/tftp.c Fri Jun 24 03:50:54 2011 (r223488) @@ -64,13 +64,13 @@ struct tftp_handle; static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); -static void tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(struct tftp_handle *h, +static ssize_t sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *h, void *, ssize_t, time_t, unsigned short *), @@ -93,7 +93,7 @@ static int tftpport = 2000; static int is_open = 0; /* - * The legacy TFTP_BLKSIZE value was 512. + * The legacy TFTP_BLKSIZE value was SEGSIZE(512). * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and * IP header lengths). */ @@ -102,7 +102,7 @@ static int is_open = 0; /* * Choose a blksize big enough so we can test with Ethernet * Jumbo frames in the future. - */ + */ #define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { @@ -113,7 +113,7 @@ struct tftp_handle { int off; char *path; /* saved for re-requests */ unsigned int tftp_blksize; - unsigned long tftp_tsize; + unsigned long tftp_tsize; struct { u_char header[HEADER_SIZE]; struct tftphdr t; @@ -121,7 +121,8 @@ struct tftp_handle { } __packed __aligned(4) lastdata; }; -static const int tftperrors[8] = { +#define TFTP_MAX_ERRCODE EOPTNEG +static const int tftperrors[TFTP_MAX_ERRCODE + 1] = { 0, /* ??? */ ENOENT, EPERM, @@ -129,10 +130,57 @@ static const int tftperrors[8] = { EINVAL, /* ??? */ EINVAL, /* ??? */ EEXIST, - EINVAL /* ??? */ + EINVAL, /* ??? */ + EINVAL, /* Option negotiation failed. */ }; -static ssize_t +static int tftp_getnextblock(struct tftp_handle *h); + +/* send error message back. */ +static void +tftp_senderr(struct tftp_handle *h, u_short errcode, const char *msg) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + u_char space[63]; /* +1 from t */ + } __packed __aligned(4) wbuf; + char *wtail; + int len; + + len = strlen(msg); + if (len > sizeof(wbuf.space)) + len = sizeof(wbuf.space); + + wbuf.t.th_opcode = htons((u_short) ERROR); + wbuf.t.th_code = htons(errcode); + + wtail = wbuf.t.th_msg; + bcopy(msg, wtail, len); + wtail[len] = '\0'; + wtail += len + 1; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static void +tftp_sendack(struct tftp_handle *h) +{ + struct { + u_char header[HEADER_SIZE]; + struct tftphdr t; + } __packed __aligned(4) wbuf; + char *wtail; + + wbuf.t.th_opcode = htons((u_short) ACK); + wtail = (char *) &wbuf.t.th_block; + wbuf.t.th_block = htons((u_short) h->currblock); + wtail += 2; + + sendudp(h->iodesc, &wbuf.t, wtail - (char *) &wbuf.t); +} + +static ssize_t recvtftp(struct tftp_handle *h, void *pkt, ssize_t len, time_t tleft, unsigned short *rtype) { @@ -170,7 +218,7 @@ recvtftp(struct tftp_handle *h, void *pk return got; } case ERROR: - if ((unsigned) ntohs(t->th_code) >= 8) { + if ((unsigned) ntohs(t->th_code) > TFTP_MAX_ERRCODE) { printf("illegal tftp error %d\n", ntohs(t->th_code)); errno = EIO; } else { @@ -182,14 +230,30 @@ recvtftp(struct tftp_handle *h, void *pk return (-1); case OACK: { struct udphdr *uh; - int tftp_oack_len = len - sizeof(t->th_opcode); - tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len); + int tftp_oack_len; + + /* + * Unexpected OACK. TFTP transfer already in progress. + * Drop the pkt. + */ + if (d->xid != 1) { + return (-1); + } + /* - * Remember which port this OACK came from, - * because we need to send the ACK back to it. + * Remember which port this OACK came from, because we need + * to send the ACK or errors back to it. */ uh = (struct udphdr *) pkt - 1; d->destport = uh->uh_sport; + + /* Parse options ACK-ed by the server. */ + tftp_oack_len = len - sizeof(t->th_opcode); + if (tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len) != 0) { + tftp_senderr(h, EOPTNEG, "Malformed OACK"); + errno = EIO; + return (-1); + } return (0); } default: @@ -201,7 +265,7 @@ recvtftp(struct tftp_handle *h, void *pk } /* send request, expect first block (or error) */ -static int +static int tftp_makereq(struct tftp_handle *h) { struct { @@ -250,26 +314,28 @@ tftp_makereq(struct tftp_handle *h) h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ + h->currblock = 0; + h->islastblock = 0; + h->validsize = 0; + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - if (rtype == OACK) { - wbuf.t.th_opcode = htons((u_short)ACK); - wtail = (char *) &wbuf.t.th_block; - wbuf.t.th_block = htons(0); - wtail += 2; - rtype = 0; - res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - } + if (rtype == OACK) + return (tftp_getnextblock(h)); + + /* Server ignored our blksize request, revert to TFTP default. */ + h->tftp_blksize = SEGSIZE; switch (rtype) { case DATA: { h->currblock = 1; h->validsize = res; h->islastblock = 0; - if (res < h->tftp_blksize) + if (res < h->tftp_blksize) { h->islastblock = 1; /* very short file */ + tftp_sendack(h); + } return (0); } case ERROR: @@ -320,7 +386,7 @@ tftp_getnextblock(struct tftp_handle *h) return (0); } -static int +static int tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; @@ -365,7 +431,7 @@ tftp_open(const char *path, struct open_ return (0); } -static int +static int tftp_read(struct open_file *f, void *addr, size_t size, size_t *resid /* out */) { @@ -381,9 +447,11 @@ tftp_read(struct open_file *f, void *add needblock = tftpfile->off / tftpfile->tftp_blksize + 1; - if (tftpfile->currblock > needblock) /* seek backwards */ + if (tftpfile->currblock > needblock) { /* seek backwards */ + tftp_senderr(tftpfile, 0, "No error: read aborted"); tftp_makereq(tftpfile); /* no error check, it worked * for open */ + } while (tftpfile->currblock < needblock) { int res; @@ -452,7 +520,7 @@ tftp_close(struct open_file *f) return (0); } -static int +static int tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, size_t *resid __unused /* out */) { @@ -473,7 +541,7 @@ tftp_stat(struct open_file *f, struct st return (0); } -static off_t +static off_t tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; @@ -494,7 +562,7 @@ tftp_seek(struct open_file *f, off_t off } static ssize_t -sendrecv_tftp(struct tftp_handle *h, +sendrecv_tftp(struct tftp_handle *h, ssize_t (*sproc)(struct iodesc *, void *, size_t), void *sbuf, size_t ssize, ssize_t (*rproc)(struct tftp_handle *, void *, ssize_t, time_t, unsigned short *), @@ -562,9 +630,9 @@ tftp_set_blksize(struct tftp_handle *h, /* * Only accept blksize value if it is numeric. - * RFC2348 specifies that acceptable valuesare 8-65464 - * 8-65464 . Let's choose a limit less than MAXRSPACE - */ + * RFC2348 specifies that acceptable values are 8-65464. + * Let's choose a limit less than MAXRSPACE. + */ if (*endptr == '\0' && new_blksize >= 8 && new_blksize <= TFTP_MAX_BLKSIZE) { h->tftp_blksize = new_blksize; @@ -597,13 +665,12 @@ tftp_set_blksize(struct tftp_handle *h, * optN, valueN * The final option/value acknowledgment pair. */ -static void +static int tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) { /* * We parse the OACK strings into an array * of name-value pairs. - * */ char *tftp_options[128] = { 0 }; char *val = buf; @@ -612,18 +679,22 @@ tftp_parse_oack(struct tftp_handle *h, c int blksize_is_set = 0; int tsize = 0; - - while ( option_idx < 128 && i < len ) { - if (buf[i] == '\0') { - if (&buf[i] > val) { - tftp_options[option_idx] = val; - val = &buf[i] + 1; - ++option_idx; - } - } - ++i; + unsigned int orig_blksize; + + while (option_idx < 128 && i < len) { + if (buf[i] == '\0') { + if (&buf[i] > val) { + tftp_options[option_idx] = val; + val = &buf[i] + 1; + ++option_idx; + } + } + ++i; } + /* Save the block size we requested for sanity check later. */ + orig_blksize = h->tftp_blksize; + /* * Parse individual TFTP options. * * "blksize" is specified in RFC2348. @@ -631,27 +702,37 @@ tftp_parse_oack(struct tftp_handle *h, c */ for (i = 0; i < option_idx; i += 2) { if (strcasecmp(tftp_options[i], "blksize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) blksize_is_set = tftp_set_blksize(h, tftp_options[i + 1]); - } } else if (strcasecmp(tftp_options[i], "tsize") == 0) { - if (i + 1 < option_idx) { + if (i + 1 < option_idx) tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); - } + } else { + /* Do not allow any options we did not expect to be ACKed. */ + printf("unexpected tftp option '%s'\n", tftp_options[i]); + return (-1); } } if (!blksize_is_set) { /* * If TFTP blksize was not set, try defaulting - * to the legacy TFTP blksize of 512 + * to the legacy TFTP blksize of SEGSIZE(512) */ - h->tftp_blksize = 512; + h->tftp_blksize = SEGSIZE; + } else if (h->tftp_blksize > orig_blksize) { + /* + * Server should not be proposing block sizes that + * exceed what we said we can handle. + */ + printf("unexpected blksize %u\n", h->tftp_blksize); + return (-1); } #ifdef TFTP_DEBUG printf("tftp_blksize: %u\n", h->tftp_blksize); printf("tftp_tsize: %lu\n", h->tftp_tsize); #endif + return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 04:16:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1D5106564A; Fri, 24 Jun 2011 04:16:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 28BEF8FC14; Fri, 24 Jun 2011 04: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 p5O4G7Z6029748; Fri, 24 Jun 2011 04:16:07 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O4G7kB029743; Fri, 24 Jun 2011 04:16:07 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240416.p5O4G7kB029743@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 04: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: r223489 - in head: sys/dev/usb tools/tools/bus_autoconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 04:16:07 -0000 Author: hselasky Date: Fri Jun 24 04:16:06 2011 New Revision: 223489 URL: http://svn.freebsd.org/changeset/base/223489 Log: - Add additional information to the PnP info of USB HUBs children which is now required by bus_autoconf. - Allow interface class matching even if device class is vendor specific. - Update bus_autoconf tool to not generate system and subsystem match lines for the nomatch event. PR: misc/157903 MFC after: 14 days Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_lookup.c head/tools/tools/bus_autoconf/bus_autoconf.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/sys/dev/usb/usb_hub.c Fri Jun 24 04:16:06 2011 (r223489) @@ -1334,15 +1334,19 @@ uhub_child_pnpinfo_string(device_t paren "devclass=0x%02x devsubclass=0x%02x " "sernum=\"%s\" " "release=0x%04x " - "intclass=0x%02x intsubclass=0x%02x" "%s%s", + "mode=%s " + "intclass=0x%02x intsubclass=0x%02x " + "intprotocol=0x%02x " "%s%s", UGETW(res.udev->ddesc.idVendor), UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, res.udev->ddesc.bDeviceSubClass, usb_get_serial(res.udev), UGETW(res.udev->ddesc.bcdDevice), + (res.udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", iface->idesc->bInterfaceClass, iface->idesc->bInterfaceSubClass, + iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); } else { Modified: head/sys/dev/usb/usb_lookup.c ============================================================================== --- head/sys/dev/usb/usb_lookup.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/sys/dev/usb/usb_lookup.c Fri Jun 24 04:16:06 2011 (r223489) @@ -105,13 +105,6 @@ usbd_lookup_id_by_info(const struct usb_ (id->bDeviceProtocol != info->bDeviceProtocol)) { continue; } - if ((info->bDeviceClass == 0xFF) && - (!(id->match_flag_vendor)) && - ((id->match_flag_int_class) || - (id->match_flag_int_subclass) || - (id->match_flag_int_protocol))) { - continue; - } if ((id->match_flag_int_class) && (id->bInterfaceClass != info->bInterfaceClass)) { continue; Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 03:50:54 2011 (r223488) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:16:06 2011 (r223489) @@ -148,15 +148,8 @@ usb_dump(struct usb_device_id *id, uint3 usb_dump_sub(id, &info); - if (info.is_iface) { + if (info.is_any) { printf("nomatch 10 {\n" - " match \"system\" \"USB\";\n" - " match \"subsystem\" \"INTERFACE\";\n" - " match \"mode\" \"%s\";\n", mode); - } else if (info.is_any) { - printf("nomatch 10 {\n" - " match \"system\" \"USB\";\n" - " match \"subsystem\" \"DEVICE\";\n" " match \"mode\" \"%s\";\n", mode); } else { return (n); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 04:35:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFCA106564A; Fri, 24 Jun 2011 04:35:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6B39E8FC13; Fri, 24 Jun 2011 04:35: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 p5O4ZwB8030338; Fri, 24 Jun 2011 04:35:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O4Zwdh030336; Fri, 24 Jun 2011 04:35:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106240435.p5O4Zwdh030336@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 04:35: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: r223490 - head/tools/tools/bus_autoconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 04:35:58 -0000 Author: hselasky Date: Fri Jun 24 04:35:58 2011 New Revision: 223490 URL: http://svn.freebsd.org/changeset/base/223490 Log: - Make sure we don't match the wrong device by adding a match for the bus the device belongs to. PR: misc/157903 MFC after: 14 days Modified: head/tools/tools/bus_autoconf/bus_autoconf.c Modified: head/tools/tools/bus_autoconf/bus_autoconf.c ============================================================================== --- head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:16:06 2011 (r223489) +++ head/tools/tools/bus_autoconf/bus_autoconf.c Fri Jun 24 04:35:58 2011 (r223490) @@ -150,6 +150,7 @@ usb_dump(struct usb_device_id *id, uint3 if (info.is_any) { printf("nomatch 10 {\n" + " match \"bus\" \"uhub[0-9]+\";\n" " match \"mode\" \"%s\";\n", mode); } else { return (n); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 05:41:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8819106564A; Fri, 24 Jun 2011 05:41:38 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id C74428FC08; Fri, 24 Jun 2011 05: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 p5O5fcfP032150; Fri, 24 Jun 2011 05:41:38 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O5fcMA032147; Fri, 24 Jun 2011 05:41:38 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106240541.p5O5fcMA032147@svn.freebsd.org> From: Craig Rodrigues Date: Fri, 24 Jun 2011 05: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: r223491 - in head: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 05:41:38 -0000 Author: rodrigc Date: Fri Jun 24 05:41:38 2011 New Revision: 223491 URL: http://svn.freebsd.org/changeset/base/223491 Log: Acknowledge Edwin Groothuis for the major rewrite he did of the tftpd and tftp code to support TFTP blocksize. Modified: head/libexec/tftpd/tftpd.8 head/usr.bin/tftp/tftp.1 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Fri Jun 24 04:35:58 2011 (r223490) +++ head/libexec/tftpd/tftpd.8 Fri Jun 24 05:41:38 2011 (r223491) @@ -293,6 +293,12 @@ was introduced in support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in .Fx 7.4 . +.Pp +Edwin Groothuis performed a major rewrite of the +.Nm +and +.Xr tftp 1 +code to support RFC2348. .Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred without client and server supporting the TFTP blocksize option (RFC2348), Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Fri Jun 24 04:35:58 2011 (r223490) +++ head/usr.bin/tftp/tftp.1 Fri Jun 24 05:41:38 2011 (r223491) @@ -218,7 +218,7 @@ Toggle packet tracing. Toggle verbose mode. .El .Sh SEE ALSO -.Xr tftp 1 +.Xr tftpd 8 .Pp The following RFC's are supported: .Rs @@ -256,6 +256,12 @@ The .Nm command appeared in .Bx 4.3 . +.Pp +Edwin Groothuis performed a major rewrite of the +.Xr tftpd 8 +and +.Nm +code to support RFC2348. .Sh NOTES Because there is no user-login or validation within the From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 07:05:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B38F1065675; Fri, 24 Jun 2011 07:05:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1866C8FC14; Fri, 24 Jun 2011 07:05: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 p5O75KGw034559; Fri, 24 Jun 2011 07:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O75Kpf034546; Fri, 24 Jun 2011 07:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240705.p5O75Kpf034546@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:05: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: r223492 - in head/usr.sbin: ancontrol ifmcstat nfsd pmcstat ppp rpc.yppasswdd rpc.ypupdated sysinstall wpa/ndis_events wpa/wpa_supplicant X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 07:05:21 -0000 Author: kevlo Date: Fri Jun 24 07:05:20 2011 New Revision: 223492 URL: http://svn.freebsd.org/changeset/base/223492 Log: Remove duplicated header files Modified: head/usr.sbin/ancontrol/ancontrol.c head/usr.sbin/ifmcstat/ifmcstat.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/ppp/nat_cmd.c head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c head/usr.sbin/rpc.ypupdated/update.c head/usr.sbin/rpc.ypupdated/ypupdated_main.c head/usr.sbin/rpc.ypupdated/ypupdated_server.c head/usr.sbin/sysinstall/modules.c head/usr.sbin/wpa/ndis_events/ndis_events.c head/usr.sbin/wpa/wpa_supplicant/Packet32.c Modified: head/usr.sbin/ancontrol/ancontrol.c ============================================================================== --- head/usr.sbin/ancontrol/ancontrol.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ancontrol/ancontrol.c Fri Jun 24 07:05:20 2011 (r223492) @@ -40,7 +40,6 @@ static const char copyright[] = "@(#) Co __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ifmcstat/ifmcstat.c Fri Jun 24 07:05:20 2011 (r223492) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/nfsd/nfsd.c Fri Jun 24 07:05:20 2011 (r223492) @@ -71,7 +71,6 @@ static const char rcsid[] = #include #include #include -#include /* Global defs */ #ifdef DEBUG Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Fri Jun 24 07:05:20 2011 (r223492) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.sbin/ppp/nat_cmd.c ============================================================================== --- head/usr.sbin/ppp/nat_cmd.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/ppp/nat_cmd.c Fri Jun 24 07:05:20 2011 (r223492) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include Modified: head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c ============================================================================== --- head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c Fri Jun 24 07:05:20 2011 (r223492) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include /* getenv, exit */ -#include #include /* strcmp */ #include #include Modified: head/usr.sbin/rpc.ypupdated/update.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/update.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/update.c Fri Jun 24 07:05:20 2011 (r223492) @@ -57,7 +57,6 @@ static const char rcsid[] = #include #include #include -#include #include "ypupdated_extern.h" #ifdef YP Modified: head/usr.sbin/rpc.ypupdated/ypupdated_main.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/ypupdated_main.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/ypupdated_main.c Fri Jun 24 07:05:20 2011 (r223492) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "ypupdated_extern.h" #include "yp_extern.h" Modified: head/usr.sbin/rpc.ypupdated/ypupdated_server.c ============================================================================== --- head/usr.sbin/rpc.ypupdated/ypupdated_server.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/rpc.ypupdated/ypupdated_server.c Fri Jun 24 07:05:20 2011 (r223492) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "ypupdate_prot.h" #include "ypupdated_extern.h" Modified: head/usr.sbin/sysinstall/modules.c ============================================================================== --- head/usr.sbin/sysinstall/modules.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/sysinstall/modules.c Fri Jun 24 07:05:20 2011 (r223492) @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include Modified: head/usr.sbin/wpa/ndis_events/ndis_events.c ============================================================================== --- head/usr.sbin/wpa/ndis_events/ndis_events.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/wpa/ndis_events/ndis_events.c Fri Jun 24 07:05:20 2011 (r223492) @@ -42,11 +42,9 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include #include #include -#include #include #include #include Modified: head/usr.sbin/wpa/wpa_supplicant/Packet32.c ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/Packet32.c Fri Jun 24 05:41:38 2011 (r223491) +++ head/usr.sbin/wpa/wpa_supplicant/Packet32.c Fri Jun 24 07:05:20 2011 (r223492) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 07:18:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A68106566B; Fri, 24 Jun 2011 07:18:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E25FA8FC0A; Fri, 24 Jun 2011 07:18: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 p5O7IiQ6034972; Fri, 24 Jun 2011 07:18:44 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O7IiZ2034966; Fri, 24 Jun 2011 07:18:44 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240718.p5O7IiZ2034966@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:18: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: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 07:18:45 -0000 Author: kevlo Date: Fri Jun 24 07:18:44 2011 New Revision: 223493 URL: http://svn.freebsd.org/changeset/base/223493 Log: Remove duplicated header files Modified: head/usr.bin/ktrace/ktrace.c head/usr.bin/ncplogin/ncplogin.c head/usr.bin/systat/netstat.c head/usr.bin/tftp/main.c head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/ktrace/ktrace.c ============================================================================== --- head/usr.bin/ktrace/ktrace.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/ktrace/ktrace.c Fri Jun 24 07:18:44 2011 (r223493) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/ncplogin/ncplogin.c ============================================================================== --- head/usr.bin/ncplogin/ncplogin.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/ncplogin/ncplogin.c Fri Jun 24 07:18:44 2011 (r223493) @@ -42,8 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/systat/netstat.c Fri Jun 24 07:18:44 2011 (r223493) @@ -63,7 +63,6 @@ static const char sccsid[] = "@(#)netsta #define TCPSTATES #include #include -#include #include #include #include Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/tftp/main.c Fri Jun 24 07:18:44 2011 (r223493) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Jun 24 07:05:20 2011 (r223492) +++ head/usr.bin/vmstat/vmstat.c Fri Jun 24 07:18:44 2011 (r223493) @@ -43,7 +43,6 @@ static char sccsid[] = "@(#)vmstat.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 07:27:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D87106566B; Fri, 24 Jun 2011 07:27:12 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 830078FC14; Fri, 24 Jun 2011 07:27:12 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 2A5D17F398D; Fri, 24 Jun 2011 09:21:13 +0200 (CEST) Date: Fri, 24 Jun 2011 09:21:13 +0200 From: Roman Divacky To: Kevin Lo Message-ID: <20110624072113.GA52982@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106240718.p5O7IiZ2034966@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 07:27:12 -0000 On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Fri Jun 24 07:18:44 2011 > New Revision: 223493 > URL: http://svn.freebsd.org/changeset/base/223493 > > Log: > Remove duplicated header files You may be interested in this tool: http://code.google.com/p/include-what-you-use/ From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 07:29:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB99106566C; Fri, 24 Jun 2011 07:29:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id A9FD48FC17; Fri, 24 Jun 2011 07:29: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 p5O7T4YN035301; Fri, 24 Jun 2011 07:29:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5O7T4jn035297; Fri, 24 Jun 2011 07:29:04 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106240729.p5O7T4jn035297@svn.freebsd.org> From: Kevin Lo Date: Fri, 24 Jun 2011 07:29: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: r223494 - in head: bin/rcp bin/sh sbin/savecore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 07:29:04 -0000 Author: kevlo Date: Fri Jun 24 07:29:04 2011 New Revision: 223494 URL: http://svn.freebsd.org/changeset/base/223494 Log: Remove duplicated header files Modified: head/bin/rcp/rcp.c head/bin/sh/mkinit.c head/sbin/savecore/savecore.c Modified: head/bin/rcp/rcp.c ============================================================================== --- head/bin/rcp/rcp.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/bin/rcp/rcp.c Fri Jun 24 07:29:04 2011 (r223494) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "extern.h" Modified: head/bin/sh/mkinit.c ============================================================================== --- head/bin/sh/mkinit.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/bin/sh/mkinit.c Fri Jun 24 07:29:04 2011 (r223494) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); */ -#include #include #include #include Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Fri Jun 24 07:18:44 2011 (r223493) +++ head/sbin/savecore/savecore.c Fri Jun 24 07:29:04 2011 (r223494) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 08:05:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A876E1065672; Fri, 24 Jun 2011 08:05:48 +0000 (UTC) Date: Fri, 24 Jun 2011 08:05:48 +0000 From: Alexander Best To: Roman Divacky Message-ID: <20110624080548.GA60075@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> <20110624072113.GA52982@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110624072113.GA52982@freebsd.org> Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 08:05:48 -0000 On Fri Jun 24 11, Roman Divacky wrote: > On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Jun 24 07:18:44 2011 > > New Revision: 223493 > > URL: http://svn.freebsd.org/changeset/base/223493 > > > > Log: > > Remove duplicated header files > > You may be interested in this tool: > > http://code.google.com/p/include-what-you-use/ did they add C support since the last time i tested it? back then it only worked with CPP code, iirc. it was possible to thorw it at C code, but it returned pretty useless results. cheers. alex From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 08:10:30 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF1F8106566B; Fri, 24 Jun 2011 08:10:30 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 358EB8FC0C; Fri, 24 Jun 2011 08:10:29 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p5O7dkio015175; Fri, 24 Jun 2011 15:39:46 +0800 (CST) From: Kevin Lo To: Roman Divacky In-Reply-To: <20110624072113.GA52982@freebsd.org> References: <201106240718.p5O7IiZ2034966@svn.freebsd.org> <20110624072113.GA52982@freebsd.org> Content-Type: text/plain; charset="UTF-8" Date: Fri, 24 Jun 2011 15:39:31 +0800 Message-ID: <1308901171.2301.1.camel@nsl> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223493 - in head/usr.bin: ktrace ncplogin systat tftp vmstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 08:10:30 -0000 On 五, 2011-06-24 at 09:21 +0200, Roman Divacky wrote: > On Fri, Jun 24, 2011 at 07:18:44AM +0000, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Jun 24 07:18:44 2011 > > New Revision: 223493 > > URL: http://svn.freebsd.org/changeset/base/223493 > > > > Log: > > Remove duplicated header files > > You may be interested in this tool: > > http://code.google.com/p/include-what-you-use/ Hi Roman, Cool! Thanks for that info, I'll give it a try. Kevin From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 11:14:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C249106566C; Fri, 24 Jun 2011 11:14:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5208FC12; Fri, 24 Jun 2011 11:14: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 p5OBEA9N051874; Fri, 24 Jun 2011 11:14:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OBEAV6051869; Fri, 24 Jun 2011 11:14:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241114.p5OBEAV6051869@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 11:14: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: r223495 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 11:14:10 -0000 Author: hselasky Date: Fri Jun 24 11:14:09 2011 New Revision: 223495 URL: http://svn.freebsd.org/changeset/base/223495 Log: - Add two new API's to libusb20 which can be used to retrive information about the parent USB device: - libusb20_dev_get_parent_address - libusb20_dev_get_parent_port - Rename libusb20_compat01.c into libusb01.c MFC after: 3 days Added: head/lib/libusb/libusb01.c - copied unchanged from r216431, head/lib/libusb/libusb20_compat01.c Deleted: head/lib/libusb/libusb20_compat01.c Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Fri Jun 24 07:29:04 2011 (r223494) +++ head/lib/libusb/Makefile Fri Jun 24 11:14:09 2011 (r223495) @@ -22,7 +22,7 @@ MLINKS+= libusb.3 usb.3 # libusb 0.1 compat INCS+= usb.h -SRCS+= libusb20_compat01.c +SRCS+= libusb01.c # libusb 1.0 compat INCS+= libusb.h @@ -184,6 +184,8 @@ MLINKS += libusb20.3 libusb20_dev_get_de MLINKS += libusb20.3 libusb20_dev_alloc_config.3 MLINKS += libusb20.3 libusb20_dev_alloc.3 MLINKS += libusb20.3 libusb20_dev_get_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_address.3 +MLINKS += libusb20.3 libusb20_dev_get_parent_port.3 MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 MLINKS += libusb20.3 libusb20_dev_get_mode.3 MLINKS += libusb20.3 libusb20_dev_get_speed.3 Copied: head/lib/libusb/libusb01.c (from r216431, head/lib/libusb/libusb20_compat01.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb01.c Fri Jun 24 11:14:09 2011 (r223495, copy of r216431, head/lib/libusb/libusb20_compat01.c) @@ -0,0 +1,945 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2008 Hans Petter Selasky. 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. + */ + +/* + * This file contains the emulation layer for LibUSB v0.1 from sourceforge. + */ + +#include + +#include +#include +#include + +#include "libusb20.h" +#include "libusb20_desc.h" +#include "libusb20_int.h" +#include "usb.h" + +/* + * The two following macros were taken from the original LibUSB v0.1 + * for sake of compatibility: + */ +#define LIST_ADD(begin, ent) \ + do { \ + if (begin) { \ + ent->next = begin; \ + ent->next->prev = ent; \ + } else { \ + ent->next = NULL; \ + } \ + ent->prev = NULL; \ + begin = ent; \ + } while(0) + +#define LIST_DEL(begin, ent) \ + do { \ + if (ent->prev) { \ + ent->prev->next = ent->next; \ + } else { \ + begin = ent->next; \ + } \ + if (ent->next) { \ + ent->next->prev = ent->prev; \ + } \ + ent->prev = NULL; \ + ent->next = NULL; \ + } while (0) + +struct usb_bus *usb_busses = NULL; + +static struct usb_bus usb_global_bus = { + .dirname = {"/dev/usb"}, + .root_dev = NULL, + .devices = NULL, +}; + +static struct libusb20_backend *usb_backend = NULL; + +struct usb_parse_state { + + struct { + struct libusb20_endpoint *currep; + struct libusb20_interface *currifc; + struct libusb20_config *currcfg; + struct libusb20_me_struct *currextra; + } a; + + struct { + struct usb_config_descriptor *currcfg; + struct usb_interface_descriptor *currifc; + struct usb_endpoint_descriptor *currep; + struct usb_interface *currifcw; + uint8_t *currextra; + } b; + + uint8_t preparse; +}; + +static struct libusb20_transfer * +usb_get_transfer_by_ep_no(usb_dev_handle * dev, uint8_t ep_no) +{ + struct libusb20_device *pdev = (void *)dev; + struct libusb20_transfer *xfer; + int err; + uint32_t bufsize; + uint8_t x; + uint8_t speed; + + x = (ep_no & LIBUSB20_ENDPOINT_ADDRESS_MASK) * 2; + + if (ep_no & LIBUSB20_ENDPOINT_DIR_MASK) { + /* this is an IN endpoint */ + x |= 1; + } + speed = libusb20_dev_get_speed(pdev); + + /* select a sensible buffer size */ + if (speed == LIBUSB20_SPEED_LOW) { + bufsize = 256; + } else if (speed == LIBUSB20_SPEED_FULL) { + bufsize = 4096; + } else { + bufsize = 16384; + } + + xfer = libusb20_tr_get_pointer(pdev, x); + + if (xfer == NULL) + return (xfer); + + err = libusb20_tr_open(xfer, bufsize, 1, ep_no); + if (err == LIBUSB20_ERROR_BUSY) { + /* already opened */ + return (xfer); + } else if (err) { + return (NULL); + } + /* success */ + return (xfer); +} + +usb_dev_handle * +usb_open(struct usb_device *dev) +{ + int err; + + err = libusb20_dev_open(dev->dev, 16 * 2); + if (err == LIBUSB20_ERROR_BUSY) { + /* + * Workaround buggy USB applications which open the USB + * device multiple times: + */ + return (dev->dev); + } + if (err) + return (NULL); + + /* + * Dequeue USB device from backend queue so that it does not get + * freed when the backend is re-scanned: + */ + libusb20_be_dequeue_device(usb_backend, dev->dev); + + return (dev->dev); +} + +int +usb_close(usb_dev_handle * udev) +{ + struct usb_device *dev; + int err; + + err = libusb20_dev_close((void *)udev); + + if (err) + return (-1); + + if (usb_backend != NULL) { + /* + * Enqueue USB device to backend queue so that it gets freed + * when the backend is re-scanned: + */ + libusb20_be_enqueue_device(usb_backend, (void *)udev); + } else { + /* + * The backend is gone. Free device data so that we + * don't start leaking memory! + */ + dev = usb_device(udev); + libusb20_dev_free((void *)udev); + LIST_DEL(usb_global_bus.devices, dev); + free(dev); + } + return (0); +} + +int +usb_get_string(usb_dev_handle * dev, int strindex, + int langid, char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_sync((void *)dev, + strindex, langid, buf, buflen); + + if (err) + return (-1); + + return (0); +} + +int +usb_get_string_simple(usb_dev_handle * dev, int strindex, + char *buf, size_t buflen) +{ + int err; + + err = libusb20_dev_req_string_simple_sync((void *)dev, + strindex, buf, buflen); + + if (err) + return (-1); + + return (strlen(buf)); +} + +int +usb_get_descriptor_by_endpoint(usb_dev_handle * udev, int ep, uint8_t type, + uint8_t ep_index, void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, ep | USB_ENDPOINT_IN, + USB_REQ_GET_DESCRIPTOR, (type << 8) + ep_index, 0, + buf, size, 1000)); +} + +int +usb_get_descriptor(usb_dev_handle * udev, uint8_t type, uint8_t desc_index, + void *buf, int size) +{ + memset(buf, 0, size); + + return (usb_control_msg(udev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (type << 8) + desc_index, 0, buf, size, 1000)); +} + +int +usb_parse_descriptor(uint8_t *source, char *description, void *dest) +{ + uint8_t *sp = source; + uint8_t *dp = dest; + uint16_t w; + uint32_t d; + char *cp; + + for (cp = description; *cp; cp++) { + switch (*cp) { + case 'b': /* 8-bit byte */ + *dp++ = *sp++; + break; + /* + * 16-bit word, convert from little endian to CPU + */ + case 'w': + w = (sp[1] << 8) | sp[0]; + sp += 2; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + *((uint16_t *)dp) = w; + dp += 2; + break; + /* + * 32-bit dword, convert from little endian to CPU + */ + case 'd': + d = (sp[3] << 24) | (sp[2] << 16) | + (sp[1] << 8) | sp[0]; + sp += 4; + /* Align to word boundary */ + dp += ((dp - (uint8_t *)0) & 1); + /* Align to double word boundary */ + dp += ((dp - (uint8_t *)0) & 2); + *((uint32_t *)dp) = d; + dp += 4; + break; + } + } + return (sp - source); +} + +static void +usb_parse_extra(struct usb_parse_state *ps, uint8_t **pptr, int *plen) +{ + void *ptr; + uint16_t len; + + ptr = ps->a.currextra->ptr; + len = ps->a.currextra->len; + + if (ps->preparse == 0) { + memcpy(ps->b.currextra, ptr, len); + *pptr = ps->b.currextra; + *plen = len; + } + ps->b.currextra += len; + return; +} + +static void +usb_parse_endpoint(struct usb_parse_state *ps) +{ + struct usb_endpoint_descriptor *bep; + struct libusb20_endpoint *aep; + + aep = ps->a.currep; + bep = ps->b.currep++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bep->bLength = aep->desc.bLength; + bep->bDescriptorType = aep->desc.bDescriptorType; + bep->bEndpointAddress = aep->desc.bEndpointAddress; + bep->bmAttributes = aep->desc.bmAttributes; + bep->wMaxPacketSize = aep->desc.wMaxPacketSize; + bep->bInterval = aep->desc.bInterval; + bep->bRefresh = aep->desc.bRefresh; + bep->bSynchAddress = aep->desc.bSynchAddress; + } + ps->a.currextra = &aep->extra; + usb_parse_extra(ps, &bep->extra, &bep->extralen); + return; +} + +static void +usb_parse_iface_sub(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface_descriptor *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifc++; + + if (ps->preparse == 0) { + /* copy descriptor fields */ + bifc->bLength = aifc->desc.bLength; + bifc->bDescriptorType = aifc->desc.bDescriptorType; + bifc->bInterfaceNumber = aifc->desc.bInterfaceNumber; + bifc->bAlternateSetting = aifc->desc.bAlternateSetting; + bifc->bNumEndpoints = aifc->num_endpoints; + bifc->bInterfaceClass = aifc->desc.bInterfaceClass; + bifc->bInterfaceSubClass = aifc->desc.bInterfaceSubClass; + bifc->bInterfaceProtocol = aifc->desc.bInterfaceProtocol; + bifc->iInterface = aifc->desc.iInterface; + bifc->endpoint = ps->b.currep; + } + for (x = 0; x != aifc->num_endpoints; x++) { + ps->a.currep = aifc->endpoints + x; + usb_parse_endpoint(ps); + } + + ps->a.currextra = &aifc->extra; + usb_parse_extra(ps, &bifc->extra, &bifc->extralen); + return; +} + +static void +usb_parse_iface(struct usb_parse_state *ps) +{ + struct libusb20_interface *aifc; + struct usb_interface *bifc; + uint8_t x; + + aifc = ps->a.currifc; + bifc = ps->b.currifcw++; + + if (ps->preparse == 0) { + /* initialise interface wrapper */ + bifc->altsetting = ps->b.currifc; + bifc->num_altsetting = aifc->num_altsetting + 1; + } + usb_parse_iface_sub(ps); + + for (x = 0; x != aifc->num_altsetting; x++) { + ps->a.currifc = aifc->altsetting + x; + usb_parse_iface_sub(ps); + } + return; +} + +static void +usb_parse_config(struct usb_parse_state *ps) +{ + struct libusb20_config *acfg; + struct usb_config_descriptor *bcfg; + uint8_t x; + + acfg = ps->a.currcfg; + bcfg = ps->b.currcfg; + + if (ps->preparse == 0) { + /* initialise config wrapper */ + bcfg->bLength = acfg->desc.bLength; + bcfg->bDescriptorType = acfg->desc.bDescriptorType; + bcfg->wTotalLength = acfg->desc.wTotalLength; + bcfg->bNumInterfaces = acfg->num_interface; + bcfg->bConfigurationValue = acfg->desc.bConfigurationValue; + bcfg->iConfiguration = acfg->desc.iConfiguration; + bcfg->bmAttributes = acfg->desc.bmAttributes; + bcfg->MaxPower = acfg->desc.bMaxPower; + bcfg->interface = ps->b.currifcw; + } + for (x = 0; x != acfg->num_interface; x++) { + ps->a.currifc = acfg->interface + x; + usb_parse_iface(ps); + } + + ps->a.currextra = &acfg->extra; + usb_parse_extra(ps, &bcfg->extra, &bcfg->extralen); + return; +} + +int +usb_parse_configuration(struct usb_config_descriptor *config, + uint8_t *buffer) +{ + struct usb_parse_state ps; + uint8_t *ptr; + uint32_t a; + uint32_t b; + uint32_t c; + uint32_t d; + + if ((buffer == NULL) || (config == NULL)) { + return (-1); + } + memset(&ps, 0, sizeof(ps)); + + ps.a.currcfg = libusb20_parse_config_desc(buffer); + ps.b.currcfg = config; + if (ps.a.currcfg == NULL) { + /* could not parse config or out of memory */ + return (-1); + } + /* do the pre-parse */ + ps.preparse = 1; + usb_parse_config(&ps); + + a = ((uint8_t *)(ps.b.currifcw) - ((uint8_t *)0)); + b = ((uint8_t *)(ps.b.currifc) - ((uint8_t *)0)); + c = ((uint8_t *)(ps.b.currep) - ((uint8_t *)0)); + d = ((uint8_t *)(ps.b.currextra) - ((uint8_t *)0)); + + /* allocate memory for our configuration */ + ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } + + /* "currifcw" must be first, hence this pointer is freed */ + ps.b.currifcw = (void *)(ptr); + ps.b.currifc = (void *)(ptr + a); + ps.b.currep = (void *)(ptr + a + b); + ps.b.currextra = (void *)(ptr + a + b + c); + + /* generate a libusb v0.1 compatible structure */ + ps.preparse = 0; + usb_parse_config(&ps); + + /* free config structure */ + free(ps.a.currcfg); + + return (0); /* success */ +} + +void +usb_destroy_configuration(struct usb_device *dev) +{ + uint8_t c; + + if (dev->config == NULL) { + return; + } + for (c = 0; c != dev->descriptor.bNumConfigurations; c++) { + struct usb_config_descriptor *cf = &dev->config[c]; + + if (cf->interface != NULL) { + free(cf->interface); + cf->interface = NULL; + } + } + + free(dev->config); + dev->config = NULL; + return; +} + +void +usb_fetch_and_parse_descriptors(usb_dev_handle * udev) +{ + struct usb_device *dev; + struct libusb20_device *pdev; + uint8_t *ptr; + int error; + uint32_t size; + uint16_t len; + uint8_t x; + + if (udev == NULL) { + /* be NULL safe */ + return; + } + dev = usb_device(udev); + pdev = (void *)udev; + + if (dev->descriptor.bNumConfigurations == 0) { + /* invalid device */ + return; + } + size = dev->descriptor.bNumConfigurations * + sizeof(struct usb_config_descriptor); + + dev->config = malloc(size); + if (dev->config == NULL) { + /* out of memory */ + return; + } + memset(dev->config, 0, size); + + for (x = 0; x != dev->descriptor.bNumConfigurations; x++) { + + error = (pdev->methods->get_config_desc_full) ( + pdev, &ptr, &len, x); + + if (error) { + usb_destroy_configuration(dev); + return; + } + usb_parse_configuration(dev->config + x, ptr); + + /* free config buffer */ + free(ptr); + } + return; +} + +static int +usb_std_io(usb_dev_handle * dev, int ep, char *bytes, int size, + int timeout, int is_intr) +{ + struct libusb20_transfer *xfer; + uint32_t temp; + uint32_t maxsize; + uint32_t actlen; + char *oldbytes; + + xfer = usb_get_transfer_by_ep_no(dev, ep); + if (xfer == NULL) + return (-1); + + if (libusb20_tr_pending(xfer)) { + /* there is already a transfer ongoing */ + return (-1); + } + maxsize = libusb20_tr_get_max_total_length(xfer); + oldbytes = bytes; + + /* + * We allow transferring zero bytes which is the same + * equivalent to a zero length USB packet. + */ + do { + + temp = size; + if (temp > maxsize) { + /* find maximum possible length */ + temp = maxsize; + } + if (is_intr) + libusb20_tr_setup_intr(xfer, bytes, temp, timeout); + else + libusb20_tr_setup_bulk(xfer, bytes, temp, timeout); + + libusb20_tr_start(xfer); + + while (1) { + + if (libusb20_dev_process((void *)dev) != 0) { + /* device detached */ + return (-1); + } + if (libusb20_tr_pending(xfer) == 0) { + /* transfer complete */ + break; + } + /* wait for USB event from kernel */ + libusb20_dev_wait_process((void *)dev, -1); + } + + switch (libusb20_tr_get_status(xfer)) { + case 0: + /* success */ + break; + case LIBUSB20_TRANSFER_TIMED_OUT: + /* transfer timeout */ + return (-ETIMEDOUT); + default: + /* other transfer error */ + return (-ENXIO); + } + actlen = libusb20_tr_get_actual_length(xfer); + + bytes += actlen; + size -= actlen; + + if (actlen != temp) { + /* short transfer */ + break; + } + } while (size > 0); + + return (bytes - oldbytes); +} + +int +usb_bulk_write(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep & ~USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 0)); +} + +int +usb_bulk_read(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep | USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 0)); +} + +int +usb_interrupt_write(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep & ~USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 1)); +} + +int +usb_interrupt_read(usb_dev_handle * dev, int ep, char *bytes, + int size, int timeout) +{ + return (usb_std_io(dev, ep | USB_ENDPOINT_DIR_MASK, + bytes, size, timeout, 1)); +} + +int +usb_control_msg(usb_dev_handle * dev, int requesttype, int request, + int value, int wIndex, char *bytes, int size, int timeout) +{ + struct LIBUSB20_CONTROL_SETUP_DECODED req; + int err; + uint16_t actlen; + + LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &req); + + req.bmRequestType = requesttype; + req.bRequest = request; + req.wValue = value; + req.wIndex = wIndex; + req.wLength = size; + + err = libusb20_dev_request_sync((void *)dev, &req, bytes, + &actlen, timeout, 0); + + if (err) + return (-1); + + return (actlen); +} + +int +usb_set_configuration(usb_dev_handle * udev, int bConfigurationValue) +{ + struct usb_device *dev; + int err; + uint8_t i; + + /* + * Need to translate from "bConfigurationValue" to + * configuration index: + */ + + if (bConfigurationValue == 0) { + /* unconfigure */ + i = 255; + } else { + /* lookup configuration index */ + dev = usb_device(udev); + + /* check if the configuration array is not there */ + if (dev->config == NULL) { + return (-1); + } + for (i = 0;; i++) { + if (i == dev->descriptor.bNumConfigurations) { + /* "bConfigurationValue" not found */ + return (-1); + } + if ((dev->config + i)->bConfigurationValue == + bConfigurationValue) { + break; + } + } + } + + err = libusb20_dev_set_config_index((void *)udev, i); + + if (err) + return (-1); + + return (0); +} + +int +usb_claim_interface(usb_dev_handle * dev, int interface) +{ + struct libusb20_device *pdev = (void *)dev; + + pdev->claimed_interface = interface; + + return (0); +} + +int +usb_release_interface(usb_dev_handle * dev, int interface) +{ + /* do nothing */ + return (0); +} + +int +usb_set_altinterface(usb_dev_handle * dev, int alternate) +{ + struct libusb20_device *pdev = (void *)dev; + int err; + uint8_t iface; + + iface = pdev->claimed_interface; + + err = libusb20_dev_set_alt_index((void *)dev, iface, alternate); + + if (err) + return (-1); + + return (0); +} + +int +usb_resetep(usb_dev_handle * dev, unsigned int ep) +{ + /* emulate an endpoint reset through clear-STALL */ + return (usb_clear_halt(dev, ep)); +} + +int +usb_clear_halt(usb_dev_handle * dev, unsigned int ep) +{ + struct libusb20_transfer *xfer; + + xfer = usb_get_transfer_by_ep_no(dev, ep); + if (xfer == NULL) + return (-1); + + libusb20_tr_clear_stall_sync(xfer); + + return (0); +} + +int +usb_reset(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_reset((void *)dev); + + if (err) + return (-1); + + /* + * Be compatible with LibUSB from sourceforge and close the + * handle after reset! + */ + return (usb_close(dev)); +} + +int +usb_check_connected(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_check_connected((void *)dev); + + if (err) + return (-1); + + return (0); +} + +const char * +usb_strerror(void) +{ + /* TODO */ + return ("Unknown error"); +} + +void +usb_init(void) +{ + /* nothing to do */ + return; +} + +void +usb_set_debug(int level) +{ + /* use kernel UGEN debugging if you need to see what is going on */ + return; +} + +int +usb_find_busses(void) +{ + usb_busses = &usb_global_bus; + return (1); +} + +int +usb_find_devices(void) +{ + struct libusb20_device *pdev; + struct usb_device *udev; + struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + int devnum; + int err; + + /* cleanup after last device search */ + /* close all opened devices, if any */ + + while ((pdev = libusb20_be_device_foreach(usb_backend, NULL))) { + udev = pdev->privLuData; + libusb20_be_dequeue_device(usb_backend, pdev); + libusb20_dev_free(pdev); + if (udev != NULL) { + LIST_DEL(usb_global_bus.devices, udev); + free(udev); + } + } + + /* free old USB backend, if any */ + + libusb20_be_free(usb_backend); + + /* do a new backend device search */ + usb_backend = libusb20_be_alloc_default(); + if (usb_backend == NULL) { + return (-1); + } + /* iterate all devices */ + + devnum = 1; + pdev = NULL; + while ((pdev = libusb20_be_device_foreach(usb_backend, pdev))) { + udev = malloc(sizeof(*udev)); + if (udev == NULL) + break; + + memset(udev, 0, sizeof(*udev)); + + udev->bus = &usb_global_bus; + + snprintf(udev->filename, sizeof(udev->filename), + "/dev/ugen%u.%u", + libusb20_dev_get_bus_number(pdev), + libusb20_dev_get_address(pdev)); + + ddesc = libusb20_dev_get_device_desc(pdev); + + udev->descriptor.bLength = sizeof(udev->descriptor); + udev->descriptor.bDescriptorType = ddesc->bDescriptorType; + udev->descriptor.bcdUSB = ddesc->bcdUSB; + udev->descriptor.bDeviceClass = ddesc->bDeviceClass; + udev->descriptor.bDeviceSubClass = ddesc->bDeviceSubClass; + udev->descriptor.bDeviceProtocol = ddesc->bDeviceProtocol; + udev->descriptor.bMaxPacketSize0 = ddesc->bMaxPacketSize0; + udev->descriptor.idVendor = ddesc->idVendor; + udev->descriptor.idProduct = ddesc->idProduct; + udev->descriptor.bcdDevice = ddesc->bcdDevice; + udev->descriptor.iManufacturer = ddesc->iManufacturer; + udev->descriptor.iProduct = ddesc->iProduct; + udev->descriptor.iSerialNumber = ddesc->iSerialNumber; + udev->descriptor.bNumConfigurations = + ddesc->bNumConfigurations; + if (udev->descriptor.bNumConfigurations > USB_MAXCONFIG) { + /* truncate number of configurations */ + udev->descriptor.bNumConfigurations = USB_MAXCONFIG; + } + udev->devnum = devnum++; + /* link together the two structures */ + udev->dev = pdev; + pdev->privLuData = udev; + + err = libusb20_dev_open(pdev, 0); + if (err == 0) { + /* XXX get all config descriptors by default */ + usb_fetch_and_parse_descriptors((void *)pdev); + libusb20_dev_close(pdev); + } + LIST_ADD(usb_global_bus.devices, udev); + } + + return (devnum - 1); /* success */ +} + +struct usb_device * +usb_device(usb_dev_handle * dev) +{ + struct libusb20_device *pdev; + + pdev = (void *)dev; + + return (pdev->privLuData); +} + +struct usb_bus * +usb_get_busses(void) +{ + return (usb_busses); +} Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Fri Jun 24 07:29:04 2011 (r223494) +++ head/lib/libusb/libusb20.3 Fri Jun 24 11:14:09 2011 (r223495) @@ -159,6 +159,10 @@ USB access library (libusb -lusb) .Ft uint8_t .Fn libusb20_dev_get_address "struct libusb20_device *pdev" .Ft uint8_t +.Fn libusb20_dev_get_parent_address "struct libusb20_device *pdev" +.Ft uint8_t +.Fn libusb20_dev_get_parent_port "struct libusb20_device *pdev" +.Ft uint8_t .Fn libusb20_dev_get_bus_number "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_mode "struct libusb20_device *pdev" @@ -756,12 +760,31 @@ is an internal function to allocate a ne .Fn libusb20_dev_get_address returns the internal and not necessarily the real hardware address of the given USB device. +Valid addresses start at one. +. +.Pp +. +.Fn libusb20_dev_get_parent_address +returns the internal and not necessarily the real hardware address of +the given parent USB HUB device. +This value is zero for the root HUB which usually has a device address +equal to one. +Valid addresses start at one. +. +.Pp +. +.Fn libusb20_dev_get_parent_port +returns the port number on the parent USB HUB device. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 11:39:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D0F31065670; Fri, 24 Jun 2011 11:39:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C5398FC18; Fri, 24 Jun 2011 11:39:33 +0000 (UTC) Received: by gxk28 with SMTP id 28so1437208gxk.13 for ; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FfiIKhI1itQWoBkAADFYsVCwDaOxgSoytgKFUHT19/Y=; b=xaLJMJzwRPWRJiW7VA/FkRqpAIjqnuZuIazA7QSY5dqot5zL5PJa6siIrymtfn3v6z 0STGxgEKH7ADb3+FjlBcNcXIt6eCLhdcdSN2u33a9enkKuDR686WnwW6z2A5QhueNnj/ Llu4bM2uToFlqXy6iC9+CCEbPxeM6yhRk99YM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=NLeNIOBAvqXaH408rq8f6j+MtD9eqQeR1IZPtbKQQL8Kff9pIvTkeh6RFT6ScZNDfk F87SUhvrCjLWiCamO4YUIy9DPoRvd1+cOU67TUs2KVEaugHdx89Eaai0PGSn5HMZNCf+ H+Qcho/a+gd95N2o7snQ4B27zDMtmSDUWFW0A= MIME-Version: 1.0 Received: by 10.236.133.39 with SMTP id p27mr2605789yhi.135.1308915572662; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Fri, 24 Jun 2011 04:39:32 -0700 (PDT) In-Reply-To: References: <201106230524.p5N5O0Rs084548@svn.freebsd.org> <31243267-5FE1-4104-9B77-4F3EAAD4523B@FreeBSD.org> <4E039C0F.10505@rice.edu> Date: Fri, 24 Jun 2011 13:39:32 +0200 X-Google-Sender-Auth: bthJlVBxI4tt7v_1xn1B1fepZaU Message-ID: From: Attilio Rao To: "Jayachandran C." Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Alan Cox , Alan Cox , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r223464 - 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: Fri, 24 Jun 2011 11:39:34 -0000 2011/6/24 Jayachandran C. : > On Fri, Jun 24, 2011 at 1:33 AM, Alan Cox wrote: >> On 6/23/2011 1:30 PM, Warner Losh wrote: >>> >>> On Jun 23, 2011, at 2:17 AM, Bjoern A. Zeeb wrote: >>> >>>> On Jun 23, 2011, at 5:24 AM, Alan Cox wrote: >>>> >>>>> Author: alc >>>>> Date: Thu Jun 23 05:23:59 2011 >>>>> New Revision: 223464 >>>>> URL: http://svn.freebsd.org/changeset/base/223464 >>>>> >>>>> Log: >>>>> Revert to using the page queues lock in vm_page_clear_dirty_mask() on >>>>> MIPS. =C2=A0(At present, although atomic_clear_char() is defined by a= tomic.h >>>>> on MIPS, it is not actually implemented by support.S.) >>>> >>>> Thanks, >>>> and good catch on the atomics even if not planned, just in time for 9.= 0:) >>> >>> Yea, there's some work there to fix them... =C2=A0Not sure we can even = fix some >>> of them atomically... >>> >> >> I'm not sure that I understand what you mean by the second statement. = =C2=A0Can >> you elaborate? =C2=A0The 8- and 16-bit operations should be no less "ato= mic" than >> the 32- and 64-bit operations. =C2=A0In general, regardless of the size = of the >> operation, the "sc" instruction may fail and the whole operation has to = be >> restarted if another processor (or I/O device) performs a concurrent, ca= che >> coherent store to the same location (or even cache line) as the "ll" and >> "sc" instructions are operating on. =C2=A0On the other hand, if the "sc" >> instruction succeeds, whether you used it to change all of the 32 bits o= r >> just 8 of the 32 bits, it should appear as an atomic change to any other >> processor. > > I will try out an implementation and see if this works on XLR, if so > this is something we can add to support.S There is a chance we can leave all the atomic support inlined in atomic.h? When I looked into it, my opinion is that support.S part is just in the wrong place (and Warner didn't have a good explanation for it, so I don't see a problem about moving anything to atomic.h). Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 12:30:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FA9E106566B; Fri, 24 Jun 2011 12:30:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 80A018FC08; Fri, 24 Jun 2011 12:30: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 p5OCUh1j054011; Fri, 24 Jun 2011 12:30:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCUhSB054009; Fri, 24 Jun 2011 12:30:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241230.p5OCUhSB054009@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:30: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: r223496 - head/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: Fri, 24 Jun 2011 12:30:43 -0000 Author: adrian Date: Fri Jun 24 12:30:43 2011 New Revision: 223496 URL: http://svn.freebsd.org/changeset/base/223496 Log: Import one of the two missing US FCC DFS bands to FCC3. The FCC opened up this band sometime in 2009 (and ath was updated); but regdomain.xml wasn't updated. Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 11:14:09 2011 (r223495) +++ head/etc/regdomain.xml Fri Jun 24 12:30:43 2011 (r223496) @@ -138,6 +138,12 @@ 17 + + 20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_PASSIVE @@ -176,6 +182,20 @@ IEEE80211_CHAN_HT40 + + 20 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + + + 20 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_PASSIVE + IEEE80211_CHAN_DFS + + 23 IEEE80211_CHAN_HT20 From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 12:31:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A93B01065670; Fri, 24 Jun 2011 12:31:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5728FC26; Fri, 24 Jun 2011 12:31: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 p5OCVaZM054074; Fri, 24 Jun 2011 12:31:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCVaVr054072; Fri, 24 Jun 2011 12:31:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241231.p5OCVaVr054072@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:31: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: r223497 - head/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: Fri, 24 Jun 2011 12:31:36 -0000 Author: adrian Date: Fri Jun 24 12:31:36 2011 New Revision: 223497 URL: http://svn.freebsd.org/changeset/base/223497 Log: Fix an incorrect frequency band for HT/40 in the FCC SKU. Noticed by: bschmidt@ Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 12:30:43 2011 (r223496) +++ head/etc/regdomain.xml Fri Jun 24 12:31:36 2011 (r223497) @@ -83,7 +83,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 12:50:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833171065670; Fri, 24 Jun 2011 12:50:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 744ED8FC12; Fri, 24 Jun 2011 12:50: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 p5OCoIRQ054614; Fri, 24 Jun 2011 12:50:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCoIuN054612; Fri, 24 Jun 2011 12:50:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241250.p5OCoIuN054612@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 12:50: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: r223498 - head/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: Fri, 24 Jun 2011 12:50:18 -0000 Author: adrian Date: Fri Jun 24 12:50:18 2011 New Revision: 223498 URL: http://svn.freebsd.org/changeset/base/223498 Log: More incorrect HT/40 setups in FCC. Noticed-by: bschmidt@ Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 12:31:36 2011 (r223497) +++ head/etc/regdomain.xml Fri Jun 24 12:50:18 2011 (r223498) @@ -96,7 +96,7 @@ IEEE80211_CHAN_HT20 - + 17 IEEE80211_CHAN_HT40 @@ -106,7 +106,7 @@ IEEE80211_CHAN_HT20 - + 23 IEEE80211_CHAN_HT40 From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 12:55:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32C26106564A; Fri, 24 Jun 2011 12:55:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2337F8FC0C; Fri, 24 Jun 2011 12:55: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 p5OCtHLu054852; Fri, 24 Jun 2011 12:55:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OCtHmU054850; Fri, 24 Jun 2011 12:55:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106241255.p5OCtHmU054850@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 24 Jun 2011 12:55: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: r223499 - 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: Fri, 24 Jun 2011 12:55:17 -0000 Author: glebius Date: Fri Jun 24 12:55:16 2011 New Revision: 223499 URL: http://svn.freebsd.org/changeset/base/223499 Log: Actually, if code had followed style(9), there would be less stupid errors like the one fixed in r223416. Noticed by: julian Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Fri Jun 24 12:50:18 2011 (r223498) +++ head/sbin/ipfw/nat.c Fri Jun 24 12:55:16 2011 (r223499) @@ -738,7 +738,8 @@ ipfw_config_nat(int ac, char **av) char *id, *buf, **av1, *end; size_t len; - av++; ac--; + av++; + ac--; /* Nat id. */ if (ac == 0) errx(EX_DATAERR, "missing nat id"); @@ -746,7 +747,8 @@ ipfw_config_nat(int ac, char **av) i = (int)strtol(id, &end, 0); if (i <= 0 || *end != '\0') errx(EX_DATAERR, "illegal nat id: %s", id); - av++; ac--; + av++; + ac--; if (ac == 0) errx(EX_DATAERR, "missing option"); @@ -755,11 +757,13 @@ ipfw_config_nat(int ac, char **av) av1 = av; while (ac1 > 0) { tok = match_token(nat_params, *av1); - ac1--; av1++; + ac1--; + av1++; switch (tok) { case TOK_IP: case TOK_IF: - ac1--; av1++; + ac1--; + av1++; break; case TOK_ALOG: case TOK_DENY_INC: @@ -775,18 +779,22 @@ ipfw_config_nat(int ac, char **av) errx(EX_DATAERR, "redirect_addr: " "not enough arguments"); len += estimate_redir_addr(&ac1, &av1); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; break; case TOK_REDIR_PORT: if (ac1 < 3) errx(EX_DATAERR, "redirect_port: " "not enough arguments"); - av1++; ac1--; + av1++; + ac1--; len += estimate_redir_port(&ac1, &av1); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; /* Skip optional remoteIP/port */ if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } break; case TOK_REDIR_PROTO: @@ -794,13 +802,16 @@ ipfw_config_nat(int ac, char **av) errx(EX_DATAERR, "redirect_proto: " "not enough arguments"); len += sizeof(struct cfg_redir); - av1 += 2; ac1 -= 2; + av1 += 2; + ac1 -= 2; /* Skip optional remoteIP/port */ if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } if (ac1 != 0 && isdigit(**av1)) { - av1++; ac1--; + av1++; + ac1--; } break; default: @@ -819,7 +830,8 @@ ipfw_config_nat(int ac, char **av) while (ac > 0) { tok = match_token(nat_params, *av); - ac--; av++; + ac--; + av++; switch (tok) { case TOK_IP: if (ac == 0) @@ -827,13 +839,15 @@ ipfw_config_nat(int ac, char **av) if (!inet_aton(av[0], &(n->ip))) errx(EX_DATAERR, "bad ip address ``%s''", av[0]); - ac--; av++; + ac--; + av++; break; case TOK_IF: if (ac == 0) errx(EX_DATAERR, "missing option"); set_addr_dynamic(av[0], n); - ac--; av++; + ac--; + av++; break; case TOK_ALOG: n->mode |= PKT_ALIAS_LOG; @@ -912,7 +926,8 @@ ipfw_show_nat(int ac, char **av) data = NULL; frule = 0; lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ - ac--; av++; + ac--; + av++; if (co.test_only) return; From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 13:41:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCF90106564A; Fri, 24 Jun 2011 13:41:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id CBC468FC17; Fri, 24 Jun 2011 13:41: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 p5ODfkok056281; Fri, 24 Jun 2011 13:41:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ODfk3S056272; Fri, 24 Jun 2011 13:41:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241341.p5ODfk3S056272@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 13:41:46 +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: r223500 - in stable/8/sys: arm/arm ia64/ia64 kern mips/mips mips/rmi 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: Fri, 24 Jun 2011 13:41:47 -0000 Author: jhb Date: Fri Jun 24 13:41:46 2011 New Revision: 223500 URL: http://svn.freebsd.org/changeset/base/223500 Log: MFC 221218: Change rman_manage_region() to actually honor the rm_start and rm_end constraints on the rman and reject attempts to manage a region that is out of range. - Fix various places that set rm_end incorrectly (to ~0 or ~0u instead of ~0ul). - To preserve existing behavior, change rman_init() to set rm_start and rm_end to allow managing the full range (0 to ~0ul) if they are not set by the caller when rman_init() is called. Modified: stable/8/sys/arm/arm/nexus.c stable/8/sys/ia64/ia64/nexus.c stable/8/sys/kern/subr_rman.c stable/8/sys/mips/mips/mainbus.c stable/8/sys/mips/mips/nexus.c stable/8/sys/mips/rmi/pcibus.c (contents, props changed) stable/8/sys/mips/rmi/xlr_pci.c stable/8/sys/x86/x86/nexus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/arm/arm/nexus.c ============================================================================== --- stable/8/sys/arm/arm/nexus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/arm/arm/nexus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -110,10 +110,10 @@ nexus_probe(device_t dev) device_quiet(dev); /* suppress attach message for neatness */ mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory addresses"; - if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u)) + if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); return (0); Modified: stable/8/sys/ia64/ia64/nexus.c ============================================================================== --- stable/8/sys/ia64/ia64/nexus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/ia64/ia64/nexus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -174,7 +174,7 @@ nexus_probe(device_t dev) panic("nexus_probe port_rman"); mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) Modified: stable/8/sys/kern/subr_rman.c ============================================================================== --- stable/8/sys/kern/subr_rman.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/kern/subr_rman.c Fri Jun 24 13:41:46 2011 (r223500) @@ -138,6 +138,8 @@ rman_init(struct rman *rm) mtx_init(&rman_mtx, "rman head", NULL, MTX_DEF); } + if (rm->rm_start == 0 && rm->rm_end == 0) + rm->rm_end = ~0ul; if (rm->rm_type == RMAN_UNINIT) panic("rman_init"); if (rm->rm_type == RMAN_GAUGE) @@ -162,6 +164,8 @@ rman_manage_region(struct rman *rm, u_lo DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n", rm->rm_descr, start, end)); + if (start < rm->rm_start || end > rm->rm_end) + return EINVAL; r = int_alloc_resource(M_NOWAIT); if (r == NULL) return ENOMEM; Modified: stable/8/sys/mips/mips/mainbus.c ============================================================================== --- stable/8/sys/mips/mips/mainbus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/mips/mips/mainbus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -146,7 +146,7 @@ mainbus_probe(device_t dev) panic("mainbus_probe port_rman"); mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) Modified: stable/8/sys/mips/mips/nexus.c ============================================================================== --- stable/8/sys/mips/mips/nexus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/mips/mips/nexus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -151,7 +151,7 @@ nexus_probe(device_t dev) } mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "Memory addresses"; if (rman_init(&mem_rman) != 0 || Modified: stable/8/sys/mips/rmi/pcibus.c ============================================================================== --- stable/8/sys/mips/rmi/pcibus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/mips/rmi/pcibus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.36 2005/01/05 20:05:52 imp Exp $"); +__FBSDID("$FreeBSD$"); #include "opt_isa.h" @@ -229,7 +229,7 @@ pci_init_resources(void) panic("pci_init_resources irq_rman"); port_rman.rm_start = 0; - port_rman.rm_end = ~0u; + port_rman.rm_end = ~0ul; port_rman.rm_type = RMAN_ARRAY; port_rman.rm_descr = "I/O ports"; if (rman_init(&port_rman) @@ -237,7 +237,7 @@ pci_init_resources(void) panic("pci_init_resources port_rman"); mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory"; if (rman_init(&mem_rman) Modified: stable/8/sys/mips/rmi/xlr_pci.c ============================================================================== --- stable/8/sys/mips/rmi/xlr_pci.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/mips/rmi/xlr_pci.c Fri Jun 24 13:41:46 2011 (r223500) @@ -133,7 +133,7 @@ xlr_pci_init_resources(void) panic("pci_init_resources irq_rman"); port_rman.rm_start = 0; - port_rman.rm_end = ~0u; + port_rman.rm_end = ~0ul; port_rman.rm_type = RMAN_ARRAY; port_rman.rm_descr = "I/O ports"; if (rman_init(&port_rman) @@ -141,7 +141,7 @@ xlr_pci_init_resources(void) panic("pci_init_resources port_rman"); mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory"; if (rman_init(&mem_rman) Modified: stable/8/sys/x86/x86/nexus.c ============================================================================== --- stable/8/sys/x86/x86/nexus.c Fri Jun 24 12:55:16 2011 (r223499) +++ stable/8/sys/x86/x86/nexus.c Fri Jun 24 13:41:46 2011 (r223500) @@ -266,7 +266,7 @@ nexus_init_resources(void) panic("nexus_init_resources port_rman"); mem_rman.rm_start = 0; - mem_rman.rm_end = ~0u; + mem_rman.rm_end = ~0ul; mem_rman.rm_type = RMAN_ARRAY; mem_rman.rm_descr = "I/O memory addresses"; if (rman_init(&mem_rman) From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 13:45:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53DF1065673; Fri, 24 Jun 2011 13:45:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id B3CAE8FC15; Fri, 24 Jun 2011 13:45: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 p5ODjEl8056454; Fri, 24 Jun 2011 13:45:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ODjE6q056449; Fri, 24 Jun 2011 13:45:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241345.p5ODjE6q056449@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 13:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223501 - in stable/8: share/man/man9 sys/kern 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: Fri, 24 Jun 2011 13:45:14 -0000 Author: jhb Date: Fri Jun 24 13:45:14 2011 New Revision: 223501 URL: http://svn.freebsd.org/changeset/base/223501 Log: MFC 221220: Extend the rman(9) API to support altering an existing resource. Specifically, these changes allow a resource to back a relocatable and resizable resource such as the I/O window decoders in PCI-PCI bridges. - rman_adjust_resource() can adjust the start and end address of an existing resource. It only succeeds if the newly requested address space is already free. It also supports shrinking a resource in which case the freed space will be marked unallocated in the rman. - rman_first_free_region() and rman_last_free_region() return the start and end addresses for the first or last unallocated region in an rman, respectively. This can be used to determine by how much the resource backing an rman must be adjusted to accomodate an allocation request that does not fit into the existing rman. While here, document the rm_start and rm_end fields in struct rman, rman_is_region_manager(), the bound argument to rman_reserve_resource_bound(), and rman_init_from_resource(). Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/rman.9 stable/8/sys/kern/subr_rman.c stable/8/sys/sys/rman.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Jun 24 13:41:46 2011 (r223500) +++ stable/8/share/man/man9/Makefile Fri Jun 24 13:45:14 2011 (r223501) @@ -959,9 +959,11 @@ MLINKS+=refcount.9 refcount_acquire.9 \ MLINKS+=resource_int_value.9 resource_long_value.9 \ resource_int_value.9 resource_string_value.9 MLINKS+=rman.9 rman_activate_resource.9 \ + rman.9 rman_adjust_resource.9 \ rman.9 rman_await_resource.9 \ rman.9 rman_deactivate_resource.9 \ rman.9 rman_fini.9 \ + rman.9 rman_first_free_region.9 \ rman.9 rman_get_bushandle.9 \ rman.9 rman_get_bustag.9 \ rman.9 rman_get_device.9 \ @@ -972,6 +974,9 @@ MLINKS+=rman.9 rman_activate_resource.9 rman.9 rman_get_start.9 \ rman.9 rman_get_virtual.9 \ rman.9 rman_init.9 \ + rman.9 rman_init_from_resource.9 \ + rman.9 rman_is_region_manager.9 \ + rman.9 rman_last_free_region.9 \ rman.9 rman_make_alignment_flags.9 \ rman.9 rman_manage_region.9 \ rman.9 rman_release_resource.9 \ Modified: stable/8/share/man/man9/rman.9 ============================================================================== --- stable/8/share/man/man9/rman.9 Fri Jun 24 13:41:46 2011 (r223500) +++ stable/8/share/man/man9/rman.9 Fri Jun 24 13:45:14 2011 (r223501) @@ -25,17 +25,22 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2007 +.Dd April 29, 2011 .Dt RMAN 9 .Os .Sh NAME .Nm rman , .Nm rman_activate_resource , +.Nm rman_adjust_resource , .Nm rman_await_resource , .Nm rman_deactivate_resource , .Nm rman_fini , .Nm rman_init , +.Nm rman_init_from_resource , +.Nm rman_is_region_manager , .Nm rman_manage_region , +.Nm rman_first_free_region , +.Nm rman_last_free_region , .Nm rman_release_resource , .Nm rman_reserve_resource , .Nm rman_reserve_resource_bound , @@ -59,6 +64,8 @@ .Ft int .Fn rman_activate_resource "struct resource *r" .Ft int +.Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end" +.Ft int .Fn rman_await_resource "struct resource *r" "int pri2" "int timo" .Ft int .Fn rman_deactivate_resource "struct resource *r" @@ -67,8 +74,16 @@ .Ft int .Fn rman_init "struct rman *rm" .Ft int +.Fn rman_init_from_resource "struct rman *rm" "struct resource *r" +.Ft int +.Fn rman_is_region_manager "struct resource *r" "struct rman *rm" +.Ft int .Fn rman_manage_region "struct rman *rm" "u_long start" "u_long end" .Ft int +.Fn rman_first_free_region "struct rman *rm" "u_long *start" "u_long *end" +.Ft int +.Fn rman_last_free_region "struct rman *rm" "u_long *start" "u_long *end" +.Ft int .Fn rman_release_resource "struct resource *r" .Ft "struct resource *" .Fo rman_reserve_resource @@ -154,6 +169,14 @@ shall be set to The field .Va rm_descr shall be set to a string that describes the resource to be managed. +The +.Va rm_start +and +.Va rm_end +fields may be set to limit the range of acceptable resource addresses. +If these fields are not set, +.Fn rman_init +will initialize them to allow the entire range of resource addresses. It also initializes any mutexes associated with the structure. If .Fn rman_init @@ -193,12 +216,49 @@ If successful, will return 0. If the region overlaps with an existing region, it will return .Er EBUSY . +If any part of the region falls outside of the valid address range for +.Fa rm , +it will return +.Er EINVAL . .Er ENOMEM -will be return when +will be returned when .Fn rman_manage_region failed to allocate memory for the region. .Pp The +.Fn rman_init_from_resource +function is a wrapper routine to create a resource manager backed by an +existing resource. +It initializes +.Fa rm +using +.Fn rman_init +and then adds a region to +.Fa rm +corresponding to the address range allocated to +.Fa r +via +.Fn rman_manage_region . +.Pp +The +.Fn rman_first_free_region +and +.Fn rman_last_free_region +functions can be used to query a resource manager for its first +.Pq or last +unallocated region. +If +.Fa rm +contains no free region, +these functions will return +.Er ENOENT . +Otherwise, +.Fa *start +and +.Fa *end +are set to the bounds of the free region and zero is returned. +.Pp +The .Fn rman_reserve_resource_bound function is where the bulk of the .Nm @@ -211,8 +271,9 @@ The caller can specify the .Fa start and .Fa end -of an acceptable range, as well as -alignment, and the code will attempt to find a free segment which fits. +of an acceptable range, +as well as a boundary restriction and required aligment, +and the code will attempt to find a free segment which fits. The .Fa start argument is the lowest acceptable starting value of the resource. @@ -224,6 +285,19 @@ Therefore, must be \[<=] .Fa end for any allocation to happen. +The aligment requirement +.Pq if any +is specified in +.Fa flags . +The +.Fa bound +argument may be set to specify a boundary restriction such that an +allocated region may cross an address that is a multiple of the +boundary. +The +.Fa bound +argument must be a power of two. +It may be set to zero to specify no boundary restriction. The default behavior is to allocate an exclusive segment, unless the .Dv RF_SHAREABLE or @@ -239,7 +313,7 @@ function is used to reserve resources wi It is a simplified interface to .Fn rman_reserve_resource_bound which passes 0 for the -.Fa flags +.Fa bound argument. .Pp The @@ -250,6 +324,49 @@ This should be used when calling .Fn rman_reserve_resource_bound . .Pp The +.Fn rman_is_region_manager +function returns true if the allocated resource +.Fa r +was allocated from +.Fa rm . +Otherwise, +it returns false. +.Pp +The +.Fn rman_adjust_resource +function is used to adjust the reserved address range of an allocated resource +to reserve +.Fa start +through +.Fa end . +It can be used to grow or shrink one or both ends of the resource range. +The current implementation does not support entirely relocating the resource +and will fail with +.Er EINVAL +if the new resource range does not overlap the old resource range. +If either end of the resource range grows and the new resource range would +conflict with another allocated resource, +the function will fail with +.Er EBUSY . +The +.Fn rman_adjust_resource +function does not support adjusting the resource range for shared resources +and will fail such attempts with +.Er EINVAL . +Upon success, +the resource +.Fa r +will have a start address of +.Fa start +and an end address of +.Fa end +and the function will return zero. +Note that none of the constraints of the original allocation request such +as alignment or boundary restrictions are checked by +.Fn rman_adjust_resource . +It is the caller's responsibility to enforce any such requirements. +.Pp +The .Fn rman_release_resource function releases the reserved resource .Fa r . Modified: stable/8/sys/kern/subr_rman.c ============================================================================== --- stable/8/sys/kern/subr_rman.c Fri Jun 24 13:41:46 2011 (r223500) +++ stable/8/sys/kern/subr_rman.c Fri Jun 24 13:45:14 2011 (r223501) @@ -272,6 +272,164 @@ rman_fini(struct rman *rm) return 0; } +int +rman_first_free_region(struct rman *rm, u_long *start, u_long *end) +{ + struct resource_i *r; + + mtx_lock(rm->rm_mtx); + TAILQ_FOREACH(r, &rm->rm_list, r_link) { + if (!(r->r_flags & RF_ALLOCATED)) { + *start = r->r_start; + *end = r->r_end; + mtx_unlock(rm->rm_mtx); + return (0); + } + } + mtx_unlock(rm->rm_mtx); + return (ENOENT); +} + +int +rman_last_free_region(struct rman *rm, u_long *start, u_long *end) +{ + struct resource_i *r; + + mtx_lock(rm->rm_mtx); + TAILQ_FOREACH_REVERSE(r, &rm->rm_list, resource_head, r_link) { + if (!(r->r_flags & RF_ALLOCATED)) { + *start = r->r_start; + *end = r->r_end; + mtx_unlock(rm->rm_mtx); + return (0); + } + } + mtx_unlock(rm->rm_mtx); + return (ENOENT); +} + +/* Shrink or extend one or both ends of an allocated resource. */ +int +rman_adjust_resource(struct resource *rr, u_long start, u_long end) +{ + struct resource_i *r, *s, *t, *new; + struct rman *rm; + + /* Not supported for shared resources. */ + r = rr->__r_i; + if (r->r_flags & (RF_TIMESHARE | RF_SHAREABLE)) + return (EINVAL); + + /* + * This does not support wholesale moving of a resource. At + * least part of the desired new range must overlap with the + * existing resource. + */ + if (end < r->r_start || r->r_end < start) + return (EINVAL); + + /* + * Find the two resource regions immediately adjacent to the + * allocated resource. + */ + rm = r->r_rm; + mtx_lock(rm->rm_mtx); +#ifdef INVARIANTS + TAILQ_FOREACH(s, &rm->rm_list, r_link) { + if (s == r) + break; + } + if (s == NULL) + panic("resource not in list"); +#endif + s = TAILQ_PREV(r, resource_head, r_link); + t = TAILQ_NEXT(r, r_link); + KASSERT(s == NULL || s->r_end + 1 == r->r_start, + ("prev resource mismatch")); + KASSERT(t == NULL || r->r_end + 1 == t->r_start, + ("next resource mismatch")); + + /* + * See if the changes are permitted. Shrinking is always allowed, + * but growing requires sufficient room in the adjacent region. + */ + if (start < r->r_start && (s == NULL || (s->r_flags & RF_ALLOCATED) || + s->r_start > start)) { + mtx_unlock(rm->rm_mtx); + return (EBUSY); + } + if (end > r->r_end && (t == NULL || (t->r_flags & RF_ALLOCATED) || + t->r_end < end)) { + mtx_unlock(rm->rm_mtx); + return (EBUSY); + } + + /* + * While holding the lock, grow either end of the resource as + * needed and shrink either end if the shrinking does not require + * allocating a new resource. We can safely drop the lock and then + * insert a new range to handle the shrinking case afterwards. + */ + if (start < r->r_start || + (start > r->r_start && s != NULL && !(s->r_flags & RF_ALLOCATED))) { + KASSERT(s->r_flags == 0, ("prev is busy")); + r->r_start = start; + if (s->r_start == start) { + TAILQ_REMOVE(&rm->rm_list, s, r_link); + free(s, M_RMAN); + } else + s->r_end = start - 1; + } + if (end > r->r_end || + (end < r->r_end && t != NULL && !(t->r_flags & RF_ALLOCATED))) { + KASSERT(t->r_flags == 0, ("next is busy")); + r->r_end = end; + if (t->r_end == end) { + TAILQ_REMOVE(&rm->rm_list, t, r_link); + free(t, M_RMAN); + } else + t->r_start = end + 1; + } + mtx_unlock(rm->rm_mtx); + + /* + * Handle the shrinking cases that require allocating a new + * resource to hold the newly-free region. We have to recheck + * if we still need this new region after acquiring the lock. + */ + if (start > r->r_start) { + new = int_alloc_resource(M_WAITOK); + new->r_start = r->r_start; + new->r_end = start - 1; + new->r_rm = rm; + mtx_lock(rm->rm_mtx); + r->r_start = start; + s = TAILQ_PREV(r, resource_head, r_link); + if (s != NULL && !(s->r_flags & RF_ALLOCATED)) { + s->r_end = start - 1; + free(new, M_RMAN); + } else + TAILQ_INSERT_BEFORE(r, new, r_link); + mtx_unlock(rm->rm_mtx); + } + if (end < r->r_end) { + new = int_alloc_resource(M_WAITOK); + new->r_start = end + 1; + new->r_end = r->r_end; + new->r_rm = rm; + mtx_lock(rm->rm_mtx); + r->r_end = end; + t = TAILQ_NEXT(r, r_link); + if (t != NULL && !(t->r_flags & RF_ALLOCATED)) { + t->r_start = end + 1; + free(new, M_RMAN); + } else + TAILQ_INSERT_AFTER(&rm->rm_list, r, new, r_link); + mtx_unlock(rm->rm_mtx); + } + return (0); +} + struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, u_long count, u_long bound, u_int flags, Modified: stable/8/sys/sys/rman.h ============================================================================== --- stable/8/sys/sys/rman.h Fri Jun 24 13:41:46 2011 (r223500) +++ stable/8/sys/sys/rman.h Fri Jun 24 13:45:14 2011 (r223501) @@ -116,7 +116,9 @@ struct rman { TAILQ_HEAD(rman_head, rman); int rman_activate_resource(struct resource *r); +int rman_adjust_resource(struct resource *r, u_long start, u_long end); int rman_await_resource(struct resource *r, int pri, int timo); +int rman_first_free_region(struct rman *rm, u_long *start, u_long *end); bus_space_handle_t rman_get_bushandle(struct resource *); bus_space_tag_t rman_get_bustag(struct resource *); u_long rman_get_end(struct resource *); @@ -130,6 +132,7 @@ int rman_deactivate_resource(struct reso int rman_fini(struct rman *rm); int rman_init(struct rman *rm); int rman_init_from_resource(struct rman *rm, struct resource *r); +int rman_last_free_region(struct rman *rm, u_long *start, u_long *end); uint32_t rman_make_alignment_flags(uint32_t size); int rman_manage_region(struct rman *rm, u_long start, u_long end); int rman_is_region_manager(struct resource *r, struct rman *rm); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 13:58:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4E4B1065675; Fri, 24 Jun 2011 13:58:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D5DE68FC19; Fri, 24 Jun 2011 13:58: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 p5ODwumc056895; Fri, 24 Jun 2011 13:58:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ODwute056893; Fri, 24 Jun 2011 13:58:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241358.p5ODwute056893@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 13:58: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: r223502 - 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: Fri, 24 Jun 2011 13:58:57 -0000 Author: jhb Date: Fri Jun 24 13:58:56 2011 New Revision: 223502 URL: http://svn.freebsd.org/changeset/base/223502 Log: Typo. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Jun 24 13:45:14 2011 (r223501) +++ head/sys/dev/acpica/acpi.c Fri Jun 24 13:58:56 2011 (r223502) @@ -1244,7 +1244,7 @@ acpi_alloc_resource(device_t bus, device /* * First attempt at allocating the resource. For direct children, * use resource_list_alloc() to handle reserved resources. For - * other dveices, pass the request up to our parent. + * other devices, pass the request up to our parent. */ if (bus == device_get_parent(child)) { ad = device_get_ivars(child); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 14:31:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD67106566B; Fri, 24 Jun 2011 14:31:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 985198FC14; Fri, 24 Jun 2011 14:31: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 p5OEVUxq058021; Fri, 24 Jun 2011 14:31:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEVUI8058019; Fri, 24 Jun 2011 14:31:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106241431.p5OEVUI8058019@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Jun 2011 14:31: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: r223504 - head/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: Fri, 24 Jun 2011 14:31:31 -0000 Author: adrian Date: Fri Jun 24 14:31:30 2011 New Revision: 223504 URL: http://svn.freebsd.org/changeset/base/223504 Log: Fix another broken HT40 channel band reference. Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Fri Jun 24 14:03:10 2011 (r223503) +++ head/etc/regdomain.xml Fri Jun 24 14:31:30 2011 (r223504) @@ -251,7 +251,7 @@ IEEE80211_CHAN_HT20 - + 30 IEEE80211_CHAN_G IEEE80211_CHAN_HT40 From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 14:40:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D690106564A; Fri, 24 Jun 2011 14:40:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2428FC12; Fri, 24 Jun 2011 14:40: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 p5OEeMIP058309; Fri, 24 Jun 2011 14:40:22 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEeMER058307; Fri, 24 Jun 2011 14:40:22 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201106241440.p5OEeMER058307@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 24 Jun 2011 14:40: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: r223505 - 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: Fri, 24 Jun 2011 14:40:22 -0000 Author: jonathan Date: Fri Jun 24 14:40:22 2011 New Revision: 223505 URL: http://svn.freebsd.org/changeset/base/223505 Log: Tidy up a capabilities-related comment. This comment refers to an #ifdef that hasn't been merged [yet?]; remove it. Approved by: rwatson Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jun 24 14:31:30 2011 (r223504) +++ head/sys/kern/vfs_subr.c Fri Jun 24 14:40:22 2011 (r223505) @@ -3590,9 +3590,6 @@ vn_isdisk(struct vnode *vp, int *errp) * and optional call-by-reference privused argument allowing vaccess() * to indicate to the caller whether privilege was used to satisfy the * request (obsoleted). Returns 0 on success, or an errno on failure. - * - * The ifdef'd CAPABILITIES version is here for reference, but is not - * actually used. */ int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 14:56:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A19B51065676; Fri, 24 Jun 2011 14:56:38 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 925EB8FC13; Fri, 24 Jun 2011 14:56: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 p5OEucd2058784; Fri, 24 Jun 2011 14:56:38 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OEucwo058782; Fri, 24 Jun 2011 14:56:38 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201106241456.p5OEucwo058782@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 24 Jun 2011 14:56: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: r223506 - head/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: Fri, 24 Jun 2011 14:56:38 -0000 Author: pluknet Date: Fri Jun 24 14:56:38 2011 New Revision: 223506 URL: http://svn.freebsd.org/changeset/base/223506 Log: Add support for string values with white spaces for ifconfig(8) parameters accepting them (such as description, group). Changes discussed on freebsd-rc. PR: conf/156675 Reported by: "Alexander V. Chernikov" Suggested by: hrs Analyzed with: Alexander V. Chernikov via IRC MFC after: 2 weeks Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Fri Jun 24 14:40:22 2011 (r223505) +++ head/etc/network.subr Fri Jun 24 14:56:38 2011 (r223506) @@ -94,7 +94,7 @@ ifconfig_up() # ifconfig_IF ifconfig_args=`ifconfig_getargs $1` if [ -n "${ifconfig_args}" ]; then - ifconfig $1 ${ifconfig_args} + eval ifconfig $1 ${ifconfig_args} _cfg=0 fi From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 15:37:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915E31065670; Fri, 24 Jun 2011 15:37:04 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 06E888FC1A; Fri, 24 Jun 2011 15:37:03 +0000 (UTC) Received: by qyk30 with SMTP id 30so412848qyk.13 for ; Fri, 24 Jun 2011 08:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; 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=pMgsRMs8x4OzC2iji0oqvDkbIsLBYlEXDJdv9R2TlZM=; b=um37ibaQKQ571z+ZhaTn5itD4nPn6Ft/TFNQdaAF6HxFM3W77DgfeCuLNdgh15p+Wn W3prU3mWGxcPGX2tqQx1LUfM3RVkx0uSdLQnN1Y/iYLJ+IlvfOTR+4VX8yfmuG1x7FMN t3Pwg2wGU3Yo6NcZZGXq7rEzDFPjW/e9ulXAk= MIME-Version: 1.0 Received: by 10.229.118.69 with SMTP id u5mr2583752qcq.122.1308929823029; Fri, 24 Jun 2011 08:37:03 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.229.227.130 with HTTP; Fri, 24 Jun 2011 08:37:02 -0700 (PDT) In-Reply-To: <201106241440.p5OEeMER058307@svn.freebsd.org> References: <201106241440.p5OEeMER058307@svn.freebsd.org> Date: Fri, 24 Jun 2011 19:37:02 +0400 X-Google-Sender-Auth: QdfSJ7u6BmoPRlFnYfQrTX5jJqQ Message-ID: From: Sergey Kandaurov To: Jonathan Anderson 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 Subject: Re: svn commit: r223505 - 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: Fri, 24 Jun 2011 15:37:04 -0000 On 24 June 2011 18:40, Jonathan Anderson wrote: > Author: jonathan > Date: Fri Jun 24 14:40:22 2011 > New Revision: 223505 > URL: http://svn.freebsd.org/changeset/base/223505 > > Log: > =A0Tidy up a capabilities-related comment. > > =A0This comment refers to an #ifdef that hasn't been merged [yet?]; remov= e it. > > =A0Approved by: rwatson Thanks! Can you close PR kern/148801 as well? This comment was mistakenly left after "Sweep kernel replacing suser(9) cal= ls with priv(9) calls" (svn r164033 by rwatson@) in which the exp. CAPABILITIE= S facility transformed to currently operating priv(9). After that the comment has lost its relevance. May be applied down to 7.x. > > Modified: > =A0head/sys/kern/vfs_subr.c > > Modified: head/sys/kern/vfs_subr.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/sys/kern/vfs_subr.c =A0 =A0Fri Jun 24 14:31:30 2011 =A0 =A0 =A0 = =A0(r223504) > +++ head/sys/kern/vfs_subr.c =A0 =A0Fri Jun 24 14:40:22 2011 =A0 =A0 =A0 = =A0(r223505) > @@ -3590,9 +3590,6 @@ vn_isdisk(struct vnode *vp, int *errp) > =A0* and optional call-by-reference privused argument allowing vaccess() > =A0* to indicate to the caller whether privilege was used to satisfy the > =A0* request (obsoleted). =A0Returns 0 on success, or an errno on failure= . > - * > - * The ifdef'd CAPABILITIES version is here for reference, but is not > - * actually used. > =A0*/ > =A0int > =A0vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_= gid, > --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 15:48:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D882D106566C; Fri, 24 Jun 2011 15:48:06 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5355F8FC14; Fri, 24 Jun 2011 15:48:06 +0000 (UTC) Received: by qwc9 with SMTP id 9so1976303qwc.13 for ; Fri, 24 Jun 2011 08:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=Cb3Ho0hC+pxSlDQxHoqqWYPQ+OSZaP60+xXAeZ+u0So=; b=FRZV6DfO7ikkUN4O79cz4w3swUo5JZw72Mt7VAetXWwNqStkSDmbV2yT4sC4VsgAUN +usq0tBIYQ/LdaIx9hJjC6bHPWPmREXGBdvwgn1DPvwW6rm+evehOWbMFah97YFFxm3F wBnuzlgYLuU1KHogB4HSkOdWmwc1CUf69hX/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=WUehBjyz5DSV/WgVHAIyUmSdHWXUhZlZeMNcs+XUFgolkq84H1sLlcJ9n+QfqzuQrS cGXQraaqmHxTgaRnvmw+lGmmYFz5v7bb2lF0YZEVfikCAlHezIxRGieFcBQaYWaanBeE SISLRSOUhQxmbCg8htN8+IaAH6iqTLEXxeVZY= Received: by 10.229.136.208 with SMTP id s16mr2642331qct.134.1308930485450; Fri, 24 Jun 2011 08:48:05 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id e18sm2034872qcs.41.2011.06.24.08.48.02 (version=SSLv3 cipher=OTHER); Fri, 24 Jun 2011 08:48:03 -0700 (PDT) Date: Fri, 24 Jun 2011 11:47:56 -0400 From: Alexander Kabaev To: Craig Rodrigues Message-ID: <20110624114756.534b333d@kan.dnsalias.net> In-Reply-To: <201106240350.p5O3otfc028955@svn.freebsd.org> References: <201106240350.p5O3otfc028955@svn.freebsd.org> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/P6s3h.qyAvJ9TIu4VyWd=no"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223488 - 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, 24 Jun 2011 15:48:06 -0000 --Sig_/P6s3h.qyAvJ9TIu4VyWd=no Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 24 Jun 2011 03:50:55 +0000 (UTC) Craig Rodrigues wrote: Hi, > + if (d->xid !=3D 1) { > + return (-1); > + } this is distinctly NOT what I sent to you and would rather not take credit for consequences. What you are doing here is not dropping the packet, you are returning error from read and with errno in unknown state on top of that. Why did this have to change and why there is no mention of that in the commit message? --=20 Alexander Kabaev --Sig_/P6s3h.qyAvJ9TIu4VyWd=no Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOBLGxQ6z1jMm+XZYRAtd6AJ9e3t7N3KaVLpHeDsmJRudG8iHoLACeLIuH 4+aeSV34KqOm/Lam/B+ubsA= =WP1T -----END PGP SIGNATURE----- --Sig_/P6s3h.qyAvJ9TIu4VyWd=no-- From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 16:06:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C232106566B; Fri, 24 Jun 2011 16:06:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE708FC18; Fri, 24 Jun 2011 16:06: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 p5OG6oEf060787; Fri, 24 Jun 2011 16:06:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OG6oWj060779; Fri, 24 Jun 2011 16:06:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241606.p5OG6oWj060779@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 16:06: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: r223507 - in stable/8: share/man/man9 sys/kern 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: Fri, 24 Jun 2011 16:06:51 -0000 Author: jhb Date: Fri Jun 24 16:06:50 2011 New Revision: 223507 URL: http://svn.freebsd.org/changeset/base/223507 Log: MFC 221231,221450,222600: Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a wrapper around rman_adjust_resource(). Include a generic implementation, bus_generic_adjust_resource() which passes the request up to the parent bus. There is currently no default implementation. A bus_adjust_resource() wrapper is provided for use in drivers. Added: stable/8/share/man/man9/bus_adjust_resource.9 - copied, changed from r221231, head/share/man/man9/bus_adjust_resource.9 Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/bus_alloc_resource.9 stable/8/share/man/man9/rman.9 stable/8/sys/kern/bus_if.m stable/8/sys/kern/subr_bus.c stable/8/sys/sys/bus.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/share/man/man9/Makefile Fri Jun 24 16:06:50 2011 (r223507) @@ -22,6 +22,7 @@ MAN= accept_filter.9 \ BUF_UNLOCK.9 \ bus_activate_resource.9 \ BUS_ADD_CHILD.9 \ + bus_adjust_resource.9 \ bus_alloc_resource.9 \ BUS_BIND_INTR.9 \ bus_child_present.9 \ Copied and modified: stable/8/share/man/man9/bus_adjust_resource.9 (from r221231, head/share/man/man9/bus_adjust_resource.9) ============================================================================== --- head/share/man/man9/bus_adjust_resource.9 Fri Apr 29 21:36:45 2011 (r221231, copy source) +++ stable/8/share/man/man9/bus_adjust_resource.9 Fri Jun 24 16:06:50 2011 (r223507) @@ -67,6 +67,15 @@ It is the caller's responsibility to enf The .Fn bus_adjust_resource method returns zero on success or an error code on failure. +.Sh EXAMPLES +Grow an existing memory resource by 4096 bytes. +.Bd -literal + struct resource *res; + int error; + + error = bus_adjust_resource(dev, SYS_RES_MEMORY, res, + rman_get_start(res), rman_get_end(res) + 0x1000); +.Ed .Sh ERRORS .Fn bus_adjust_resource will fail if: @@ -85,15 +94,6 @@ The new address range does not overlap w .It Bq Er EBUSY The new address range conflicts with another allocated resource. .El -.Sh EXAMPLES -Grow an existing memory resource by 4096 bytes. -.Bd -literal - struct resource *res; - int error; - - error = bus_adjust_resource(dev, SYS_RES_MEMORY, res, - rman_get_start(res), rman_get_end(res) + 0x1000); -.Ed .Sh SEE ALSO .Xr bus_alloc_resource 9 , .Xr bus_release_resource 9 , Modified: stable/8/share/man/man9/bus_alloc_resource.9 ============================================================================== --- stable/8/share/man/man9/bus_alloc_resource.9 Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/share/man/man9/bus_alloc_resource.9 Fri Jun 24 16:06:50 2011 (r223507) @@ -171,6 +171,7 @@ should be saved in the softc of the devi .Ed .Sh SEE ALSO .Xr bus_activate_resource 9 , +.Xr bus_adjust_resource 9 , .Xr bus_release_resource 9 , .Xr device 9 , .Xr driver 9 Modified: stable/8/share/man/man9/rman.9 ============================================================================== --- stable/8/share/man/man9/rman.9 Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/share/man/man9/rman.9 Fri Jun 24 16:06:50 2011 (r223507) @@ -461,6 +461,7 @@ function returns a pointer to the device .Fa r . .Sh SEE ALSO .Xr bus_activate_resource 9 , +.Xr bus_adjust_resource 9 , .Xr bus_alloc_resource 9 , .Xr bus_release_resource 9 , .Xr bus_set_resource 9 , Modified: stable/8/sys/kern/bus_if.m ============================================================================== --- stable/8/sys/kern/bus_if.m Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/sys/kern/bus_if.m Fri Jun 24 16:06:50 2011 (r223507) @@ -297,6 +297,30 @@ METHOD int deactivate_resource { }; /** + * @brief Adjust a resource + * + * Adjust the start and/or end of a resource allocated by + * BUS_ALLOC_RESOURCE. At least part of the new address range must overlap + * with the existing address range. If the successful, the resource's range + * will be adjusted to [start, end] on return. + * + * @param _dev the parent device of @p _child + * @param _child the device which allocated the resource + * @param _type the type of resource + * @param _res the resource to adjust + * @param _start the new starting address of the resource range + * @param _end the new ending address of the resource range + */ +METHOD int adjust_resource { + device_t _dev; + device_t _child; + int _type; + struct resource *_res; + u_long _start; + u_long _end; +}; + +/** * @brief Release a resource * * Free a resource allocated by the BUS_ALLOC_RESOURCE. The @p _rid Modified: stable/8/sys/kern/subr_bus.c ============================================================================== --- stable/8/sys/kern/subr_bus.c Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/sys/kern/subr_bus.c Fri Jun 24 16:06:50 2011 (r223507) @@ -3506,6 +3506,23 @@ bus_generic_teardown_intr(device_t dev, } /** + * @brief Helper function for implementing BUS_ADJUST_RESOURCE(). + * + * This simple implementation of BUS_ADJUST_RESOURCE() simply calls the + * BUS_ADJUST_RESOURCE() method of the parent of @p dev. + */ +int +bus_generic_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + /* Propagate up the bus hierarchy until someone handles it. */ + if (dev->parent) + return (BUS_ADJUST_RESOURCE(dev->parent, child, type, r, start, + end)); + return (EINVAL); +} + +/** * @brief Helper function for implementing BUS_ALLOC_RESOURCE(). * * This simple implementation of BUS_ALLOC_RESOURCE() simply calls the @@ -3828,6 +3845,21 @@ bus_alloc_resource(device_t dev, int typ } /** + * @brief Wrapper function for BUS_ADJUST_RESOURCE(). + * + * This function simply calls the BUS_ADJUST_RESOURCE() method of the + * parent of @p dev. + */ +int +bus_adjust_resource(device_t dev, int type, struct resource *r, u_long start, + u_long end) +{ + if (dev->parent == NULL) + return (EINVAL); + return (BUS_ADJUST_RESOURCE(dev->parent, dev, type, r, start, end)); +} + +/** * @brief Wrapper function for BUS_ACTIVATE_RESOURCE(). * * This function simply calls the BUS_ACTIVATE_RESOURCE() method of the Modified: stable/8/sys/sys/bus.h ============================================================================== --- stable/8/sys/sys/bus.h Fri Jun 24 14:56:38 2011 (r223506) +++ stable/8/sys/sys/bus.h Fri Jun 24 16:06:50 2011 (r223507) @@ -289,6 +289,9 @@ int bus_generic_activate_resource(device device_t bus_generic_add_child(device_t dev, u_int order, const char *name, int unit); +int bus_generic_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, + u_long end); struct resource * bus_generic_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, @@ -357,6 +360,8 @@ struct resource_spec { int bus_alloc_resources(device_t dev, struct resource_spec *rs, struct resource **res); void bus_release_resources(device_t dev, const struct resource_spec *rs, struct resource **res); +int bus_adjust_resource(device_t child, int type, struct resource *r, + u_long start, u_long end); struct resource *bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 16:11:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78CDB1065670; Fri, 24 Jun 2011 16:11:22 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 453FB8FC20; Fri, 24 Jun 2011 16:11:21 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5OGBGDw079902 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 24 Jun 2011 09:11:22 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201106232221.p5NMLSFj019042@svn.freebsd.org> Date: Fri, 24 Jun 2011 09:11:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> References: <201106232221.p5NMLSFj019042@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 16:11:22 -0000 On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Jun 23 22:21:28 2011 > New Revision: 223485 > URL: http://svn.freebsd.org/changeset/base/223485 >=20 > Log: > Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for = ppc64) > instead of a PCPU field for curthread. This averts a race on SMP = systems > with a high interrupt rate where the thread looking up the value of > curthread could be preempted and migrated between obtaining the PCPU > pointer and reading the value of pc_curthread, resulting in curthread = being > observed to be the current thread on the thread's original CPU. This = played > merry havoc with the system, in particular with mutexes. Many thanks = to > jhb for helping me work this one out. Nice catch! Another approach would be to have r2/r13 hold the address of the PCPU structure and simply do a load from that address to get curthread. The difference between the approaches is the need to to a memory load or not for curthread. But with r2/r13 pointing to the PCPU, you may be faster to get other PCPU fields if reading from the a SPR adds to the overhead. Plus, it's easier to be atomic if you don't have to read the SPR first and then do a load. Is curthread the only field that needs to be atomically accessed or are other fields in the PCPU susceptible to race conditions? --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 16:18:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71E8106566B; Fri, 24 Jun 2011 16:18:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 793EA8FC12; Fri, 24 Jun 2011 16:18:38 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 167995824F; Fri, 24 Jun 2011 11:18:37 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 81N7zttvvAgH; Fri, 24 Jun 2011 11:18:36 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-119.icecube.wisc.edu [172.16.223.119]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 92BDB58141; Fri, 24 Jun 2011 11:18:36 -0500 (CDT) Message-ID: <4E04B8DC.1020600@freebsd.org> Date: Fri, 24 Jun 2011 11:18:36 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Marcel Moolenaar References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> In-Reply-To: <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> 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: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 16:18:38 -0000 On 06/24/11 11:11, Marcel Moolenaar wrote: > > On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Thu Jun 23 22:21:28 2011 >> New Revision: 223485 >> URL: http://svn.freebsd.org/changeset/base/223485 >> >> Log: >> Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for ppc64) >> instead of a PCPU field for curthread. This averts a race on SMP systems >> with a high interrupt rate where the thread looking up the value of >> curthread could be preempted and migrated between obtaining the PCPU >> pointer and reading the value of pc_curthread, resulting in curthread being >> observed to be the current thread on the thread's original CPU. This played >> merry havoc with the system, in particular with mutexes. Many thanks to >> jhb for helping me work this one out. > > Nice catch! > > Another approach would be to have r2/r13 hold the address of the PCPU > structure and simply do a load from that address to get curthread. > The difference between the approaches is the need to to a memory load > or not for curthread. But with r2/r13 pointing to the PCPU, you may > be faster to get other PCPU fields if reading from the a SPR adds to > the overhead. Plus, it's easier to be atomic if you don't have to > read the SPR first and then do a load. The trouble with this approach is that r2/r13 would need to be updated on every CPU switch with the new PCPU pointer, so I just put curthread in there due to laziness, which is of course constant for a given thread. Another consideration is that we'd have to additionally maintain SPRG0 as the PCPU pointer anyway, since we need a PCPU area that userland can't change (r2/r13 is set from PCPU data when traps are taken now). > Is curthread the only field that needs to be atomically accessed or > are other fields in the PCPU susceptible to race conditions? In my discussion with John yesterday, he said he thought it was the only one susceptible to races of this type. The approach I used here (providing a special accessor for curthread that reads a non-PCPU-related register) is borrowed from the one used on amd64, i386, and alpha. Whether it is the only possibility for this kind of race or not, none of these platforms at least override anything else. -Nathan From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 16:33:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60101065742; Fri, 24 Jun 2011 16:33:30 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 9694C8FC1D; Fri, 24 Jun 2011 16:33:30 +0000 (UTC) Received: from sa-nc-common-177.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.4/8.14.4) with ESMTP id p5OGXP6b079980 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 24 Jun 2011 09:33:31 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <4E04B8DC.1020600@freebsd.org> Date: Fri, 24 Jun 2011 09:33:18 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> <4E04B8DC.1020600@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 16:33:31 -0000 On Jun 24, 2011, at 9:18 AM, Nathan Whitehorn wrote: > On 06/24/11 11:11, Marcel Moolenaar wrote: >>=20 >> On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: >>=20 >>> Author: nwhitehorn >>> Date: Thu Jun 23 22:21:28 2011 >>> New Revision: 223485 >>> URL: http://svn.freebsd.org/changeset/base/223485 >>>=20 >>> Log: >>> Use the ABI-mandated thread pointer register (r2 for ppc32, r13 for = ppc64) >>> instead of a PCPU field for curthread. This averts a race on SMP = systems >>> with a high interrupt rate where the thread looking up the value of >>> curthread could be preempted and migrated between obtaining the = PCPU >>> pointer and reading the value of pc_curthread, resulting in = curthread being >>> observed to be the current thread on the thread's original CPU. = This played >>> merry havoc with the system, in particular with mutexes. Many = thanks to >>> jhb for helping me work this one out. >>=20 >> Nice catch! >>=20 >> Another approach would be to have r2/r13 hold the address of the PCPU >> structure and simply do a load from that address to get curthread. >> The difference between the approaches is the need to to a memory load >> or not for curthread. But with r2/r13 pointing to the PCPU, you may >> be faster to get other PCPU fields if reading from the a SPR adds to >> the overhead. Plus, it's easier to be atomic if you don't have to >> read the SPR first and then do a load. >=20 > The trouble with this approach is that r2/r13 would need to be updated = on every CPU switch with the new PCPU pointer, so I just put curthread = in there due to laziness, which is of course constant for a given = thread. Actually, you need to save and assign that register on entry into the kernel only and restore it when you go back to user space (due to it being the thread pointer in user space). It remains a constant within the kernel (from the CPU's point of view) and does not have to be changed on a context switch. If r2/r13 hold curthread, then r2/r13 are indeed constant from the perspective of the thread, but it needs to be changed for every context switch in that case. =46rom the CPU's perspective these registers are not constant then. > Another consideration is that we'd have to additionally maintain SPRG0 = as the PCPU pointer anyway, since we need a PCPU area that userland = can't change (r2/r13 is set from PCPU data when traps are taken now). Yes. On ia64 we use the thread register to hold the address of the PCPU structure and since curthread is at offset 0 in the PCPU structure, we can do an atomic load. We use a kernel register to restore the PCPU address in the thread register on entry into the kernel. Works well and it doesn't make curthread too special (other than it needing to be at offset 0 in the PCPU structure for the dereferencing to be atomic). As such, even PCPU_GET(curthread) is atomic... Anyway: I'll see about fixing Book-E... >=20 >> Is curthread the only field that needs to be atomically accessed or >> are other fields in the PCPU susceptible to race conditions? >=20 > In my discussion with John yesterday, he said he thought it was the = only one susceptible to races of this type. The approach I used here = (providing a special accessor for curthread that reads a = non-PCPU-related register) is borrowed from the one used on amd64, i386, = and alpha. Whether it is the only possibility for this kind of race or = not, none of these platforms at least override anything else. Thanks. That's what I figured, but I never really had any firm confirmation and we still have comments in our code like: /* * XXX The implementation of this operation should be made atomic * with respect to preemption. */ #define PCPU_ADD(member, value) (pcpup->pc_ ## member +=3D (value)) It's always created uncertainty and doubt in my mind... --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 17:29:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1D71065781; Fri, 24 Jun 2011 17:29:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCF28FC14; Fri, 24 Jun 2011 17:29: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 p5OHTfXw063858; Fri, 24 Jun 2011 17:29:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OHTfii063846; Fri, 24 Jun 2011 17:29:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241729.p5OHTfii063846@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 17:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223509 - in stable/8/sys: amd64/amd64 amd64/pci dev/acpica dev/pci i386/i386 i386/pci 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: Fri, 24 Jun 2011 17:29:42 -0000 Author: jhb Date: Fri Jun 24 17:29:41 2011 New Revision: 223509 URL: http://svn.freebsd.org/changeset/base/223509 Log: MFC 221324,221324: Add implementations of BUS_ADJUST_RESOURCE() to the PCI bus driver, generic PCI-PCI bridge driver, x86 nexus driver, x86 Host to PCI bridge drivers, and the drivers that sit between the x86 Host-PCI bridge drivers and nexus. Modified: stable/8/sys/amd64/amd64/legacy.c stable/8/sys/amd64/pci/pci_bus.c stable/8/sys/dev/acpica/acpi.c stable/8/sys/dev/acpica/acpi_pcib_acpi.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_pci.c stable/8/sys/i386/i386/legacy.c stable/8/sys/i386/pci/pci_bus.c stable/8/sys/x86/x86/mptable_pci.c stable/8/sys/x86/x86/nexus.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/legacy.c ============================================================================== --- stable/8/sys/amd64/amd64/legacy.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/amd64/amd64/legacy.c Fri Jun 24 17:29:41 2011 (r223509) @@ -80,6 +80,7 @@ static device_method_t legacy_methods[] DEVMETHOD(bus_read_ivar, legacy_read_ivar), DEVMETHOD(bus_write_ivar, legacy_write_ivar), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/amd64/pci/pci_bus.c ============================================================================== --- stable/8/sys/amd64/pci/pci_bus.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/amd64/pci/pci_bus.c Fri Jun 24 17:29:41 2011 (r223509) @@ -348,6 +348,7 @@ static device_method_t legacy_pcib_metho DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/dev/acpica/acpi.c Fri Jun 24 17:29:41 2011 (r223509) @@ -124,6 +124,8 @@ static int acpi_sysres_alloc(device_t de static struct resource *acpi_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags); +static int acpi_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end); static int acpi_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r); static void acpi_delete_resource(device_t bus, device_t child, int type, @@ -197,6 +199,7 @@ static device_method_t acpi_methods[] = DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_alloc_resource, acpi_alloc_resource), + DEVMETHOD(bus_adjust_resource, acpi_adjust_resource), DEVMETHOD(bus_release_resource, acpi_release_resource), DEVMETHOD(bus_delete_resource, acpi_delete_resource), DEVMETHOD(bus_child_pnpinfo_str, acpi_child_pnpinfo_str_method), @@ -1231,23 +1234,34 @@ out: } static int -acpi_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +acpi_is_resource_managed(int type, struct resource *r) { - struct rman *rm; - int ret; /* We only handle memory and IO resources through rman. */ switch (type) { case SYS_RES_IOPORT: - rm = &acpi_rman_io; - break; + return (rman_is_region_manager(r, &acpi_rman_io)); case SYS_RES_MEMORY: - rm = &acpi_rman_mem; - break; - default: - rm = NULL; + return (rman_is_region_manager(r, &acpi_rman_mem)); } + return (0); +} + +static int +acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r, + u_long start, u_long end) +{ + + if (acpi_is_resource_managed(type, r)) + return (rman_adjust_resource(r, start, end)); + return (bus_generic_adjust_resource(bus, child, type, r, start, end)); +} + +static int +acpi_release_resource(device_t bus, device_t child, int type, int rid, + struct resource *r) +{ + int ret; ACPI_SERIAL_BEGIN(acpi); @@ -1256,7 +1270,7 @@ acpi_release_resource(device_t bus, devi * deactivate it and release it to the local pool. If it doesn't, * pass this request up to the parent. */ - if (rm != NULL && rman_is_region_manager(r, rm)) { + if (acpi_is_resource_managed(type, r)) { if (rman_get_flags(r) & RF_ACTIVE) { ret = bus_deactivate_resource(child, type, rid, r); if (ret != 0) Modified: stable/8/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_pcib_acpi.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/dev/acpica/acpi_pcib_acpi.c Fri Jun 24 17:29:41 2011 (r223509) @@ -100,6 +100,7 @@ static device_method_t acpi_pcib_acpi_me DEVMETHOD(bus_read_ivar, acpi_pcib_read_ivar), DEVMETHOD(bus_write_ivar, acpi_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, acpi_pcib_acpi_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/dev/pci/pci.c Fri Jun 24 17:29:41 2011 (r223509) @@ -142,6 +142,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_delete_resource, pci_delete_resource), DEVMETHOD(bus_alloc_resource, pci_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, pci_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/dev/pci/pci_pci.c ============================================================================== --- stable/8/sys/dev/pci/pci_pci.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/dev/pci/pci_pci.c Fri Jun 24 17:29:41 2011 (r223509) @@ -68,6 +68,7 @@ static device_method_t pcib_methods[] = DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/i386/i386/legacy.c ============================================================================== --- stable/8/sys/i386/i386/legacy.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/i386/i386/legacy.c Fri Jun 24 17:29:41 2011 (r223509) @@ -85,6 +85,7 @@ static device_method_t legacy_methods[] DEVMETHOD(bus_read_ivar, legacy_read_ivar), DEVMETHOD(bus_write_ivar, legacy_write_ivar), DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/i386/pci/pci_bus.c ============================================================================== --- stable/8/sys/i386/pci/pci_bus.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/i386/pci/pci_bus.c Fri Jun 24 17:29:41 2011 (r223509) @@ -565,6 +565,7 @@ static device_method_t legacy_pcib_metho DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/x86/x86/mptable_pci.c ============================================================================== --- stable/8/sys/x86/x86/mptable_pci.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/x86/x86/mptable_pci.c Fri Jun 24 17:29:41 2011 (r223509) @@ -116,6 +116,7 @@ static device_method_t mptable_hostb_met DEVMETHOD(bus_read_ivar, legacy_pcib_read_ivar), DEVMETHOD(bus_write_ivar, legacy_pcib_write_ivar), DEVMETHOD(bus_alloc_resource, legacy_pcib_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/x86/x86/nexus.c ============================================================================== --- stable/8/sys/x86/x86/nexus.c Fri Jun 24 16:35:40 2011 (r223508) +++ stable/8/sys/x86/x86/nexus.c Fri Jun 24 17:29:41 2011 (r223509) @@ -110,6 +110,8 @@ static device_t nexus_add_child(device_t int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +static int nexus_adjust_resource(device_t, device_t, int, struct resource *, + u_long, u_long); #ifdef SMP static int nexus_bind_intr(device_t, device_t, struct resource *, int); #endif @@ -154,6 +156,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -342,6 +345,23 @@ nexus_add_child(device_t bus, u_int orde return(child); } +static struct rman * +nexus_rman(int type) +{ + switch (type) { + case SYS_RES_IRQ: + return (&irq_rman); + case SYS_RES_DRQ: + return (&drq_rman); + case SYS_RES_IOPORT: + return (&port_rman); + case SYS_RES_MEMORY: + return (&mem_rman); + default: + return (NULL); + } +} + /* * Allocate a resource on behalf of child. NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. @@ -374,27 +394,9 @@ nexus_alloc_resource(device_t bus, devic } flags &= ~RF_ACTIVE; - - switch (type) { - case SYS_RES_IRQ: - rm = &irq_rman; - break; - - case SYS_RES_DRQ: - rm = &drq_rman; - break; - - case SYS_RES_IOPORT: - rm = &port_rman; - break; - - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - - default: - return 0; - } + rm = nexus_rman(type); + if (rm == NULL) + return (NULL); rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) @@ -412,6 +414,20 @@ nexus_alloc_resource(device_t bus, devic } static int +nexus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + struct rman *rm; + + rm = nexus_rman(type); + if (rm == NULL) + return (ENXIO); + if (!rman_is_region_manager(r, rm)) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); +} + +static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 17:54:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8701065672; Fri, 24 Jun 2011 17:54:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id BF9C58FC12; Fri, 24 Jun 2011 17:54: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 p5OHsjuO064600; Fri, 24 Jun 2011 17:54:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OHsjS4064598; Fri, 24 Jun 2011 17:54:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106241754.p5OHsjS4064598@svn.freebsd.org> From: John Baldwin Date: Fri, 24 Jun 2011 17:54: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: r223510 - head/usr.sbin/mtest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 17:54:45 -0000 Author: jhb Date: Fri Jun 24 17:54:45 2011 New Revision: 223510 URL: http://svn.freebsd.org/changeset/base/223510 Log: Don't die if either of INET or INET6 aren't in the running kernel. Instead, report "protocol not supported" errors at runtime if a user attempts to use a protocol that the kernel doesn't support. Reviewed by: bz MFC after: 1 week Modified: head/usr.sbin/mtest/mtest.c Modified: head/usr.sbin/mtest/mtest.c ============================================================================== --- head/usr.sbin/mtest/mtest.c Fri Jun 24 17:29:41 2011 (r223509) +++ head/usr.sbin/mtest/mtest.c Fri Jun 24 17:54:45 2011 (r223510) @@ -204,14 +204,16 @@ main(int argc, char **argv) s6 = -1; #ifdef INET s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (s == -1) + if (s == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv4 socket"); #endif #ifdef INET6 s6 = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); - if (s6 == -1) + if (s6 == -1 && errno != EPROTONOSUPPORT) err(1, "can't open IPv6 socket"); #endif + if (s == -1 && s6 == -1) + errc(1, EPROTONOSUPPORT, "can't open socket"); if (argc < 2) { if (isatty(STDIN_FILENO)) { @@ -371,7 +373,7 @@ af2socklen(const int af) } static void -process_cmd(char *cmd, int s, int s6 __unused, FILE *fp __unused) +process_cmd(char *cmd, int s, int s6, FILE *fp __unused) { char str1[STR_SIZE]; char str2[STR_SIZE]; @@ -457,7 +459,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr; optlen = sizeof(mr.mr); } - if (setsockopt(s, level, optname, optval, + if (s < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -496,7 +501,10 @@ process_cmd(char *cmd, int s, int s6 __u optval = (void *)&mr.mr6; optlen = sizeof(mr.mr6); } - if (setsockopt(s6, level, optname, optval, + if (s6 < 0) { + warnc(EPROTONOSUPPORT, "setsockopt %s", + toptname); + } else if (setsockopt(s6, level, optname, optval, optlen) == 0) { printf("ok\n"); break; @@ -534,6 +542,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "setsourcefilter"); + break; + } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_flags = AI_NUMERICHOST; @@ -593,6 +605,10 @@ process_cmd(char *cmd, int s, int s6 __u break; } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } /* First determine our current filter mode. */ n = 0; @@ -700,6 +716,10 @@ process_cmd(char *cmd, int s, int s6 __u } af = su.sa.sa_family; + if (af2sock(af, s, s6) == -1) { + warnc(EPROTONOSUPPORT, "getsourcefilter"); + break; + } nsrc = nreqsrc; if (getsourcefilter(af2sock(af, s, s6), ifindex, &su.sa, su.sa.sa_len, &fmode, &nsrc, &sources[0].ss) != 0) { From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 18:11:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87B45106566B; Fri, 24 Jun 2011 18:11:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 7798B8FC16; Fri, 24 Jun 2011 18:11: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 p5OIBtIv065143; Fri, 24 Jun 2011 18:11:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OIBtLS065141; Fri, 24 Jun 2011 18:11:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241811.p5OIBtLS065141@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:11: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: r223511 - head/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: Fri, 24 Jun 2011 18:11:55 -0000 Author: hselasky Date: Fri Jun 24 18:11:55 2011 New Revision: 223511 URL: http://svn.freebsd.org/changeset/base/223511 Log: - Export the URIO USB device ID's. - Add checks for configuration and interface index. MFC after: 3 days Modified: head/sys/dev/usb/storage/urio.c Modified: head/sys/dev/usb/storage/urio.c ============================================================================== --- head/sys/dev/usb/storage/urio.c Fri Jun 24 17:54:45 2011 (r223510) +++ head/sys/dev/usb/storage/urio.c Fri Jun 24 18:11:55 2011 (r223511) @@ -198,22 +198,25 @@ DRIVER_MODULE(urio, uhub, urio_driver, u MODULE_DEPEND(urio, usb, 1, 1, 1); MODULE_VERSION(urio, 1); +static const STRUCT_USB_HOST_ID urio_devs[] = { + {USB_VPI(USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB, 0)}, + {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB, 0)}, +}; + static int urio_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((((uaa->info.idVendor == USB_VENDOR_DIAMOND) && - (uaa->info.idProduct == USB_PRODUCT_DIAMOND_RIO500USB)) || - ((uaa->info.idVendor == USB_VENDOR_DIAMOND2) && - ((uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO600USB) || - (uaa->info.idProduct == USB_PRODUCT_DIAMOND2_RIO800USB))))) - return (0); - else + if (uaa->info.bConfigIndex != 0) return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(urio_devs, sizeof(urio_devs), uaa)); } static int From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 18:14:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FB0B1065670; Fri, 24 Jun 2011 18:14:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8D58FC14; Fri, 24 Jun 2011 18:14: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 p5OIEhqa065251; Fri, 24 Jun 2011 18:14:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OIEhXE065248; Fri, 24 Jun 2011 18:14:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241814.p5OIEhXE065248@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 18:14: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: r223512 - 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: Fri, 24 Jun 2011 18:14:43 -0000 Author: hselasky Date: Fri Jun 24 18:14:43 2011 New Revision: 223512 URL: http://svn.freebsd.org/changeset/base/223512 Log: - Move execution of event handlers into the probe and attach function so that dynamically loaded device drivers get a chance to run their event hooks. - Decouple the USB suspend and resume lock from witness. It produces some false warnings due to reusing the lock name among multiple devices. MFC after: 3 days Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jun 24 18:11:55 2011 (r223511) +++ head/sys/dev/usb/usb_device.c Fri Jun 24 18:14:43 2011 (r223512) @@ -1297,6 +1297,21 @@ usb_probe_and_attach(struct usb_device * usb_init_attach_arg(udev, &uaa); + /* + * If the whole USB device is targeted, invoke the USB event + * handler(s): + */ + if (iface_index == USB_IFACE_INDEX_ANY) { + + EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); + + if (uaa.dev_state != UAA_DEV_READY) { + /* leave device unconfigured */ + usb_unconfigure(udev, 0); + goto done; + } + } + /* Check if only one interface should be probed: */ if (iface_index != USB_IFACE_INDEX_ANY) { i = iface_index; @@ -1526,7 +1541,7 @@ usb_alloc_device(device_t parent_dev, st /* initialise our SX-lock */ sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); - sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_DUPOK); + sx_init_flags(&udev->sr_sx, "USB suspend and resume SX lock", SX_NOWITNESS); cv_init(&udev->ctrlreq_cv, "WCTRL"); cv_init(&udev->ref_cv, "UGONE"); @@ -1834,11 +1849,6 @@ repeat_set_config: } } } - EVENTHANDLER_INVOKE(usb_dev_configured, udev, &uaa); - if (uaa.dev_state != UAA_DEV_READY) { - /* leave device unconfigured */ - usb_unconfigure(udev, 0); - } config_done: DPRINTF("new dev (addr %d), udev=%p, parent_hub=%p\n", Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Fri Jun 24 18:11:55 2011 (r223511) +++ head/sys/dev/usb/usb_msctest.c Fri Jun 24 18:14:43 2011 (r223512) @@ -489,6 +489,24 @@ bbb_attach(struct usb_device *udev, uint struct usb_interface_descriptor *id; struct bbb_transfer *sc; usb_error_t err; + uint8_t do_unlock; + + /* automatic locking */ + if (usbd_enum_is_locked(udev)) { + do_unlock = 0; + } else { + do_unlock = 1; + usbd_enum_lock(udev); + } + + /* + * Make sure any driver which is hooked up to this interface, + * like umass is gone: + */ + usb_detach_device(udev, iface_index, 0); + + if (do_unlock) + usbd_enum_unlock(udev); iface = usbd_get_iface(udev, iface_index); if (iface == NULL) From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 19:02:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732D9106564A; Fri, 24 Jun 2011 19:02:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 62D5B8FC16; Fri, 24 Jun 2011 19:02: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 p5OJ2uej066641; Fri, 24 Jun 2011 19:02:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OJ2uCL066639; Fri, 24 Jun 2011 19:02:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241902.p5OJ2uCL066639@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:02: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: r223513 - 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: Fri, 24 Jun 2011 19:02:56 -0000 Author: hselasky Date: Fri Jun 24 19:02:56 2011 New Revision: 223513 URL: http://svn.freebsd.org/changeset/base/223513 Log: - Ensure that we get all the required nomatch devd events. MFC after: 3 days Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Fri Jun 24 18:14:43 2011 (r223512) +++ head/sys/dev/usb/usb_device.c Fri Jun 24 19:02:56 2011 (r223513) @@ -1358,17 +1358,18 @@ usb_probe_and_attach(struct usb_device * uaa.info.bIfaceIndex, uaa.info.bIfaceNum); - if (usb_probe_and_attach_sub(udev, &uaa)) { - /* ignore */ - } - } + usb_probe_and_attach_sub(udev, &uaa); - if (uaa.temp_dev) { - /* remove the last created child; it is unused */ - - if (device_delete_child(udev->parent_dev, uaa.temp_dev)) { + /* + * Remove the leftover child, if any, to enforce that + * a new nomatch devd event is generated for the next + * interface if no driver is found: + */ + if (uaa.temp_dev == NULL) + continue; + if (device_delete_child(udev->parent_dev, uaa.temp_dev)) DPRINTFN(0, "device delete child failed\n"); - } + uaa.temp_dev = NULL; } done: if (do_unlock) From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 19:24:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655111065670; Fri, 24 Jun 2011 19:24:45 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 24E5E8FC12; Fri, 24 Jun 2011 19:24:44 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 59269582C0; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 3CbTTET+xgwV; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-119.icecube.wisc.edu [172.16.223.119]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 1D21B58143; Fri, 24 Jun 2011 14:24:44 -0500 (CDT) Message-ID: <4E04E47B.2030007@freebsd.org> Date: Fri, 24 Jun 2011 14:24:43 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: Marcel Moolenaar References: <201106232221.p5NMLSFj019042@svn.freebsd.org> <1B2D07F9-3716-4581-8426-11BE78CE1D1F@xcllnt.net> <4E04B8DC.1020600@freebsd.org> <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> In-Reply-To: <13E5FED8-30BE-4292-B024-AB692E9E2A89@xcllnt.net> 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: r223485 - in head/sys/powerpc: aim booke include ofw powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 19:24:45 -0000 On 06/24/11 11:33, Marcel Moolenaar wrote: > > On Jun 24, 2011, at 9:18 AM, Nathan Whitehorn wrote: > >> On 06/24/11 11:11, Marcel Moolenaar wrote: >>> >>> On Jun 23, 2011, at 3:21 PM, Nathan Whitehorn wrote: >>> >>>> Author: nwhitehorn Date: Thu Jun 23 22:21:28 2011 New Revision: >>>> 223485 URL: http://svn.freebsd.org/changeset/base/223485 >>>> >>>> Log: Use the ABI-mandated thread pointer register (r2 for >>>> ppc32, r13 for ppc64) instead of a PCPU field for curthread. >>>> This averts a race on SMP systems with a high interrupt rate >>>> where the thread looking up the value of curthread could be >>>> preempted and migrated between obtaining the PCPU pointer and >>>> reading the value of pc_curthread, resulting in curthread >>>> being observed to be the current thread on the thread's >>>> original CPU. This played merry havoc with the system, in >>>> particular with mutexes. Many thanks to jhb for helping me work >>>> this one out. >>> >>> Nice catch! >>> >>> Another approach would be to have r2/r13 hold the address of the >>> PCPU structure and simply do a load from that address to get >>> curthread. The difference between the approaches is the need to >>> to a memory load or not for curthread. But with r2/r13 pointing >>> to the PCPU, you may be faster to get other PCPU fields if >>> reading from the a SPR adds to the overhead. Plus, it's easier to >>> be atomic if you don't have to read the SPR first and then do a >>> load. >> >> The trouble with this approach is that r2/r13 would need to be >> updated on every CPU switch with the new PCPU pointer, so I just >> put curthread in there due to laziness, which is of course constant >> for a given thread. > > Actually, you need to save and assign that register on entry into the > kernel only and restore it when you go back to user space (due to it > being the thread pointer in user space). It remains a constant within > the kernel (from the CPU's point of view) and does not have to be > changed on a context switch. > > If r2/r13 hold curthread, then r2/r13 are indeed constant from the > perspective of the thread, but it needs to be changed for every > context switch in that case. From the CPU's perspective these > registers are not constant then. > >> Another consideration is that we'd have to additionally maintain >> SPRG0 as the PCPU pointer anyway, since we need a PCPU area that >> userland can't change (r2/r13 is set from PCPU data when traps are >> taken now). > > Yes. > > On ia64 we use the thread register to hold the address of the PCPU > structure and since curthread is at offset 0 in the PCPU structure, > we can do an atomic load. We use a kernel register to restore the > PCPU address in the thread register on entry into the kernel. Works > well and it doesn't make curthread too special (other than it needing > to be at offset 0 in the PCPU structure for the dereferencing to be > atomic). As such, even PCPU_GET(curthread) is atomic... Ah, I understand now. There's some code in thread switching that saves/restores R2/R13 which would need to be turned off, but maybe that's something to look into. > Anyway: I'll see about fixing Book-E... Thanks! >>> Is curthread the only field that needs to be atomically accessed >>> or are other fields in the PCPU susceptible to race conditions? >> >> In my discussion with John yesterday, he said he thought it was the >> only one susceptible to races of this type. The approach I used >> here (providing a special accessor for curthread that reads a >> non-PCPU-related register) is borrowed from the one used on amd64, >> i386, and alpha. Whether it is the only possibility for this kind >> of race or not, none of these platforms at least override anything >> else. > > Thanks. That's what I figured, but I never really had any firm > confirmation and we still have comments in our code like: > > /* * XXX The implementation of this operation should be made atomic * > with respect to preemption. */ #define PCPU_ADD(member, value) > (pcpup->pc_ ## member += (value)) > > > It's always created uncertainty and doubt in my mind... Is there a good reason not to just sched_pin() or critical_enter() around those? This doesn't work for curthread, of course, but for the rest it should. -Nathan From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 19:24:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 011161065785; Fri, 24 Jun 2011 19:24:57 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id ABB498FC17; Fri, 24 Jun 2011 19:24: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 p5OJOu0s067286; Fri, 24 Jun 2011 19:24:56 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OJOukH067284; Fri, 24 Jun 2011 19:24:56 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201106241924.p5OJOukH067284@svn.freebsd.org> From: Joerg Wunsch Date: Fri, 24 Jun 2011 19:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223514 - stable/8/usr.sbin/fdread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 19:24:57 -0000 Author: joerg Date: Fri Jun 24 19:24:56 2011 New Revision: 223514 URL: http://svn.freebsd.org/changeset/base/223514 Log: Open the floppy disk device with O_RDONLY rather than O_RDWR. After all, this is the fd*read* command, and thus should be able to read even write-protected disks. Modified: stable/8/usr.sbin/fdread/fdread.c Directory Properties: stable/8/usr.sbin/fdread/ (props changed) Modified: stable/8/usr.sbin/fdread/fdread.c ============================================================================== --- stable/8/usr.sbin/fdread/fdread.c Fri Jun 24 19:02:56 2011 (r223513) +++ stable/8/usr.sbin/fdread/fdread.c Fri Jun 24 19:24:56 2011 (r223514) @@ -149,7 +149,7 @@ main(int argc, char **argv) err(EX_OSERR, "cannot create output file %s", fname); } - if ((fd = open(_devname, O_RDWR)) == -1) + if ((fd = open(_devname, O_RDONLY)) == -1) err(EX_OSERR, "cannot open device %s", _devname); return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 19:32:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0424D106564A; Fri, 24 Jun 2011 19:32:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id E76458FC14; Fri, 24 Jun 2011 19:32: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 p5OJWTdU067533; Fri, 24 Jun 2011 19:32:29 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OJWT4e067528; Fri, 24 Jun 2011 19:32:29 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106241932.p5OJWT4e067528@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 24 Jun 2011 19:32: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: r223515 - in head/sys/dev/usb: misc 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: Fri, 24 Jun 2011 19:32:30 -0000 Author: hselasky Date: Fri Jun 24 19:32:29 2011 New Revision: 223515 URL: http://svn.freebsd.org/changeset/base/223515 Log: - Export more USB device ID's. MFC after: 3 days Modified: head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/misc/udbp.c Fri Jun 24 19:32:29 2011 (r223515) @@ -288,40 +288,27 @@ udbp_modload(module_t mod, int event, vo return (error); } +static const STRUCT_USB_HOST_ID udbp_devs[] = { + {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)}, + {USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)}, + {USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)}, +}; + static int udbp_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) return (ENXIO); - } - /* - * XXX Julian, add the id of the device if you have one to test - * things with. run 'usbdevs -v' and note the 3 ID's that appear. - * The Vendor Id and Product Id are in hex and the Revision Id is in - * bcd. But as usual if the revision is 0x101 then you should - * compare the revision id in the device descriptor with 0x101 Or go - * search the file usbdevs.h. Maybe the device is already in there. - */ - if (((uaa->info.idVendor == USB_VENDOR_NETCHIP) && - (uaa->info.idProduct == USB_PRODUCT_NETCHIP_TURBOCONNECT))) - return (0); - - if (((uaa->info.idVendor == USB_VENDOR_PROLIFIC) && - ((uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2301) || - (uaa->info.idProduct == USB_PRODUCT_PROLIFIC_PL2302)))) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_ANCHOR) && - (uaa->info.idProduct == USB_PRODUCT_ANCHOR_EZLINK)) - return (0); - - if ((uaa->info.idVendor == USB_VENDOR_GENESYS) && - (uaa->info.idProduct == USB_PRODUCT_GENESYS_GL620USB)) - return (0); - return (ENXIO); + return (usbd_lookup_id_by_uaa(udbp_devs, sizeof(udbp_devs), uaa)); } static int Modified: head/sys/dev/usb/misc/ufm.c ============================================================================== --- head/sys/dev/usb/misc/ufm.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/misc/ufm.c Fri Jun 24 19:32:29 2011 (r223515) @@ -118,19 +118,23 @@ DRIVER_MODULE(ufm, uhub, ufm_driver, ufm MODULE_DEPEND(ufm, usb, 1, 1, 1); MODULE_VERSION(ufm, 1); +static const STRUCT_USB_HOST_ID ufm_devs[] = { + {USB_VPI(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_FMRADIO, 0)}, +}; + static int ufm_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } - if ((uaa->info.idVendor == USB_VENDOR_CYPRESS) && - (uaa->info.idProduct == USB_PRODUCT_CYPRESS_FMRADIO)) { - return (0); - } - return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->info.bIfaceIndex != 0) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(ufm_devs, sizeof(ufm_devs), uaa)); } static int Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/serial/ufoma.c Fri Jun 24 19:32:29 2011 (r223515) @@ -327,6 +327,11 @@ MODULE_DEPEND(ufoma, ucom, 1, 1, 1); MODULE_DEPEND(ufoma, usb, 1, 1, 1); MODULE_VERSION(ufoma, 1); +static const STRUCT_USB_HOST_ID ufoma_devs[] = { + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_MCPC),}, +}; + static int ufoma_probe(device_t dev) { @@ -334,30 +339,31 @@ ufoma_probe(device_t dev) struct usb_interface_descriptor *id; struct usb_config_descriptor *cd; usb_mcpc_acm_descriptor *mad; + int error; - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + + error = usbd_lookup_id_by_uaa(ufoma_devs, sizeof(ufoma_devs), uaa); + if (error) + return (error); + id = usbd_get_interface_descriptor(uaa->iface); cd = usbd_get_config_descriptor(uaa->device); - if ((id == NULL) || - (cd == NULL) || - (id->bInterfaceClass != UICLASS_CDC) || - (id->bInterfaceSubClass != UISUBCLASS_MCPC)) { + if (id == NULL || cd == NULL) return (ENXIO); - } + mad = ufoma_get_intconf(cd, id, UDESC_VS_INTERFACE, UDESCSUB_MCPC_ACM); - if (mad == NULL) { + if (mad == NULL) return (ENXIO); - } + #ifndef UFOMA_HANDSFREE if ((mad->bType == UMCPC_ACM_TYPE_AB5) || - (mad->bType == UMCPC_ACM_TYPE_AB6)) { + (mad->bType == UMCPC_ACM_TYPE_AB6)) return (ENXIO); - } #endif - return (0); + return (BUS_PROBE_GENERIC); } static int Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Fri Jun 24 19:24:56 2011 (r223514) +++ head/sys/dev/usb/serial/umodem.c Fri Jun 24 19:32:29 2011 (r223515) @@ -276,11 +276,14 @@ umodem_probe(device_t dev) DPRINTFN(11, "\n"); - if (uaa->usb_mode != USB_MODE_HOST) { + if (uaa->usb_mode != USB_MODE_HOST) return (ENXIO); - } + error = usbd_lookup_id_by_uaa(umodem_devs, sizeof(umodem_devs), uaa); - return (error); + if (error) + return (error); + + return (BUS_PROBE_GENERIC); } static int From owner-svn-src-all@FreeBSD.ORG Fri Jun 24 20:15:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EB63106566C; Fri, 24 Jun 2011 20:15:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 8CA9A8FC14; Fri, 24 Jun 2011 20:15: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 p5OKFiVA068798; Fri, 24 Jun 2011 20:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5OKFirZ068796; Fri, 24 Jun 2011 20:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106242015.p5OKFirZ068796@svn.freebsd.org> From: Rick Macklem Date: Fri, 24 Jun 2011 20:15: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: r223516 - stable/8/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 24 Jun 2011 20:15:44 -0000 Author: rmacklem Date: Fri Jun 24 20:15:44 2011 New Revision: 223516 URL: http://svn.freebsd.org/changeset/base/223516 Log: MFC: r216587, r222623 Fix the nfs related daemons so that they don't intermittently fail with "bind: address already in use". This problem was reported to the freebsd-stable@ mailing list on Feb. 19 under the subject heading "statd/lockd startup failure" by george+freebsd at m5p dot com. The problem is that the first combination of {udp,tcp X ipv4,ipv6} would select a port# dynamically, but one of the other three combinations would have that port# already in use. The patch is somewhat involved because it was requested by dougb@ that the four combinations use the same port# wherever possible. The patch splits the create_service() function into two functions. The first goes as far as bind(2) in a loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port# for all four cases. If these attempts fail, the last attempt allows the 4 cases to use different port #s. After this function has succeeded, the second function, called complete_service(), does the rest of what create_service() did. The three daemons mountd, rpc.lockd and rpc.statd all have a create_service() function that is patched in a similar way. However, create_service() has non-trivial differences for the three daemons that made it impractical to share the same functions between them. Also MFC'd r216587 so that r222623 would merge cleanly and mountd.c would be up to date. Modified: stable/8/usr.sbin/mountd/mountd.c Directory Properties: stable/8/usr.sbin/mountd/ (props changed) Modified: stable/8/usr.sbin/mountd/mountd.c ============================================================================== --- stable/8/usr.sbin/mountd/mountd.c Fri Jun 24 19:32:29 2011 (r223515) +++ stable/8/usr.sbin/mountd/mountd.c Fri Jun 24 20:15:44 2011 (r223516) @@ -158,6 +158,8 @@ struct fhreturn { int *fhr_secflavors; }; +#define GETPORT_MAXTRY 20 /* Max tries to get a port # */ + /* Global defs */ char *add_expdir(struct dirlist **, char *, int); void add_dlist(struct dirlist **, struct dirlist *, @@ -167,7 +169,9 @@ int check_dirpath(char *); int check_options(struct dirlist *); int checkmask(struct sockaddr *sa); int chk_host(struct dirlist *, struct sockaddr *, int *, int *); -void create_service(struct netconfig *nconf); +static int create_service(struct netconfig *nconf); +static void complete_service(struct netconfig *nconf, char *port_str); +static void clearout_service(void); void del_mlist(char *hostp, char *dirp); struct dirlist *dirp_search(struct dirlist *, char *); int do_mount(struct exportlist *, struct grouplist *, int, @@ -196,6 +200,7 @@ void mntsrv(struct svc_req *, SVCXPRT *) void nextfield(char **, char **); void out_of_mem(void); void parsecred(char *, struct xucred *); +int parsesec(char *, struct exportlist *); int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *, int); void *sa_rawaddr(struct sockaddr *sa, int *nbytes); int sacmp(struct sockaddr *sa1, struct sockaddr *sa2, @@ -205,6 +210,7 @@ static void usage(void); int xdr_dir(XDR *, char *); int xdr_explist(XDR *, caddr_t); int xdr_explist_brief(XDR *, caddr_t); +int xdr_explist_common(XDR *, caddr_t, int); int xdr_fhs(XDR *, caddr_t); int xdr_mlist(XDR *, caddr_t); void terminate(int); @@ -231,6 +237,10 @@ int got_sighup = 0; int xcreated = 0; char *svcport_str = NULL; +static int mallocd_svcport = 0; +static int *sock_fd; +static int sock_fdcnt; +static int sock_fdpos; int opt_flags; static int have_v6 = 1; @@ -269,9 +279,7 @@ int debug = 0; * and "-n" to allow nonroot mount. */ int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { fd_set readfds; struct netconfig *nconf; @@ -281,6 +289,8 @@ main(argc, argv) in_port_t svcport; int c, k, s; int maxrec = RPC_MAXDATASIZE; + int attempt_cnt, port_len, port_pos, ret; + char **port_list; /* Check that another mountd isn't already running. */ pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &otherpid); @@ -451,17 +461,97 @@ main(argc, argv) hosts[nhosts - 1] = "127.0.0.1"; } + attempt_cnt = 1; + sock_fdcnt = 0; + sock_fd = NULL; + port_list = NULL; + port_len = 0; + nc_handle = setnetconfig(); + while ((nconf = getnetconfig(nc_handle))) { + if (nconf->nc_flag & NC_VISIBLE) { + if (have_v6 == 0 && strcmp(nconf->nc_protofmly, + "inet6") == 0) { + /* DO NOTHING */ + } else { + ret = create_service(nconf); + if (ret == 1) + /* Ignore this call */ + continue; + if (ret < 0) { + /* + * Failed to bind port, so close off + * all sockets created and try again + * if the port# was dynamically + * assigned via bind(2). + */ + clearout_service(); + if (mallocd_svcport != 0 && + attempt_cnt < GETPORT_MAXTRY) { + free(svcport_str); + svcport_str = NULL; + mallocd_svcport = 0; + } else { + errno = EADDRINUSE; + syslog(LOG_ERR, + "bindresvport_sa: %m"); + exit(1); + } + + /* Start over at the first service. */ + free(sock_fd); + sock_fdcnt = 0; + sock_fd = NULL; + nc_handle = setnetconfig(); + attempt_cnt++; + } else if (mallocd_svcport != 0 && + attempt_cnt == GETPORT_MAXTRY) { + /* + * For the last attempt, allow + * different port #s for each nconf + * by saving the svcport_str and + * setting it back to NULL. + */ + port_list = realloc(port_list, + (port_len + 1) * sizeof(char *)); + if (port_list == NULL) + out_of_mem(); + port_list[port_len++] = svcport_str; + svcport_str = NULL; + mallocd_svcport = 0; + } + } + } + } + + /* + * Successfully bound the ports, so call complete_service() to + * do the rest of the setup on the service(s). + */ + sock_fdpos = 0; + port_pos = 0; nc_handle = setnetconfig(); while ((nconf = getnetconfig(nc_handle))) { if (nconf->nc_flag & NC_VISIBLE) { if (have_v6 == 0 && strcmp(nconf->nc_protofmly, "inet6") == 0) { /* DO NOTHING */ + } else if (port_list != NULL) { + if (port_pos >= port_len) { + syslog(LOG_ERR, "too many port#s"); + exit(1); + } + complete_service(nconf, port_list[port_pos++]); } else - create_service(nconf); + complete_service(nconf, svcport_str); } } endnetconfig(nc_handle); + free(sock_fd); + if (port_list != NULL) { + for (port_pos = 0; port_pos < port_len; port_pos++) + free(port_list[port_pos]); + free(port_list); + } if (xcreated == 0) { syslog(LOG_ERR, "could not create any services"); @@ -491,30 +581,31 @@ main(argc, argv) /* * This routine creates and binds sockets on the appropriate - * addresses. It gets called one time for each transport and - * registrates the service with rpcbind on that trasport. + * addresses. It gets called one time for each transport. + * It returns 0 upon success, 1 for ingore the call and -1 to indicate + * bind failed with EADDRINUSE. + * Any file descriptors that have been created are stored in sock_fd and + * the total count of them is maintained in sock_fdcnt. */ -void +static int create_service(struct netconfig *nconf) { struct addrinfo hints, *res = NULL; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; struct __rpc_sockinfo si; - struct netbuf servaddr; - SVCXPRT *transp = NULL; int aicode; int fd; int nhostsbak; int one = 1; int r; - int registered = 0; u_int32_t host_addr[4]; /* IPv4 or IPv6 */ + int mallocd_res; if ((nconf->nc_semantics != NC_TPI_CLTS) && (nconf->nc_semantics != NC_TPI_COTS) && (nconf->nc_semantics != NC_TPI_COTS_ORD)) - return; /* not my type */ + return (1); /* not my type */ /* * XXX - using RPC library internal functions. @@ -522,7 +613,7 @@ create_service(struct netconfig *nconf) if (!__rpc_nconf2sockinfo(nconf, &si)) { syslog(LOG_ERR, "cannot get information for %s", nconf->nc_netid); - return; + return (1); } /* Get mountd's address on this transport */ @@ -538,6 +629,12 @@ create_service(struct netconfig *nconf) nhostsbak = nhosts; while (nhostsbak > 0) { --nhostsbak; + sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int)); + if (sock_fd == NULL) + out_of_mem(); + sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */ + mallocd_res = 0; + /* * XXX - using RPC library internal functions. */ @@ -549,14 +646,16 @@ create_service(struct netconfig *nconf) syslog(non_fatal ? LOG_DEBUG : LOG_ERR, "cannot create socket for %s", nconf->nc_netid); - return; + if (non_fatal != 0) + continue; + exit(1); } switch (hints.ai_family) { case AF_INET: if (inet_pton(AF_INET, hosts[nhostsbak], host_addr) == 1) { - hints.ai_flags &= AI_NUMERICHOST; + hints.ai_flags |= AI_NUMERICHOST; } else { /* * Skip if we have an AF_INET6 address. @@ -571,7 +670,7 @@ create_service(struct netconfig *nconf) case AF_INET6: if (inet_pton(AF_INET6, hosts[nhostsbak], host_addr) == 1) { - hints.ai_flags &= AI_NUMERICHOST; + hints.ai_flags |= AI_NUMERICHOST; } else { /* * Skip if we have an AF_INET address. @@ -607,6 +706,7 @@ create_service(struct netconfig *nconf) res = malloc(sizeof(struct addrinfo)); if (res == NULL) out_of_mem(); + mallocd_res = 1; res->ai_flags = hints.ai_flags; res->ai_family = hints.ai_family; res->ai_protocol = hints.ai_protocol; @@ -620,7 +720,7 @@ create_service(struct netconfig *nconf) sin->sin_addr.s_addr = htonl(INADDR_ANY); res->ai_addr = (struct sockaddr*) sin; res->ai_addrlen = (socklen_t) - sizeof(res->ai_addr); + sizeof(struct sockaddr_in); break; case AF_INET6: sin6 = malloc(sizeof(struct sockaddr_in6)); @@ -631,10 +731,12 @@ create_service(struct netconfig *nconf) sin6->sin6_addr = in6addr_any; res->ai_addr = (struct sockaddr*) sin6; res->ai_addrlen = (socklen_t) - sizeof(res->ai_addr); - break; - default: + sizeof(struct sockaddr_in6); break; + default: + syslog(LOG_ERR, "bad addr fam %d", + res->ai_family); + exit(1); } } else { if ((aicode = getaddrinfo(NULL, svcport_str, @@ -643,6 +745,7 @@ create_service(struct netconfig *nconf) "cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode)); + close(fd); continue; } } @@ -652,16 +755,91 @@ create_service(struct netconfig *nconf) syslog(LOG_ERR, "cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode)); + close(fd); continue; } } + /* Store the fd. */ + sock_fd[sock_fdcnt - 1] = fd; + + /* Now, attempt the bind. */ r = bindresvport_sa(fd, res->ai_addr); if (r != 0) { + if (errno == EADDRINUSE && mallocd_svcport != 0) { + if (mallocd_res != 0) { + free(res->ai_addr); + free(res); + } else + freeaddrinfo(res); + return (-1); + } syslog(LOG_ERR, "bindresvport_sa: %m"); exit(1); } + if (svcport_str == NULL) { + svcport_str = malloc(NI_MAXSERV * sizeof(char)); + if (svcport_str == NULL) + out_of_mem(); + mallocd_svcport = 1; + + if (getnameinfo(res->ai_addr, + res->ai_addr->sa_len, NULL, NI_MAXHOST, + svcport_str, NI_MAXSERV * sizeof(char), + NI_NUMERICHOST | NI_NUMERICSERV)) + errx(1, "Cannot get port number"); + } + if (mallocd_res != 0) { + free(res->ai_addr); + free(res); + } else + freeaddrinfo(res); + res = NULL; + } + return (0); +} + +/* + * Called after all the create_service() calls have succeeded, to complete + * the setup and registration. + */ +static void +complete_service(struct netconfig *nconf, char *port_str) +{ + struct addrinfo hints, *res = NULL; + struct __rpc_sockinfo si; + struct netbuf servaddr; + SVCXPRT *transp = NULL; + int aicode, fd, nhostsbak; + int registered = 0; + + if ((nconf->nc_semantics != NC_TPI_CLTS) && + (nconf->nc_semantics != NC_TPI_COTS) && + (nconf->nc_semantics != NC_TPI_COTS_ORD)) + return; /* not my type */ + + /* + * XXX - using RPC library internal functions. + */ + if (!__rpc_nconf2sockinfo(nconf, &si)) { + syslog(LOG_ERR, "cannot get information for %s", + nconf->nc_netid); + return; + } + + nhostsbak = nhosts; + while (nhostsbak > 0) { + --nhostsbak; + if (sock_fdpos >= sock_fdcnt) { + /* Should never happen. */ + syslog(LOG_ERR, "Ran out of socket fd's"); + return; + } + fd = sock_fd[sock_fdpos++]; + if (fd < 0) + continue; + if (nconf->nc_semantics != NC_TPI_CLTS) listen(fd, SOMAXCONN); @@ -696,19 +874,7 @@ create_service(struct netconfig *nconf) hints.ai_socktype = si.si_socktype; hints.ai_protocol = si.si_proto; - if (svcport_str == NULL) { - svcport_str = malloc(NI_MAXSERV * sizeof(char)); - if (svcport_str == NULL) - out_of_mem(); - - if (getnameinfo(res->ai_addr, - res->ai_addr->sa_len, NULL, NI_MAXHOST, - svcport_str, NI_MAXSERV * sizeof(char), - NI_NUMERICHOST | NI_NUMERICSERV)) - errx(1, "Cannot get port number"); - } - - if((aicode = getaddrinfo(NULL, svcport_str, &hints, + if ((aicode = getaddrinfo(NULL, port_str, &hints, &res)) != 0) { syslog(LOG_ERR, "cannot get local address: %s", gai_strerror(aicode)); @@ -728,8 +894,25 @@ create_service(struct netconfig *nconf) } /* end while */ } +/* + * Clear out sockets after a failure to bind one of them, so that the + * cycle of socket creation/binding can start anew. + */ +static void +clearout_service(void) +{ + int i; + + for (i = 0; i < sock_fdcnt; i++) { + if (sock_fd[i] >= 0) { + shutdown(sock_fd[i], SHUT_RDWR); + close(sock_fd[i]); + } + } +} + static void -usage() +usage(void) { fprintf(stderr, "usage: mountd [-2] [-d] [-e] [-l] [-n] [-p ] [-r] " @@ -741,9 +924,7 @@ usage() * The mount rpc service */ void -mntsrv(rqstp, transp) - struct svc_req *rqstp; - SVCXPRT *transp; +mntsrv(struct svc_req *rqstp, SVCXPRT *transp) { struct exportlist *ep; struct dirlist *dp; @@ -949,9 +1130,7 @@ mntsrv(rqstp, transp) * Xdr conversion for a dirpath string */ int -xdr_dir(xdrsp, dirp) - XDR *xdrsp; - char *dirp; +xdr_dir(XDR *xdrsp, char *dirp) { return (xdr_string(xdrsp, &dirp, MNTPATHLEN)); } @@ -960,9 +1139,7 @@ xdr_dir(xdrsp, dirp) * Xdr routine to generate file handle reply */ int -xdr_fhs(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_fhs(XDR *xdrsp, caddr_t cp) { struct fhreturn *fhrp = (struct fhreturn *)cp; u_long ok = 0, len, auth; @@ -998,9 +1175,7 @@ xdr_fhs(xdrsp, cp) } int -xdr_mlist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_mlist(XDR *xdrsp, caddr_t cp __unused) { struct mountlist *mlp; int true = 1; @@ -1028,10 +1203,7 @@ xdr_mlist(xdrsp, cp) * Xdr conversion for export list */ int -xdr_explist_common(xdrsp, cp, brief) - XDR *xdrsp; - caddr_t cp; - int brief; +xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief) { struct exportlist *ep; int false = 0; @@ -1067,12 +1239,8 @@ errout: * directory paths. */ int -put_exlist(dp, xdrsp, adp, putdefp, brief) - struct dirlist *dp; - XDR *xdrsp; - struct dirlist *adp; - int *putdefp; - int brief; +put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp, + int brief) { struct grouplist *grp; struct hostlist *hp; @@ -1135,18 +1303,14 @@ put_exlist(dp, xdrsp, adp, putdefp, brie } int -xdr_explist(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_explist(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 0); } int -xdr_explist_brief(xdrsp, cp) - XDR *xdrsp; - caddr_t cp; +xdr_explist_brief(XDR *xdrsp, caddr_t cp) { return xdr_explist_common(xdrsp, cp, 1); @@ -1160,7 +1324,7 @@ FILE *exp_file; * Get the export list from one, currently open file */ static void -get_exportlist_one() +get_exportlist_one(void) { struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; @@ -1470,7 +1634,7 @@ nextline: * Get the export list from all specified files */ void -get_exportlist() +get_exportlist(void) { struct exportlist *ep, *ep2; struct grouplist *grp, *tgrp; @@ -1621,7 +1785,7 @@ get_exportlist() * Allocate an export list element */ struct exportlist * -get_exp() +get_exp(void) { struct exportlist *ep; @@ -1636,7 +1800,7 @@ get_exp() * Allocate a group list element */ struct grouplist * -get_grp() +get_grp(void) { struct grouplist *gp; @@ -1651,9 +1815,7 @@ get_grp() * Clean up upon an error in get_exportlist(). */ void -getexp_err(ep, grp) - struct exportlist *ep; - struct grouplist *grp; +getexp_err(struct exportlist *ep, struct grouplist *grp) { struct grouplist *tgrp; @@ -1672,8 +1834,7 @@ getexp_err(ep, grp) * Search the export list for a matching fs. */ struct exportlist * -ex_search(fsid) - fsid_t *fsid; +ex_search(fsid_t *fsid) { struct exportlist *ep; @@ -1691,10 +1852,7 @@ ex_search(fsid) * Add a directory path to the list. */ char * -add_expdir(dpp, cp, len) - struct dirlist **dpp; - char *cp; - int len; +add_expdir(struct dirlist **dpp, char *cp, int len) { struct dirlist *dp; @@ -1715,11 +1873,8 @@ add_expdir(dpp, cp, len) * and update the entry for host. */ void -hang_dirp(dp, grp, ep, flags) - struct dirlist *dp; - struct grouplist *grp; - struct exportlist *ep; - int flags; +hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, + int flags) { struct hostlist *hp; struct dirlist *dp2; @@ -1756,11 +1911,8 @@ hang_dirp(dp, grp, ep, flags) * for the new directory or adding the new node. */ void -add_dlist(dpp, newdp, grp, flags) - struct dirlist **dpp; - struct dirlist *newdp; - struct grouplist *grp; - int flags; +add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, + int flags) { struct dirlist *dp; struct hostlist *hp; @@ -1803,9 +1955,7 @@ add_dlist(dpp, newdp, grp, flags) * Search for a dirpath on the export point. */ struct dirlist * -dirp_search(dp, dirp) - struct dirlist *dp; - char *dirp; +dirp_search(struct dirlist *dp, char *dirp) { int cmp; @@ -1825,11 +1975,8 @@ dirp_search(dp, dirp) * Scan for a host match in a directory tree. */ int -chk_host(dp, saddr, defsetp, hostsetp) - struct dirlist *dp; - struct sockaddr *saddr; - int *defsetp; - int *hostsetp; +chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp, + int *hostsetp) { struct hostlist *hp; struct grouplist *grp; @@ -1872,9 +2019,7 @@ chk_host(dp, saddr, defsetp, hostsetp) * Scan tree for a host that matches the address. */ int -scan_tree(dp, saddr) - struct dirlist *dp; - struct sockaddr *saddr; +scan_tree(struct dirlist *dp, struct sockaddr *saddr) { int defset, hostset; @@ -1893,8 +2038,7 @@ scan_tree(dp, saddr) * Traverse the dirlist tree and free it up. */ void -free_dir(dp) - struct dirlist *dp; +free_dir(struct dirlist *dp) { if (dp) { @@ -1909,9 +2053,7 @@ free_dir(dp) * Parse a colon separated list of security flavors */ int -parsesec(seclist, ep) - char *seclist; - struct exportlist *ep; +parsesec(char *seclist, struct exportlist *ep) { char *cp, savedc; int flavor; @@ -1962,13 +2104,8 @@ parsesec(seclist, ep) * -