From owner-svn-src-stable-9@freebsd.org Tue Oct 6 13:11:28 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F2569B6295; Tue, 6 Oct 2015 13:11:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4340DA8C; Tue, 6 Oct 2015 13:11:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t96DBSIk077151; Tue, 6 Oct 2015 13:11:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t96DBREI077149; Tue, 6 Oct 2015 13:11:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510061311.t96DBREI077149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 6 Oct 2015 13:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288919 - stable/9/sys/netgraph X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 13:11:28 -0000 Author: mav Date: Tue Oct 6 13:11:26 2015 New Revision: 288919 URL: https://svnweb.freebsd.org/changeset/base/288919 Log: MFC r287654: Add support for PPP-Max-Payload PPPoE tag (RFC4638). Submitted by: Dmitry Luhtionov Modified: stable/9/sys/netgraph/ng_pppoe.c stable/9/sys/netgraph/ng_pppoe.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_pppoe.c ============================================================================== --- stable/9/sys/netgraph/ng_pppoe.c Tue Oct 6 13:10:21 2015 (r288918) +++ stable/9/sys/netgraph/ng_pppoe.c Tue Oct 6 13:11:26 2015 (r288919) @@ -168,6 +168,13 @@ static const struct ng_cmdlist ng_pppoe_ &ng_parse_enaddr_type, NULL }, + { + NGM_PPPOE_COOKIE, + NGM_PPPOE_SETMAXP, + "setmaxp", + &ng_parse_uint16_type, + NULL + }, { 0 } }; @@ -262,6 +269,7 @@ struct PPPoE { struct ether_header eh; LIST_HEAD(, sess_con) listeners; struct sess_hash_entry sesshash[SESSHASHSIZE]; + struct maxptag max_payload; /* PPP-Max-Payload (RFC4638) */ }; typedef struct PPPoE *priv_p; @@ -1004,6 +1012,13 @@ ng_pppoe_rcvmsg(node_p node, item_p item bcopy(msg->data, &privp->eh.ether_shost, ETHER_ADDR_LEN); break; + case NGM_PPPOE_SETMAXP: + if (msg->header.arglen != sizeof(uint16_t)) + LEAVE(EINVAL); + privp->max_payload.hdr.tag_type = PTT_MAX_PAYL; + privp->max_payload.hdr.tag_len = htons(sizeof(uint16_t)); + privp->max_payload.data = htons(*((uint16_t *)msg->data)); + break; default: LEAVE(EINVAL); } @@ -1071,6 +1086,8 @@ pppoe_start(sessp sp) init_tags(sp); insert_tag(sp, &uniqtag.hdr); insert_tag(sp, &neg->service.hdr); + if (privp->max_payload.data != 0) + insert_tag(sp, &privp->max_payload.hdr); make_packet(sp); /* * Send packet and prepare to retransmit it after timeout. @@ -1124,6 +1141,28 @@ send_sessionid(sessp sp) return (error); } +static int +send_maxp(sessp sp, const struct pppoe_tag *tag) +{ + int error; + struct ng_mesg *msg; + struct ngpppoe_maxp *maxp; + + CTR2(KTR_NET, "%20s: called %d", __func__, sp->Session_ID); + + NG_MKMESSAGE(msg, NGM_PPPOE_COOKIE, NGM_PPPOE_SETMAXP, + sizeof(struct ngpppoe_maxp), M_NOWAIT); + if (msg == NULL) + return (ENOMEM); + + maxp = (struct ngpppoe_maxp *)msg->data; + strncpy(maxp->hook, NG_HOOK_NAME(sp->hook), NG_HOOKSIZ); + maxp->data = ntohs(((const struct maxptag *)tag)->data); + NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0); + + return (error); +} + /* * Receive data from session hook and do something with it. */ @@ -1464,6 +1503,9 @@ ng_pppoe_rcvdata_ether(hook_p hook, item insert_tag(sp, tag); /* return it */ send_acname(sp, tag); } + if ((tag = get_tag(ph, PTT_MAX_PAYL)) && + (privp->max_payload.data != 0)) + insert_tag(sp, tag); /* return it */ insert_tag(sp, &neg->service.hdr); /* Service */ scan_tags(sp, ph); make_packet(sp); @@ -1602,6 +1644,9 @@ ng_pppoe_rcvdata_ether(hook_p hook, item m_freem(neg->m); free(sp->neg, M_NETGRAPH_PPPOE); sp->neg = NULL; + if ((tag = get_tag(ph, PTT_MAX_PAYL)) && + (privp->max_payload.data != 0)) + send_maxp(sp, tag); pppoe_send_event(sp, NGM_PPPOE_SUCCESS); break; case PADT_CODE: Modified: stable/9/sys/netgraph/ng_pppoe.h ============================================================================== --- stable/9/sys/netgraph/ng_pppoe.h Tue Oct 6 13:10:21 2015 (r288918) +++ stable/9/sys/netgraph/ng_pppoe.h Tue Oct 6 13:11:26 2015 (r288919) @@ -51,6 +51,7 @@ #define NG_PPPOE_NODE_TYPE "pppoe" #define NGM_PPPOE_COOKIE 1089893072 +#define NGM_PPPOE_SETMAXP_COOKIE 1441624322 #define PPPOE_SERVICE_NAME_SIZE 64 /* for now */ @@ -83,6 +84,7 @@ enum cmd { NGM_PPPOE_SETMODE = 12, /* set to standard or compat modes */ NGM_PPPOE_GETMODE = 13, /* see current mode */ NGM_PPPOE_SETENADDR = 14, /* set Ethernet address */ + NGM_PPPOE_SETMAXP = 15 /* Set PPP-Max-Payload value */ }; /*********************** @@ -147,6 +149,13 @@ struct ngpppoe_sts { { NULL } \ } +/* + * This structure is used to send PPP-Max-Payload value from server to client. + */ +struct ngpppoe_maxp { + char hook[NG_HOOKSIZ]; /* hook associated with event session */ + uint16_t data; +}; /******************************************************************** * Constants and definitions specific to pppoe @@ -227,6 +236,10 @@ struct datatag { u_int8_t data[PPPOE_SERVICE_NAME_SIZE]; }; +struct maxptag { + struct pppoe_tag hdr; + uint16_t data; +}; /* * Define the order in which we will place tags in packets From owner-svn-src-stable-9@freebsd.org Tue Oct 6 13:50:32 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F3E99A04C; Tue, 6 Oct 2015 13:50:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AC29141; Tue, 6 Oct 2015 13:50:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t96DoWiE088936; Tue, 6 Oct 2015 13:50:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t96DoWrI088935; Tue, 6 Oct 2015 13:50:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510061350.t96DoWrI088935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 6 Oct 2015 13:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288921 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 13:50:32 -0000 Author: mav Date: Tue Oct 6 13:50:31 2015 New Revision: 288921 URL: https://svnweb.freebsd.org/changeset/base/288921 Log: MFC r287821: Document NGM_PPPOE_SETMAXP. Submitted by: Dmitry Luhtionov Modified: stable/9/share/man/man4/ng_pppoe.4 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_pppoe.4 ============================================================================== --- stable/9/share/man/man4/ng_pppoe.4 Tue Oct 6 13:49:28 2015 (r288920) +++ stable/9/share/man/man4/ng_pppoe.4 Tue Oct 6 13:50:31 2015 (r288921) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ .\" -.Dd December 27, 2007 +.Dd September 15, 2015 .Dt NG_PPPOE 4 .Os .Sh NAME @@ -187,7 +187,7 @@ above messages, and reports the Access C The four commands above use a common data structure: .Bd -literal -offset 4n struct ngpppoe_sts { - char hook[NG_HOOKSIZ]; /* hook associated with event session */ + char hook[NG_HOOKSIZ]; }; .Ed .Bl -tag -width 3n @@ -244,6 +244,20 @@ hook, or when user wants to override thi .Tn ASCII form of this message is .Qq Li setenaddr . +.It Dv NGM_PPPOE_SETMAXP Pq Ic setmaxp +Set the node PPP-Max-Payload value as described in RFC 4638. +This message applies only to a client configuration. +.Tn ASCII +form of this message is +.Qq Li setmaxp . +.Pp +Data structure returned to client is: +.Bd -literal -offset 4n +struct ngpppoe_maxp { + char hook[NG_HOOKSIZ]; + uint16_t data; +}; +.Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-stable-9@freebsd.org Tue Oct 6 14:27:08 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 769669B6C52; Tue, 6 Oct 2015 14:27:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67561C27; Tue, 6 Oct 2015 14:27:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t96ER8XB002622; Tue, 6 Oct 2015 14:27:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t96ER74c002620; Tue, 6 Oct 2015 14:27:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510061427.t96ER74c002620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 6 Oct 2015 14:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288922 - stable/9/sys/netgraph X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 14:27:08 -0000 Author: mav Date: Tue Oct 6 14:27:07 2015 New Revision: 288922 URL: https://svnweb.freebsd.org/changeset/base/288922 Log: MFC r253564 (by glebius): Add constant for PPP-Max-PayLoad tag. Submitted by: Dmitry Luhtionov Modified: stable/9/sys/netgraph/ng_pppoe.c stable/9/sys/netgraph/ng_pppoe.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/netgraph/ng_pppoe.c ============================================================================== --- stable/9/sys/netgraph/ng_pppoe.c Tue Oct 6 13:50:31 2015 (r288921) +++ stable/9/sys/netgraph/ng_pppoe.c Tue Oct 6 14:27:07 2015 (r288922) @@ -1932,6 +1932,7 @@ scan_tags(sessp sp, const struct pppoe_h case PTT_SRV_ERR: case PTT_SYS_ERR: case PTT_GEN_ERR: + case PTT_MAX_PAYL: break; } pt = (const struct pppoe_tag*)ptn; Modified: stable/9/sys/netgraph/ng_pppoe.h ============================================================================== --- stable/9/sys/netgraph/ng_pppoe.h Tue Oct 6 13:50:31 2015 (r288921) +++ stable/9/sys/netgraph/ng_pppoe.h Tue Oct 6 14:27:07 2015 (r288922) @@ -181,6 +181,7 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0104) #define PTT_VENDOR (0x0105) #define PTT_RELAY_SID (0x0110) +#define PTT_MAX_PAYL (0x0120) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0201) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0203) @@ -197,6 +198,7 @@ struct ngpppoe_maxp { #define PTT_AC_COOKIE (0x0401) #define PTT_VENDOR (0x0501) #define PTT_RELAY_SID (0x1001) +#define PTT_MAX_PAYL (0x2001) /* PPP-Max-Payload (RFC4638) */ #define PTT_SRV_ERR (0x0102) #define PTT_SYS_ERR (0x0202) #define PTT_GEN_ERR (0x0302) From owner-svn-src-stable-9@freebsd.org Tue Oct 6 15:30:49 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81ACB9D09F6; Tue, 6 Oct 2015 15:30:49 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71E7A1F88; Tue, 6 Oct 2015 15:30:49 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t96FUnIw025198; Tue, 6 Oct 2015 15:30:49 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t96FUnjQ025193; Tue, 6 Oct 2015 15:30:49 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201510061530.t96FUnjQ025193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Tue, 6 Oct 2015 15:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288925 - stable/9/usr.sbin/ndiscvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 15:30:49 -0000 Author: amdmi3 (ports committer) Date: Tue Oct 6 15:30:48 2015 New Revision: 288925 URL: https://svnweb.freebsd.org/changeset/base/288925 Log: MFC r288120: Fix crash on parsing some inf files Modified: stable/9/usr.sbin/ndiscvt/inf.c stable/9/usr.sbin/ndiscvt/inf.h Directory Properties: stable/9/usr.sbin/ndiscvt/ (props changed) Modified: stable/9/usr.sbin/ndiscvt/inf.c ============================================================================== --- stable/9/usr.sbin/ndiscvt/inf.c Tue Oct 6 15:30:41 2015 (r288924) +++ stable/9/usr.sbin/ndiscvt/inf.c Tue Oct 6 15:30:48 2015 (r288925) @@ -887,6 +887,12 @@ regkey_add (const char *r) void push_word (const char *w) { + + if (idx == W_MAX) { + fprintf(stderr, "too many words; try bumping W_MAX in inf.h\n"); + exit(1); + } + if (w && strlen(w)) words[idx++] = w; else Modified: stable/9/usr.sbin/ndiscvt/inf.h ============================================================================== --- stable/9/usr.sbin/ndiscvt/inf.h Tue Oct 6 15:30:41 2015 (r288924) +++ stable/9/usr.sbin/ndiscvt/inf.h Tue Oct 6 15:30:48 2015 (r288925) @@ -4,7 +4,7 @@ * $FreeBSD$ */ -#define W_MAX 16 +#define W_MAX 32 struct section { const char * name; From owner-svn-src-stable-9@freebsd.org Tue Oct 6 22:28:29 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8D4C9B6C42; Tue, 6 Oct 2015 22:28:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6AEA1D9; Tue, 6 Oct 2015 22:28:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t96MSSYR060427; Tue, 6 Oct 2015 22:28:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t96MSS9a060426; Tue, 6 Oct 2015 22:28:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510062228.t96MSS9a060426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Oct 2015 22:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288958 - in stable: 10/sys/kern 9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 22:28:30 -0000 Author: jhb Date: Tue Oct 6 22:28:28 2015 New Revision: 288958 URL: https://svnweb.freebsd.org/changeset/base/288958 Log: MFC 287833: Threads holding a read lock of a sleepable rm lock are not permitted to sleep. The rmlock implementation enforces this by disabling sleeping when a read lock is acquired. To simplify the implementation, sleeping is disabled for most of the duration of rm_rlock. However, it doesn't need to be disabled until the lock is acquired. If a sleepable rm lock is contested, then rm_rlock may need to acquire the backing sx lock. This tripped the overly-broad assertion. Fix by relaxing the assertion around the call to sx_xlock(). Modified: stable/9/sys/kern/kern_rmlock.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_rmlock.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/kern/kern_rmlock.c ============================================================================== --- stable/9/sys/kern/kern_rmlock.c Tue Oct 6 21:58:38 2015 (r288957) +++ stable/9/sys/kern/kern_rmlock.c Tue Oct 6 22:28:28 2015 (r288958) @@ -375,9 +375,11 @@ _rm_rlock_hard(struct rmlock *rm, struct return (0); } } else { - if (rm->lock_object.lo_flags & LO_SLEEPABLE) + if (rm->lock_object.lo_flags & LO_SLEEPABLE) { + THREAD_SLEEPING_OK(); sx_xlock(&rm->rm_lock_sx); - else + THREAD_NO_SLEEPING(); + } else mtx_lock(&rm->rm_lock_mtx); } From owner-svn-src-stable-9@freebsd.org Wed Oct 7 00:33:46 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B16D9D140A; Wed, 7 Oct 2015 00:33:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 180FFDDF; Wed, 7 Oct 2015 00:33:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t970XjVo099468; Wed, 7 Oct 2015 00:33:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t970XjMQ099467; Wed, 7 Oct 2015 00:33:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510070033.t970XjMQ099467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 7 Oct 2015 00:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288967 - in stable: 10/sys/kern 9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 00:33:46 -0000 Author: jhb Date: Wed Oct 7 00:33:44 2015 New Revision: 288967 URL: https://svnweb.freebsd.org/changeset/base/288967 Log: MFC 287864: When a process group leader exits, all of the processes in the group are sent SIGHUP and SIGCONT if any of the processes are stopped. Currently this behavior is triggered for any type of process stop including ptrace() stops and transient stops for single threading during exit() and execve(). Thus, if a debugger is attached to a process in a group when the leader exits, the entire group can be HUPed. Instead, only send the signals if a process in the group is stopped due to SIGSTOP. Modified: stable/9/sys/kern/kern_proc.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_proc.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Wed Oct 7 00:32:33 2015 (r288966) +++ stable/9/sys/kern/kern_proc.c Wed Oct 7 00:33:44 2015 (r288967) @@ -691,7 +691,7 @@ orphanpg(pg) LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); - if (P_SHOULDSTOP(p)) { + if (P_SHOULDSTOP(p) == P_STOPPED_SIG) { PROC_UNLOCK(p); LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); From owner-svn-src-stable-9@freebsd.org Wed Oct 7 00:50:27 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9343E9D0072; Wed, 7 Oct 2015 00:50:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF101A7E; Wed, 7 Oct 2015 00:50:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t970oQvi003134; Wed, 7 Oct 2015 00:50:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t970oQms003133; Wed, 7 Oct 2015 00:50:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201510070050.t970oQms003133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 7 Oct 2015 00:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288969 - in stable: 10/sys/kern 9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 00:50:27 -0000 Author: jhb Date: Wed Oct 7 00:50:26 2015 New Revision: 288969 URL: https://svnweb.freebsd.org/changeset/base/288969 Log: MFC 287870: Always clear TDB_USERWR before fetching system call arguments. The TDB_USERWR flag may still be set after a debugger detaches from a process via PT_DETACH. Previously the flag would never be cleared forcing a double fetch of the system call arguments for each system call. Note that the flag cannot be cleared at PT_DETACH time in case one of the threads in the process is currently stopped in syscallenter() and the debugger has modified the arguments for that pending system call before detaching. Modified: stable/9/sys/kern/subr_syscall.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/subr_syscall.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/kern/subr_syscall.c ============================================================================== --- stable/9/sys/kern/subr_syscall.c Wed Oct 7 00:43:05 2015 (r288968) +++ stable/9/sys/kern/subr_syscall.c Wed Oct 7 00:50:26 2015 (r288969) @@ -64,14 +64,14 @@ syscallenter(struct thread *td, struct s td->td_pticks = 0; if (td->td_ucred != p->p_ucred) cred_update_thread(td); - if (p->p_flag & P_TRACED) { - traced = 1; + traced = (p->p_flag & P_TRACED) != 0; + if (traced || td->td_dbgflags & TDB_USERWR) { PROC_LOCK(p); td->td_dbgflags &= ~TDB_USERWR; - td->td_dbgflags |= TDB_SCE; + if (traced) + td->td_dbgflags |= TDB_SCE; PROC_UNLOCK(p); - } else - traced = 0; + } error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) From owner-svn-src-stable-9@freebsd.org Wed Oct 7 09:30:09 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E23AD9B6A33; Wed, 7 Oct 2015 09:30:09 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 963E065F; Wed, 7 Oct 2015 09:30:09 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t979U8bI058201; Wed, 7 Oct 2015 09:30:08 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t979U8io058200; Wed, 7 Oct 2015 09:30:08 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201510070930.t979U8io058200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Wed, 7 Oct 2015 09:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288986 - in stable/9/sys: dev/usb/wlan gnu/fs/reiserfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 09:30:10 -0000 Author: avatar Date: Wed Oct 7 09:30:08 2015 New Revision: 288986 URL: https://svnweb.freebsd.org/changeset/base/288986 Log: MFC r287698: Fixing a memory leak on module unloading. Modified: stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/forth/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/i386/gptboot/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/dev/run/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/dev/usb/wlan/if_run.c (props changed) stable/9/sys/dev/usb/wlan/if_runreg.h (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) stable/9/sys/modules/svr4/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/netpfil/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Wed Oct 7 09:29:42 2015 (r288985) +++ stable/9/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Wed Oct 7 09:30:08 2015 (r288986) @@ -1023,6 +1023,7 @@ uint32_t find_hash_out(struct reiserfs_m } } while (0); + free(ip, M_REISERFSNODE); pathrelse(&path); return (hash); } From owner-svn-src-stable-9@freebsd.org Thu Oct 8 07:19:59 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E179D0B57; Thu, 8 Oct 2015 07:19:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEE06C0; Thu, 8 Oct 2015 07:19:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t987JwB1048429; Thu, 8 Oct 2015 07:19:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t987JvPb048427; Thu, 8 Oct 2015 07:19:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510080719.t987JvPb048427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2015 07:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289009 - in stable/9: share/man/man4 sys/dev/usb/quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 07:19:59 -0000 Author: hselasky Date: Thu Oct 8 07:19:57 2015 New Revision: 289009 URL: https://svnweb.freebsd.org/changeset/base/289009 Log: MFC r288180: Implement support for reading USB quirks from the kernel environment. Refer to the usb_quirk(4) manual page for more details on how to use this new feature. Submitted by: Maxime Soule PR: 203249 Modified: stable/9/share/man/man4/usb_quirk.4 stable/9/sys/dev/usb/quirk/usb_quirk.c Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/usb_quirk.4 ============================================================================== --- stable/9/share/man/man4/usb_quirk.4 Thu Oct 8 07:18:28 2015 (r289008) +++ stable/9/share/man/man4/usb_quirk.4 Thu Oct 8 07:19:57 2015 (r289009) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2015 +.Dd September 24, 2015 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -177,7 +177,53 @@ ejects after HID command .Pp See .Pa /sys/dev/usb/quirk/usb_quirk.h -for the complete list of supported quirks. +or run "usbconfig dump_quirk_names" for the complete list of supported quirks. +.Sh LOADER TUNABLE +The following tunable can be set at the +.Xr loader 8 +prompt before booting the kernel, or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.usb.quirk.%d +The value is a string whose format is: +.Bd -literal -offset indent +.Qo VendorId ProductId LowRevision HighRevision UQ_QUIRK,... Qc +.Ed +.Pp +Installs the quirks +.Ic UQ_QUIRK,... +for all USB devices matching +.Ic VendorId , +.Ic ProductId +and has a hardware revision between and including +.Ic LowRevision +and +.Ic HighRevision . +.Pp +.Ic VendorId , +.Ic ProductId , +.Ic LowRevision +and +.Ic HighRevision +are all 16 bits numbers which can be decimal or hexadecimal based. +.Pp +A maximum of 100 variables +.Ic hw.usb.quirk.0, .1, ..., .99 +can be defined. +.Pp +If a matching entry is found in the kernel's internal quirks table, it +is replaced by the new definition. +.Pp +Else a new entry is created given that the quirk table is not full. +.Pp +The kernel iterates over the +.Ic hw.usb.quirk.N +variables starting at +.Ic N = 0 +and stops at +.Ic N = 99 +or the first non-existing one. +.El .Sh EXAMPLES After attaching a .Nm u3g @@ -186,6 +232,13 @@ device which appears as a USB device on .Bd -literal -offset indent usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT .Ed +.Pp +To install a quirk at boot time, place one or several lines like the +following in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.usb.quirk.0="0x04d9 0xfa50 0 0xffff UQ_KBD_IGNORE" +.Ed .Sh SEE ALSO .Xr usbconfig 8 .Sh HISTORY Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Oct 8 07:18:28 2015 (r289008) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Oct 8 07:19:57 2015 (r289009) @@ -61,6 +61,7 @@ MODULE_VERSION(usb_quirk, 1); #define USB_DEV_QUIRKS_MAX 384 #define USB_SUB_QUIRKS_MAX 8 +#define USB_QUIRK_ENVROOT "hw.usb.quirk." struct usb_quirk_entry { uint16_t vid; @@ -607,8 +608,32 @@ static const char *usb_quirk_str[USB_QUI static const char * usb_quirkstr(uint16_t quirk) { - return ((quirk < USB_QUIRK_MAX) ? - usb_quirk_str[quirk] : "USB_QUIRK_UNKNOWN"); + return ((quirk < USB_QUIRK_MAX && usb_quirk_str[quirk] != NULL) ? + usb_quirk_str[quirk] : "UQ_UNKNOWN"); +} + +/*------------------------------------------------------------------------* + * usb_strquirk + * + * This function converts a string into a USB quirk code. + * + * Returns: + * Less than USB_QUIRK_MAX: Quirk code + * Else: Quirk code not found + *------------------------------------------------------------------------*/ +static uint16_t +usb_strquirk(const char *str, size_t len) +{ + const char *quirk; + uint16_t x; + + for (x = 0; x != USB_QUIRK_MAX; x++) { + quirk = usb_quirkstr(x); + if (strncmp(str, quirk, len) == 0 && + quirk[len] == 0) + break; + } + return (x); } /*------------------------------------------------------------------------* @@ -853,12 +878,122 @@ usb_quirk_ioctl(unsigned long cmd, caddr return (ENOIOCTL); } +/*------------------------------------------------------------------------* + * usb_quirk_strtou16 + * + * Helper function to scan a 16-bit integer. + *------------------------------------------------------------------------*/ +static uint16_t +usb_quirk_strtou16(const char **pptr, const char *name, const char *what) +{ + unsigned long value; + char *end; + + value = strtoul(*pptr, &end, 0); + if (value > 65535 || *pptr == end || (*end != ' ' && *end != '\t')) { + printf("%s: %s 16-bit %s value set to zero\n", + name, what, *end == 0 ? "incomplete" : "invalid"); + return (0); + } + *pptr = end + 1; + return ((uint16_t)value); +} + +/*------------------------------------------------------------------------* + * usb_quirk_add_entry_from_str + * + * Add a USB quirk entry from string. + * "VENDOR PRODUCT LO_REV HI_REV QUIRK[,QUIRK[,...]]" + *------------------------------------------------------------------------*/ +static void +usb_quirk_add_entry_from_str(const char *name, const char *env) +{ + struct usb_quirk_entry entry = { }; + struct usb_quirk_entry *new; + uint16_t quirk_idx; + uint16_t quirk; + const char *end; + + /* check for invalid environment variable */ + if (name == NULL || env == NULL) + return; + + if (bootverbose) + printf("Adding USB QUIRK '%s' = '%s'\n", name, env); + + /* parse device information */ + entry.vid = usb_quirk_strtou16(&env, name, "Vendor ID"); + entry.pid = usb_quirk_strtou16(&env, name, "Product ID"); + entry.lo_rev = usb_quirk_strtou16(&env, name, "Low revision"); + entry.hi_rev = usb_quirk_strtou16(&env, name, "High revision"); + + /* parse quirk information */ + quirk_idx = 0; + while (*env != 0 && quirk_idx != USB_SUB_QUIRKS_MAX) { + /* skip whitespace before quirks */ + while (*env == ' ' || *env == '\t') + env++; + + /* look for quirk separation character */ + end = strchr(env, ','); + if (end == NULL) + end = env + strlen(env); + + /* lookup quirk in string table */ + quirk = usb_strquirk(env, end - env); + if (quirk < USB_QUIRK_MAX) { + entry.quirks[quirk_idx++] = quirk; + } else { + printf("%s: unknown USB quirk '%.*s' (skipped)\n", + name, (int)(end - env), env); + } + env = end; + + /* skip quirk delimiter, if any */ + if (*env != 0) + env++; + } + + /* register quirk */ + if (quirk_idx != 0) { + if (*env != 0) { + printf("%s: Too many USB quirks, only %d allowed!\n", + name, USB_SUB_QUIRKS_MAX); + } + mtx_lock(&usb_quirk_mtx); + new = usb_quirk_get_entry(entry.vid, entry.pid, + entry.lo_rev, entry.hi_rev, 1); + if (new == NULL) + printf("%s: USB quirks table is full!\n", name); + else + memcpy(new->quirks, entry.quirks, sizeof(entry.quirks)); + mtx_unlock(&usb_quirk_mtx); + } else { + printf("%s: No USB quirks found!\n", name); + } +} + static void usb_quirk_init(void *arg) { + char envkey[sizeof(USB_QUIRK_ENVROOT) + 2]; /* 2 digits max, 0 to 99 */ + int i; + /* initialize mutex */ mtx_init(&usb_quirk_mtx, "USB quirk", NULL, MTX_DEF); + /* look for quirks defined by the environment variable */ + for (i = 0; i != 100; i++) { + snprintf(envkey, sizeof(envkey), USB_QUIRK_ENVROOT "%d", i); + + /* Stop at first undefined var */ + if (!testenv(envkey)) + break; + + /* parse environment variable */ + usb_quirk_add_entry_from_str(envkey, getenv(envkey)); + } + /* register our function */ usb_test_quirk_p = &usb_test_quirk_by_info; usb_quirk_ioctl_p = &usb_quirk_ioctl; From owner-svn-src-stable-9@freebsd.org Thu Oct 8 07:27:26 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B18FD9D1434; Thu, 8 Oct 2015 07:27:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613AD7E6; Thu, 8 Oct 2015 07:27:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t987RPF5051732; Thu, 8 Oct 2015 07:27:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t987RP5M051730; Thu, 8 Oct 2015 07:27:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510080727.t987RP5M051730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2015 07:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289014 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 07:27:26 -0000 Author: hselasky Date: Thu Oct 8 07:27:25 2015 New Revision: 289014 URL: https://svnweb.freebsd.org/changeset/base/289014 Log: MFC r287355, r287772 and r287825: Add new USB PCI IDs. PR: 202807 Submitted by: Dmitry Luhtionov Differential Revision: https://reviews.freebsd.org/D3665 Modified: stable/9/sys/dev/usb/controller/uhci_pci.c stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/uhci_pci.c Thu Oct 8 07:24:54 2015 (r289013) +++ stable/9/sys/dev/usb/controller/uhci_pci.c Thu Oct 8 07:27:25 2015 (r289014) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include "usb_if.h" #define PCI_UHCI_VENDORID_INTEL 0x8086 +#define PCI_UHCI_VENDORID_HP 0x103c #define PCI_UHCI_VENDORID_VIA 0x1106 /* PIIX4E has no separate stepping */ @@ -222,6 +223,9 @@ uhci_pci_match(device_t self) case 0x76028086: return ("Intel 82372FB/82468GX USB controller"); + case 0x3300103c: + return ("HP iLO Standard Virtual USB controller"); + case 0x30381106: return ("VIA 83C572 USB controller"); @@ -309,6 +313,9 @@ uhci_pci_attach(device_t self) case PCI_UHCI_VENDORID_INTEL: sprintf(sc->sc_vendor, "Intel"); break; + case PCI_UHCI_VENDORID_HP: + sprintf(sc->sc_vendor, "HP"); + break; case PCI_UHCI_VENDORID_VIA: sprintf(sc->sc_vendor, "VIA"); break; Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Oct 8 07:24:54 2015 (r289013) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Oct 8 07:27:25 2015 (r289014) @@ -112,6 +112,9 @@ xhci_pci_match(device_t self) case 0x8cb18086: return ("Intel Wildcat Point USB 3.0 controller"); + case 0xa01b177d: + return ("Cavium ThunderX USB 3.0 controller"); + default: break; } From owner-svn-src-stable-9@freebsd.org Thu Oct 8 07:29:32 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 525DF9D15DA; Thu, 8 Oct 2015 07:29:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 199B2A6E; Thu, 8 Oct 2015 07:29:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t987TVbC051919; Thu, 8 Oct 2015 07:29:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t987TUEM051917; Thu, 8 Oct 2015 07:29:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510080729.t987TUEM051917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2015 07:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289015 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 07:29:32 -0000 Author: hselasky Date: Thu Oct 8 07:29:30 2015 New Revision: 289015 URL: https://svnweb.freebsd.org/changeset/base/289015 Log: MFC r287321: Add new USB quirk. PR: 202783 Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Oct 8 07:27:25 2015 (r289014) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Thu Oct 8 07:29:30 2015 (r289015) @@ -98,6 +98,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(REALTEK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), + USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* Quirks for printer devices */ USB_QUIRK(HP, 895C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), USB_QUIRK(HP, 880C, 0x0000, 0xffff, UQ_BROKEN_BIDIR), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Thu Oct 8 07:27:25 2015 (r289014) +++ stable/9/sys/dev/usb/usbdevs Thu Oct 8 07:29:30 2015 (r289015) @@ -1407,6 +1407,7 @@ product CISCOLINKSYS WUSB54GC 0x0020 WUS product CISCOLINKSYS WUSB54GR 0x0023 WUSB54GR product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G product CISCOLINKSYS AE1000 0x002f AE1000 +product CISCOLINKSYS USB3GIGV1 0x0041 USB3GIGV1 USB Ethernet Adapter product CISCOLINKSYS2 RT3070 0x4001 RT3070 product CISCOLINKSYS3 RT3070 0x0101 RT3070 From owner-svn-src-stable-9@freebsd.org Thu Oct 8 08:06:25 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35AF99D11E9; Thu, 8 Oct 2015 08:06:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE3517BE; Thu, 8 Oct 2015 08:06:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9886OvE063633; Thu, 8 Oct 2015 08:06:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9886NKM063630; Thu, 8 Oct 2015 08:06:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510080806.t9886NKM063630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2015 08:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289019 - in stable/9: share/man/man3 sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 08:06:25 -0000 Author: hselasky Date: Thu Oct 8 08:06:23 2015 New Revision: 289019 URL: https://svnweb.freebsd.org/changeset/base/289019 Log: MFC r284915: Make the system queue header file fully usable within C++ programs by adding macros to define class lists. This change is backwards compatible for all use within C and C++ programs. Only C++ programs will have added support to use the queue macros within classes. Previously the queue macros could only be used within structures. The queue.3 manual page has been updated to describe the new functionality and some alphabetic sorting has been done while at it. Differential Revision: https://reviews.freebsd.org/D2745 PR: 200827 (exp-run) Modified: stable/9/share/man/man3/Makefile stable/9/share/man/man3/queue.3 stable/9/sys/sys/queue.h Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man3/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man3/Makefile ============================================================================== --- stable/9/share/man/man3/Makefile Thu Oct 8 07:50:50 2015 (r289018) +++ stable/9/share/man/man3/Makefile Thu Oct 8 08:06:23 2015 (r289019) @@ -40,10 +40,13 @@ MLINKS+= fpgetround.3 fpgetmask.3 \ MLINKS+= makedev.3 major.3 \ makedev.3 minor.3 MLINKS+= ${PTHREAD_MLINKS} -MLINKS+= queue.3 LIST_EMPTY.3 \ +MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \ + queue.3 LIST_CLASS_HEAD.3 \ + queue.3 LIST_EMPTY.3 \ queue.3 LIST_ENTRY.3 \ queue.3 LIST_FIRST.3 \ queue.3 LIST_FOREACH.3 \ + queue.3 LIST_FOREACH_FROM_SAFE.3 \ queue.3 LIST_FOREACH_SAFE.3 \ queue.3 LIST_HEAD.3 \ queue.3 LIST_HEAD_INITIALIZER.3 \ @@ -55,10 +58,13 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 LIST_PREV.3 \ queue.3 LIST_REMOVE.3 \ queue.3 LIST_SWAP.3 \ + queue.3 SLIST_CLASS_ENTRY.3 \ + queue.3 SLIST_CLASS_HEAD.3 \ queue.3 SLIST_EMPTY.3 \ queue.3 SLIST_ENTRY.3 \ queue.3 SLIST_FIRST.3 \ queue.3 SLIST_FOREACH.3 \ + queue.3 SLIST_FOREACH_FROM_SAFE.3 \ queue.3 SLIST_FOREACH_SAFE.3 \ queue.3 SLIST_HEAD.3 \ queue.3 SLIST_HEAD_INITIALIZER.3 \ @@ -70,11 +76,14 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 SLIST_REMOVE_AFTER.3 \ queue.3 SLIST_REMOVE_HEAD.3 \ queue.3 SLIST_SWAP.3 \ + queue.3 STAILQ_CLASS_ENTRY.3 \ + queue.3 STAILQ_CLASS_HEAD.3 \ queue.3 STAILQ_CONCAT.3 \ queue.3 STAILQ_EMPTY.3 \ queue.3 STAILQ_ENTRY.3 \ queue.3 STAILQ_FIRST.3 \ queue.3 STAILQ_FOREACH.3 \ + queue.3 STAILQ_FOREACH_FROM_SAFE.3 \ queue.3 STAILQ_FOREACH_SAFE.3 \ queue.3 STAILQ_HEAD.3 \ queue.3 STAILQ_HEAD_INITIALIZER.3 \ @@ -88,12 +97,16 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 STAILQ_REMOVE_AFTER.3 \ queue.3 STAILQ_REMOVE_HEAD.3 \ queue.3 STAILQ_SWAP.3 \ + queue.3 TAILQ_CLASS_ENTRY.3 \ + queue.3 TAILQ_CLASS_HEAD.3 \ queue.3 TAILQ_CONCAT.3 \ queue.3 TAILQ_EMPTY.3 \ queue.3 TAILQ_ENTRY.3 \ queue.3 TAILQ_FIRST.3 \ queue.3 TAILQ_FOREACH.3 \ + queue.3 TAILQ_FOREACH_FROM_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE.3 \ + queue.3 TAILQ_FOREACH_REVERSE_FROM_SAFE.3 \ queue.3 TAILQ_FOREACH_REVERSE_SAFE.3 \ queue.3 TAILQ_FOREACH_SAFE.3 \ queue.3 TAILQ_HEAD.3 \ Modified: stable/9/share/man/man3/queue.3 ============================================================================== --- stable/9/share/man/man3/queue.3 Thu Oct 8 07:50:50 2015 (r289018) +++ stable/9/share/man/man3/queue.3 Thu Oct 8 08:06:23 2015 (r289019) @@ -32,35 +32,39 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd April 16, 2015 +.Dd June 24, 2015 .Dt QUEUE 3 .Os .Sh NAME +.Nm SLIST_CLASS_ENTRY , +.Nm SLIST_CLASS_HEAD , .Nm SLIST_EMPTY , .Nm SLIST_ENTRY , .Nm SLIST_FIRST , .Nm SLIST_FOREACH , .Nm SLIST_FOREACH_FROM , -.Nm SLIST_FOREACH_SAFE , .Nm SLIST_FOREACH_FROM_SAFE , +.Nm SLIST_FOREACH_SAFE , .Nm SLIST_HEAD , .Nm SLIST_HEAD_INITIALIZER , .Nm SLIST_INIT , .Nm SLIST_INSERT_AFTER , .Nm SLIST_INSERT_HEAD , .Nm SLIST_NEXT , +.Nm SLIST_REMOVE , .Nm SLIST_REMOVE_AFTER , .Nm SLIST_REMOVE_HEAD , -.Nm SLIST_REMOVE , .Nm SLIST_SWAP , +.Nm STAILQ_CLASS_ENTRY , +.Nm STAILQ_CLASS_HEAD , .Nm STAILQ_CONCAT , .Nm STAILQ_EMPTY , .Nm STAILQ_ENTRY , .Nm STAILQ_FIRST , .Nm STAILQ_FOREACH , .Nm STAILQ_FOREACH_FROM , -.Nm STAILQ_FOREACH_SAFE , .Nm STAILQ_FOREACH_FROM_SAFE , +.Nm STAILQ_FOREACH_SAFE , .Nm STAILQ_HEAD , .Nm STAILQ_HEAD_INITIALIZER , .Nm STAILQ_INIT , @@ -69,17 +73,19 @@ .Nm STAILQ_INSERT_TAIL , .Nm STAILQ_LAST , .Nm STAILQ_NEXT , +.Nm STAILQ_REMOVE , .Nm STAILQ_REMOVE_AFTER , .Nm STAILQ_REMOVE_HEAD , -.Nm STAILQ_REMOVE , .Nm STAILQ_SWAP , +.Nm LIST_CLASS_ENTRY , +.Nm LIST_CLASS_HEAD , .Nm LIST_EMPTY , .Nm LIST_ENTRY , .Nm LIST_FIRST , .Nm LIST_FOREACH , .Nm LIST_FOREACH_FROM , -.Nm LIST_FOREACH_SAFE , .Nm LIST_FOREACH_FROM_SAFE , +.Nm LIST_FOREACH_SAFE , .Nm LIST_HEAD , .Nm LIST_HEAD_INITIALIZER , .Nm LIST_INIT , @@ -90,18 +96,20 @@ .Nm LIST_PREV , .Nm LIST_REMOVE , .Nm LIST_SWAP , +.Nm TAILQ_CLASS_ENTRY , +.Nm TAILQ_CLASS_HEAD , .Nm TAILQ_CONCAT , .Nm TAILQ_EMPTY , .Nm TAILQ_ENTRY , .Nm TAILQ_FIRST , .Nm TAILQ_FOREACH , .Nm TAILQ_FOREACH_FROM , -.Nm TAILQ_FOREACH_SAFE , .Nm TAILQ_FOREACH_FROM_SAFE , .Nm TAILQ_FOREACH_REVERSE , .Nm TAILQ_FOREACH_REVERSE_FROM , -.Nm TAILQ_FOREACH_REVERSE_SAFE , .Nm TAILQ_FOREACH_REVERSE_FROM_SAFE , +.Nm TAILQ_FOREACH_REVERSE_SAFE , +.Nm TAILQ_FOREACH_SAFE , .Nm TAILQ_HEAD , .Nm TAILQ_HEAD_INITIALIZER , .Nm TAILQ_INIT , @@ -119,32 +127,36 @@ lists and tail queues .Sh SYNOPSIS .In sys/queue.h .\" +.Fn SLIST_CLASS_ENTRY "CLASSTYPE" +.Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn SLIST_EMPTY "SLIST_HEAD *head" .Fn SLIST_ENTRY "TYPE" .Fn SLIST_FIRST "SLIST_HEAD *head" .Fn SLIST_FOREACH "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" .Fn SLIST_FOREACH_FROM "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" -.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" .Fn SLIST_FOREACH_FROM_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" +.Fn SLIST_FOREACH_SAFE "TYPE *var" "SLIST_HEAD *head" "SLIST_ENTRY NAME" "TYPE *temp_var" .Fn SLIST_HEAD "HEADNAME" "TYPE" .Fn SLIST_HEAD_INITIALIZER "SLIST_HEAD head" .Fn SLIST_INIT "SLIST_HEAD *head" .Fn SLIST_INSERT_AFTER "TYPE *listelm" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_NEXT "TYPE *elm" "SLIST_ENTRY NAME" +.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME" -.Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME" .\" +.Fn STAILQ_CLASS_ENTRY "CLASSTYPE" +.Fn STAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" .Fn STAILQ_EMPTY "STAILQ_HEAD *head" .Fn STAILQ_ENTRY "TYPE" .Fn STAILQ_FIRST "STAILQ_HEAD *head" .Fn STAILQ_FOREACH "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" .Fn STAILQ_FOREACH_FROM "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" -.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" .Fn STAILQ_FOREACH_FROM_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn STAILQ_FOREACH_SAFE "TYPE *var" "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" "TYPE *temp_var" .Fn STAILQ_HEAD "HEADNAME" "TYPE" .Fn STAILQ_HEAD_INITIALIZER "STAILQ_HEAD head" .Fn STAILQ_INIT "STAILQ_HEAD *head" @@ -153,18 +165,20 @@ lists and tail queues .Fn STAILQ_INSERT_TAIL "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_LAST "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_NEXT "TYPE *elm" "STAILQ_ENTRY NAME" +.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" -.Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" .Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME" .\" +.Fn LIST_CLASS_ENTRY "CLASSTYPE" +.Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn LIST_EMPTY "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" .Fn LIST_FIRST "LIST_HEAD *head" .Fn LIST_FOREACH "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" .Fn LIST_FOREACH_FROM "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" -.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" .Fn LIST_FOREACH_FROM_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" +.Fn LIST_FOREACH_SAFE "TYPE *var" "LIST_HEAD *head" "LIST_ENTRY NAME" "TYPE *temp_var" .Fn LIST_HEAD "HEADNAME" "TYPE" .Fn LIST_HEAD_INITIALIZER "LIST_HEAD head" .Fn LIST_INIT "LIST_HEAD *head" @@ -176,18 +190,20 @@ lists and tail queues .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .\" +.Fn TAILQ_CLASS_ENTRY "CLASSTYPE" +.Fn TAILQ_CLASS_HEAD "HEADNAME" "CLASSTYPE" .Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME" .Fn TAILQ_EMPTY "TAILQ_HEAD *head" .Fn TAILQ_ENTRY "TYPE" .Fn TAILQ_FIRST "TAILQ_HEAD *head" .Fn TAILQ_FOREACH "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" .Fn TAILQ_FOREACH_FROM "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" -.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_REVERSE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" .Fn TAILQ_FOREACH_REVERSE_FROM "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" -.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_FOREACH_REVERSE_FROM_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn TAILQ_FOREACH_REVERSE_SAFE "TYPE *var" "TAILQ_HEAD *head" "HEADNAME" "TAILQ_ENTRY NAME" "TYPE *temp_var" +.Fn TAILQ_FOREACH_SAFE "TYPE *var" "TAILQ_HEAD *head" "TAILQ_ENTRY NAME" "TYPE *temp_var" .Fn TAILQ_HEAD "HEADNAME" "TYPE" .Fn TAILQ_HEAD_INITIALIZER "TAILQ_HEAD head" .Fn TAILQ_INIT "TAILQ_HEAD *head" @@ -202,8 +218,18 @@ lists and tail queues .Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY NAME" .\" .Sh DESCRIPTION -These macros define and operate on four types of data structures: -singly-linked lists, singly-linked tail queues, lists, and tail queues. +These macros define and operate on four types of data structures which +can be used in both C and C++ source code: +.Bl -enum -compact -offset indent +.It +Lists +.It +Singly-linked lists +.It +Singly-linked tail queues +.It +Tail queues +.El All four structures support the following functionality: .Bl -enum -compact -offset indent .It @@ -305,24 +331,39 @@ than singly-linked lists. .Pp In the macro definitions, .Fa TYPE -is the name of a user defined structure, -that must contain a field of type +is the name of a user defined structure. +The structure must contain a field called +.Fa NAME +which is of type .Li SLIST_ENTRY , .Li STAILQ_ENTRY , .Li LIST_ENTRY , or -.Li TAILQ_ENTRY , -named -.Fa NAME . +.Li TAILQ_ENTRY . +In the macro definitions, +.Fa CLASSTYPE +is the name of a user defined class. +The class must contain a field called +.Fa NAME +which is of type +.Li SLIST_CLASS_ENTRY , +.Li STAILQ_CLASS_ENTRY , +.Li LIST_CLASS_ENTRY , +or +.Li TAILQ_CLASS_ENTRY . The argument .Fa HEADNAME is the name of a user defined structure that must be declared using the macros .Li SLIST_HEAD , +.Li SLIST_CLASS_HEAD , .Li STAILQ_HEAD , +.Li STAILQ_CLASS_HEAD , .Li LIST_HEAD , +.Li LIST_CLASS_HEAD , +.Li TAILQ_HEAD , or -.Li TAILQ_HEAD . +.Li TAILQ_CLASS_HEAD . See the examples below for further explanation of how these macros are used. .Sh SINGLY-LINKED LISTS Modified: stable/9/sys/sys/queue.h ============================================================================== --- stable/9/sys/sys/queue.h Thu Oct 8 07:50:50 2015 (r289018) +++ stable/9/sys/sys/queue.h Thu Oct 8 08:06:23 2015 (r289019) @@ -79,8 +79,10 @@ * * SLIST LIST STAILQ TAILQ * _HEAD + + + + + * _CLASS_HEAD + + + + * _HEAD_INITIALIZER + + + + * _ENTRY + + + + + * _CLASS_ENTRY + + + + * _INIT + + + + * _EMPTY + + + + * _FIRST + + + + @@ -141,6 +143,15 @@ struct qm_trace { #define TRASHIT(x) #endif /* QUEUE_MACRO_DEBUG */ +#ifdef __cplusplus +/* + * In C++ there can be structure lists and class lists: + */ +#define QUEUE_TYPEOF(type) type +#else +#define QUEUE_TYPEOF(type) struct type +#endif + /* * Singly-linked List declarations. */ @@ -149,6 +160,11 @@ struct name { \ struct type *slh_first; /* first element */ \ } +#define SLIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *slh_first; /* first element */ \ +} + #define SLIST_HEAD_INITIALIZER(head) \ { NULL } @@ -157,6 +173,11 @@ struct { \ struct type *sle_next; /* next element */ \ } +#define SLIST_CLASS_ENTRY(type) \ +struct { \ + class type *sle_next; /* next element */ \ +} + /* * Singly-linked List functions. */ @@ -211,7 +232,7 @@ struct { \ SLIST_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = SLIST_FIRST((head)); \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \ while (SLIST_NEXT(curelm, field) != (elm)) \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ @@ -229,7 +250,7 @@ struct { \ } while (0) #define SLIST_SWAP(head1, head2, type) do { \ - struct type *swap_first = SLIST_FIRST(head1); \ + QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \ SLIST_FIRST(head1) = SLIST_FIRST(head2); \ SLIST_FIRST(head2) = swap_first; \ } while (0) @@ -243,6 +264,12 @@ struct name { \ struct type **stqh_last;/* addr of last next element */ \ } +#define STAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *stqh_first; /* first element */ \ + class type **stqh_last; /* addr of last next element */ \ +} + #define STAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).stqh_first } @@ -251,6 +278,11 @@ struct { \ struct type *stqe_next; /* next element */ \ } +#define STAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *stqe_next; /* next element */ \ +} + /* * Singly-linked Tail queue functions. */ @@ -309,9 +341,10 @@ struct { \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? NULL : \ - __containerof((head)->stqh_last, struct type, field.stqe_next)) +#define STAILQ_LAST(head, type, field) \ + (STAILQ_EMPTY((head)) ? NULL : \ + __containerof((head)->stqh_last, \ + QUEUE_TYPEOF(type), field.stqe_next)) #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) @@ -321,7 +354,7 @@ struct { \ STAILQ_REMOVE_HEAD((head), field); \ } \ else { \ - struct type *curelm = STAILQ_FIRST((head)); \ + QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \ while (STAILQ_NEXT(curelm, field) != (elm)) \ curelm = STAILQ_NEXT(curelm, field); \ STAILQ_REMOVE_AFTER(head, curelm, field); \ @@ -342,8 +375,8 @@ struct { \ } while (0) #define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ + QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \ + QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \ STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ @@ -363,6 +396,11 @@ struct name { \ struct type *lh_first; /* first element */ \ } +#define LIST_CLASS_HEAD(name, type) \ +struct name { \ + class type *lh_first; /* first element */ \ +} + #define LIST_HEAD_INITIALIZER(head) \ { NULL } @@ -372,6 +410,12 @@ struct { \ struct type **le_prev; /* address of previous next element */ \ } +#define LIST_CLASS_ENTRY(type) \ +struct { \ + class type *le_next; /* next element */ \ + class type **le_prev; /* address of previous next element */ \ +} + /* * List functions. */ @@ -456,9 +500,10 @@ struct { \ #define LIST_NEXT(elm, field) ((elm)->field.le_next) -#define LIST_PREV(elm, head, type, field) \ - ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ - __containerof((elm)->field.le_prev, struct type, field.le_next)) +#define LIST_PREV(elm, head, type, field) \ + ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ + __containerof((elm)->field.le_prev, \ + QUEUE_TYPEOF(type), field.le_next)) #define LIST_REMOVE(elm, field) do { \ QMD_SAVELINK(oldnext, (elm)->field.le_next); \ @@ -474,7 +519,7 @@ struct { \ } while (0) #define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ + QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \ LIST_FIRST((head1)) = LIST_FIRST((head2)); \ LIST_FIRST((head2)) = swap_tmp; \ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ @@ -493,6 +538,13 @@ struct name { \ TRACEBUF \ } +#define TAILQ_CLASS_HEAD(name, type) \ +struct name { \ + class type *tqh_first; /* first element */ \ + class type **tqh_last; /* addr of last next element */ \ + TRACEBUF \ +} + #define TAILQ_HEAD_INITIALIZER(head) \ { NULL, &(head).tqh_first } @@ -503,6 +555,13 @@ struct { \ TRACEBUF \ } +#define TAILQ_CLASS_ENTRY(type) \ +struct { \ + class type *tqe_next; /* next element */ \ + class type **tqe_prev; /* address of previous next element */ \ + TRACEBUF \ +} + /* * Tail queue functions. */ @@ -673,8 +732,8 @@ struct { \ } while (0) #define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ + QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \ + QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \ (head1)->tqh_first = (head2)->tqh_first; \ (head1)->tqh_last = (head2)->tqh_last; \ (head2)->tqh_first = swap_first; \ From owner-svn-src-stable-9@freebsd.org Thu Oct 8 08:55:36 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69C3F9D1A5A; Thu, 8 Oct 2015 08:55:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2748CEEF; Thu, 8 Oct 2015 08:55:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t988tZwv078102; Thu, 8 Oct 2015 08:55:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t988tZxs078100; Thu, 8 Oct 2015 08:55:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510080855.t988tZxs078100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2015 08:55:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289022 - in stable/9/sys: net netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 08:55:36 -0000 Author: hselasky Date: Thu Oct 8 08:55:34 2015 New Revision: 289022 URL: https://svnweb.freebsd.org/changeset/base/289022 Log: MFC r287775: Update TSO limits to include all headers. To make driver programming easier the TSO limits are changed to reflect the values used in the BUSDMA tag a network adapter driver is using. The TCP/IP network stack will subtract space for all linklevel and protocol level headers and ensure that the full mbuf chain passed to the network adapter fits within the given limits. See r287775 for a more detailed description. Differential Revision: https://reviews.freebsd.org/D3477 Reviewed by: rmacklem Modified: stable/9/sys/net/if_var.h stable/9/sys/netinet/tcp_output.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Thu Oct 8 08:55:08 2015 (r289021) +++ stable/9/sys/net/if_var.h Thu Oct 8 08:55:34 2015 (r289022) @@ -222,11 +222,12 @@ struct ifnet { * count limit does not apply. If all three fields are zero, * there is no TSO limit. * - * NOTE: The TSO limits only apply to the data payload part of - * a TCP/IP packet. That means there is no need to subtract - * space for ethernet-, vlan-, IP- or TCP- headers from the - * TSO limits unless the hardware driver in question requires - * so. + * NOTE: The TSO limits should reflect the values used in the + * BUSDMA tag a network adapter is using to load a mbuf chain + * for transmission. The TCP/IP network stack will subtract + * space for all linklevel and protocol level headers and + * ensure that the full mbuf chain passed to the network + * adapter fits within the given limits. */ u_int if_hw_tsomax; int if_ispare[1]; Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Thu Oct 8 08:55:08 2015 (r289021) +++ stable/9/sys/netinet/tcp_output.c Thu Oct 8 08:55:34 2015 (r289022) @@ -798,7 +798,8 @@ send: */ if (if_hw_tsomax != 0) { /* compute maximum TSO length */ - max_len = (if_hw_tsomax - hdrlen); + max_len = (if_hw_tsomax - hdrlen - + max_linkhdr); if (max_len <= 0) { len = 0; } else if (len > max_len) { @@ -813,6 +814,15 @@ send: */ if (if_hw_tsomaxsegcount != 0 && if_hw_tsomaxsegsize != 0) { + /* + * Subtract one segment for the LINK + * and TCP/IP headers mbuf that will + * be prepended to this mbuf chain + * after the code in this section + * limits the number of mbufs in the + * chain to if_hw_tsomaxsegcount. + */ + if_hw_tsomaxsegcount -= 1; max_len = 0; mb = sbsndmbuf(&so->so_snd, off, &moff); From owner-svn-src-stable-9@freebsd.org Thu Oct 8 18:01:58 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E459D1463; Thu, 8 Oct 2015 18:01:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBF72321; Thu, 8 Oct 2015 18:01:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t98I1us5046501; Thu, 8 Oct 2015 18:01:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t98I1ujk046499; Thu, 8 Oct 2015 18:01:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510081801.t98I1ujk046499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 8 Oct 2015 18:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289046 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 18:01:58 -0000 Author: bdrewery Date: Thu Oct 8 18:01:56 2015 New Revision: 289046 URL: https://svnweb.freebsd.org/changeset/base/289046 Log: MFC r288271: Document bus_get_resource(9). Added: stable/9/share/man/man9/bus_get_resource.9 - copied unchanged from r288271, head/share/man/man9/bus_get_resource.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Thu Oct 8 18:01:14 2015 (r289045) +++ stable/9/share/man/man9/Makefile Thu Oct 8 18:01:56 2015 (r289046) @@ -38,6 +38,7 @@ MAN= accept_filter.9 \ bus_generic_print_child.9 \ bus_generic_read_ivar.9 \ bus_generic_shutdown.9 \ + bus_get_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ BUS_READ_IVAR.9 \ Copied: stable/9/share/man/man9/bus_get_resource.9 (from r288271, head/share/man/man9/bus_get_resource.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/bus_get_resource.9 Thu Oct 8 18:01:56 2015 (r289046, copy of r288271, head/share/man/man9/bus_get_resource.9) @@ -0,0 +1,94 @@ +.\" +.\" Copyright (c) 2008 +.\" The DragonFly Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in +.\" the documentation and/or other materials provided with the +.\" distribution. +.\" 3. Neither the name of The DragonFly Project nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific, prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $DragonFly: src/share/man/man9/bus_get_resource.9,v 1.1 2008/11/09 09:48:41 swildner Exp $ +.\" $FreeBSD$ +.\" +.Dd September 26, 2015 +.Dt BUS_GET_RESOURCE 9 +.Os +.Sh NAME +.Nm bus_get_resource +.Nd "read a resource range/value with a given resource ID" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.In sys/rman.h +.Ft int +.Fo bus_get_resource +.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp" +.Fc +.Sh DESCRIPTION +The +.Fn bus_get_resource +function reads the range or value of the resource +.Fa type , rid +pair and stores it in the +.Fa startp +and +.Fa countp +arguments. +.Pp +The arguments are as follows: +.Bl -tag -width ".Fa startp" +.It Fa dev +The device to read the resource from. +.It Fa type +The type of resource you want to read. +It is one of: +.Pp +.Bl -tag -width ".Dv SYS_RES_MEMORY" -compact +.It Dv SYS_RES_IRQ +for IRQs +.It Dv SYS_RES_DRQ +for ISA DMA lines +.It Dv SYS_RES_MEMORY +for I/O memory +.It Dv SYS_RES_IOPORT +for I/O ports +.El +.It Fa rid +A bus-specific handle that identifies the resource being read. +.It Fa startp +A pointer to the start address of this resource. +.It Fa countp +A pointer to the length of the resource. +For example, the size of the memory in bytes. +.El +.Sh RETURN VALUES +Zero is returned on success, otherwise an error is returned. +.Sh SEE ALSO +.Xr bus_set_resource 9 , +.Xr device 9 , +.Xr driver 9 +.Sh AUTHORS +This manual page was written by +.An Sascha Wildner . From owner-svn-src-stable-9@freebsd.org Thu Oct 8 18:02:52 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B75DB9D1541; Thu, 8 Oct 2015 18:02:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4255081B; Thu, 8 Oct 2015 18:02:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t98I2pCA046627; Thu, 8 Oct 2015 18:02:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t98I2pI9046626; Thu, 8 Oct 2015 18:02:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510081802.t98I2pI9046626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 8 Oct 2015 18:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289048 - stable/9/contrib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 18:02:52 -0000 Author: bdrewery Date: Thu Oct 8 18:02:50 2015 New Revision: 289048 URL: https://svnweb.freebsd.org/changeset/base/289048 Log: MFC r288238: MFV c3ccd112: Correct off-by-ones in free_exception of emergency buffer Modified: stable/9/contrib/libcxxrt/exception.cc Directory Properties: stable/9/contrib/libcxxrt/ (props changed) Modified: stable/9/contrib/libcxxrt/exception.cc ============================================================================== --- stable/9/contrib/libcxxrt/exception.cc Thu Oct 8 18:02:43 2015 (r289047) +++ stable/9/contrib/libcxxrt/exception.cc Thu Oct 8 18:02:50 2015 (r289048) @@ -516,7 +516,7 @@ static void emergency_malloc_free(char * break; } } - assert(buffer > 0 && + assert(buffer >= 0 && "Trying to free something that is not an emergency buffer!"); // emergency_malloc() is expected to return 0-initialized data. We don't // zero the buffer when allocating it, because the static buffers will @@ -556,7 +556,7 @@ static void free_exception(char *e) { // If this allocation is within the address range of the emergency buffer, // don't call free() because it was not allocated with malloc() - if ((e > emergency_buffer) && + if ((e >= emergency_buffer) && (e < (emergency_buffer + sizeof(emergency_buffer)))) { emergency_malloc_free(e); From owner-svn-src-stable-9@freebsd.org Fri Oct 9 19:36:08 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EE7C9D2DBE; Fri, 9 Oct 2015 19:36:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCDF7923; Fri, 9 Oct 2015 19:36:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t99Ja6GD079462; Fri, 9 Oct 2015 19:36:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t99Ja69d079461; Fri, 9 Oct 2015 19:36:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201510091936.t99Ja69d079461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 9 Oct 2015 19:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289078 - in stable: 10/contrib/binutils/opcodes 9/contrib/binutils/opcodes X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 19:36:08 -0000 Author: dim Date: Fri Oct 9 19:36:06 2015 New Revision: 289078 URL: https://svnweb.freebsd.org/changeset/base/289078 Log: MFC r288099: In binutils' arm-dis.c, avoid left-shifting a negative number. Submitted by: dan.mcgregor_usask.ca (Dan McGregor) Differential Revision: https://reviews.freebsd.org/D3376 Modified: stable/9/contrib/binutils/opcodes/arm-dis.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/binutils/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/binutils/opcodes/arm-dis.c Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/binutils/opcodes/arm-dis.c ============================================================================== --- stable/9/contrib/binutils/opcodes/arm-dis.c Fri Oct 9 19:18:02 2015 (r289077) +++ stable/9/contrib/binutils/opcodes/arm-dis.c Fri Oct 9 19:36:06 2015 (r289078) @@ -1767,7 +1767,7 @@ print_insn_coprocessor (bfd_vma pc, stru /* Is ``imm'' a negative number? */ if (imm & 0x40) - imm |= (-1 << 7); + imm |= -(1 << 7); func (stream, "%d", imm); } From owner-svn-src-stable-9@freebsd.org Fri Oct 9 19:38:55 2015 Return-Path: Delivered-To: svn-src-stable-9@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 309039D2FAF; Fri, 9 Oct 2015 19:38:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF0A2C85; Fri, 9 Oct 2015 19:38:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t99Jcsk8079622; Fri, 9 Oct 2015 19:38:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t99JcsCN079621; Fri, 9 Oct 2015 19:38:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201510091938.t99JcsCN079621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 9 Oct 2015 19:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289079 - in stable: 10/lib/libc++ 9/lib/libc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2015 19:38:55 -0000 Author: dim Date: Fri Oct 9 19:38:53 2015 New Revision: 289079 URL: https://svnweb.freebsd.org/changeset/base/289079 Log: MFC r288953: Stop linking libc++.so verbosely, there is no need to. Modified: stable/9/lib/libc++/Makefile Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc++/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc++/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/9/lib/libc++/Makefile ============================================================================== --- stable/9/lib/libc++/Makefile Fri Oct 9 19:36:06 2015 (r289078) +++ stable/9/lib/libc++/Makefile Fri Oct 9 19:38:53 2015 (r289079) @@ -62,7 +62,6 @@ CXXFLAGS+= -std=c++11 DPADD= ${LIBCXXRT} LDADD= -lcxxrt -LDFLAGS+= --verbose INCSGROUPS= STD EXP EXT STD_HEADERS= __bit_reference\