From owner-svn-src-stable-8@FreeBSD.ORG Sun Jun 19 01:44:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Sun Jun 19 02:03:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Sun Jun 19 02:24:37 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Sun Jun 19 02:39:03 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Sun Jun 19 11:01:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Sun Jun 19 15:33:33 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-stable-8@FreeBSD.ORG Mon Jun 20 01:43:15 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 01:48:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 01:50:13 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 01:56:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 08:37:21 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 12:32:59 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 13:46:39 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 13:51:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Mon Jun 20 18:08:35 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-stable-8@FreeBSD.ORG Tue Jun 21 08:37:56 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-stable-8@FreeBSD.ORG Tue Jun 21 08:39:09 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-stable-8@FreeBSD.ORG Wed Jun 22 00:16:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 00:21:20 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 00:35:43 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 00:38:26 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 00:48:14 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 01:42:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 01:47:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 01:54:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 01:57:32 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 06:45:35 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 07:08:44 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 07:15:57 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 07:18:15 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 08:01:45 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 08:09:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 08:22:29 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 08:52:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 08:55:00 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 09:16:33 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Wed Jun 22 18:18:06 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-stable-8@FreeBSD.ORG Thu Jun 23 00:27:45 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-stable-8@FreeBSD.ORG Thu Jun 23 00:29:36 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-stable-8@FreeBSD.ORG Thu Jun 23 15:28:54 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-stable-8@FreeBSD.ORG Thu Jun 23 21:31:03 2011 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEE3C106564A; Thu, 23 Jun 2011 21:31:03 +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 8D0568FC0C; Thu, 23 Jun 2011 21:31:03 +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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2011 21:31:04 -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-stable-8@FreeBSD.ORG Fri Jun 24 13:41:46 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-stable-8@FreeBSD.ORG Fri Jun 24 13:45:14 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-stable-8@FreeBSD.ORG Fri Jun 24 16:06:51 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-stable-8@FreeBSD.ORG Fri Jun 24 17:29:42 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-stable-8@FreeBSD.ORG Fri Jun 24 19:24:57 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-stable-8@FreeBSD.ORG Fri Jun 24 20:15:44 2011 Return-Path: Delivered-To: svn-src-stable-8@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-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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) * -