From owner-p4-projects@FreeBSD.ORG Sun Feb 15 13:19:30 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AF4E31065673; Sun, 15 Feb 2009 13:19:30 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EF45106566B; Sun, 15 Feb 2009 13:19:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4B50E8FC22; Sun, 15 Feb 2009 13:19:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CFEFD46B46; Sun, 15 Feb 2009 08:19:29 -0500 (EST) Date: Sun, 15 Feb 2009 13:19:29 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Stacey Son In-Reply-To: <200902122220.n1CMKcaK029439@repoman.freebsd.org> Message-ID: References: <200902122220.n1CMKcaK029439@repoman.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157612 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 13:19:31 -0000 On Thu, 12 Feb 2009, Stacey Son wrote: > http://perforce.freebsd.org/chv.cgi?CH=157612 > > Change 157612 by sson@sson_amd64 on 2009/02/12 22:19:43 > > Rewrite auditd_expire_trails() to use a TAILQ instead of an array > since the assumption that you can stat a directory and look at the > nlinks of the file count doesn't hold for all file systems. > > Also, if the time stamp encoded in the trail file name is valid > use it instead of the mtime of the file. With these changes, expiry of multiple trails at once now appears to work properly for me on FreeBSD using UFS. Robert N M Watson Computer Laboratory University of Cambridge From owner-p4-projects@FreeBSD.ORG Mon Feb 16 10:26:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 91334106567C; Mon, 16 Feb 2009 10:26:58 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EFB41065678 for ; Mon, 16 Feb 2009 10:26:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6C28FC13 for ; Mon, 16 Feb 2009 10:26:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GAQwxl058418 for ; Mon, 16 Feb 2009 10:26:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GAQwWu058416 for perforce@freebsd.org; Mon, 16 Feb 2009 10:26:58 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 16 Feb 2009 10:26:58 GMT Message-Id: <200902161026.n1GAQwWu058416@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157783 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 10:26:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=157783 Change 157783 by hselasky@hselasky_laptop001 on 2009/02/16 10:26:48 libusb20: Make return value compatible with libusb0.12.x in case of a USB transfer timeout. Affected files ... .. //depot/projects/usb/src/lib/libusb20/libusb20_compat01.c#11 edit Differences ... ==== //depot/projects/usb/src/lib/libusb20/libusb20_compat01.c#11 (text+ko) ==== @@ -32,6 +32,7 @@ #include #include +#include #include "libusb20.h" #include "libusb20_desc.h" @@ -617,9 +618,16 @@ libusb20_dev_wait_process((void *)dev, -1); } - if (libusb20_tr_get_status(xfer)) { - /* transfer error */ - return (-1); + switch (libusb20_tr_get_status(xfer)) { + case 0: + /* success */ + break; + case LIBUSB20_TRANSFER_TIMED_OUT: + /* transfer timeout */ + return (-ETIMEDOUT); + default: + /* other transfer error */ + return (-ENXIO); } actlen = libusb20_tr_get_actual_length(xfer); From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:06:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 251FA1065672; Mon, 16 Feb 2009 16:06:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8C0D106566C for ; Mon, 16 Feb 2009 16:06:54 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C80C08FC08 for ; Mon, 16 Feb 2009 16:06:54 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GG6siU054580 for ; Mon, 16 Feb 2009 16:06:54 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GG6sWk054578 for perforce@freebsd.org; Mon, 16 Feb 2009 16:06:54 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:06:54 GMT Message-Id: <200902161606.n1GG6sWk054578@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157794 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:06:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=157794 Change 157794 by andre@andre_flirtbox on 2009/02/16 16:06:03 Do not insert our outgoing interface address when forwarding and the source IP is 0.0.0.0. Affected files ... .. //depot/projects/tcp_new/netinet/ip_output.c#3 edit Differences ... ==== //depot/projects/tcp_new/netinet/ip_output.c#3 (text+ko) ==== @@ -362,13 +362,15 @@ /* * If the source address is not specified yet, use the address - * of the outoing interface. + * of the outoing interface. Packet with an unspecified source + * address may be not be forwarded. */ if (ip->ip_src.s_addr == INADDR_ANY) { - /* Interface may have no addresses. */ - if (ia != NULL) { + /* XXX: Interface may have no addresses. */ + if (ia != NULL && !(flags & IP_FORWARDING)) ip->ip_src = IA_SIN(ia)->sin_addr; - } + else + goto bad; } /* From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:08:58 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71EAD1065670; Mon, 16 Feb 2009 16:08:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ED6A106564A for ; Mon, 16 Feb 2009 16:08:57 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0318E8FC08 for ; Mon, 16 Feb 2009 16:08:57 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GG8uMY054785 for ; Mon, 16 Feb 2009 16:08:56 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GG8ucP054783 for perforce@freebsd.org; Mon, 16 Feb 2009 16:08:56 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:08:56 GMT Message-Id: <200902161608.n1GG8ucP054783@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157795 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:09:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=157795 Change 157795 by andre@andre_flirtbox on 2009/02/16 16:08:10 Update receive window size after a read. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_usrreq.c#3 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_usrreq.c#3 (text+ko) ==== @@ -737,6 +737,11 @@ } tp = intotcpcb(inp); TCPDEBUG1(); + + /* + * Update receive window size after a read. + */ + tp->rcv_wnd = sbspace(&so->so_rcv); tcp_output_rcvd(tp); out: From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:10:59 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 87C391065672; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46834106566B for ; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 35B118FC17 for ; Mon, 16 Feb 2009 16:10:59 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGAxLb055068 for ; Mon, 16 Feb 2009 16:10:59 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGAxmM055066 for perforce@freebsd.org; Mon, 16 Feb 2009 16:10:59 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:10:59 GMT Message-Id: <200902161610.n1GGAxmM055066@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157796 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:11:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=157796 Change 157796 by andre@andre_flirtbox on 2009/02/16 16:10:48 Better ttl and hlim initialization in tcpip_fillheaders. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_subr.c#4 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_subr.c#4 (text+ko) ==== @@ -294,9 +294,8 @@ * of the tcpcb each time to conserve mbufs. */ void -tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, void *tcp_ptr) +tcpip_fillheaders(struct inpcb *inp, void *ip_ptr, struct tcphdr *th) { - struct tcphdr *th = (struct tcphdr *)tcp_ptr; INP_LOCK_ASSERT(inp); @@ -311,6 +310,7 @@ (IPV6_VERSION & IPV6_VERSION_MASK); ip6->ip6_nxt = IPPROTO_TCP; ip6->ip6_plen = sizeof(struct tcphdr); + ip6->ip6_hlim = in6_selecthlim(inp, NULL); ip6->ip6_src = inp->in6p_laddr; ip6->ip6_dst = inp->in6p_faddr; } else @@ -325,7 +325,12 @@ ip->ip_len = 0; ip->ip_id = 0; ip->ip_off = 0; - ip->ip_ttl = inp->inp_ip_ttl; +#ifdef INET6 + if (INP_CHECK_SOCKAF(inp->inp_socket, AF_INET6)) + ip->ip_ttl = in6_selecthlim(inp, NULL); + else +#endif + ip->ip_ttl = inp->inp_ip_ttl; ip->ip_sum = 0; ip->ip_p = IPPROTO_TCP; ip->ip_src = inp->inp_laddr; From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:13:02 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BA7891065670; Mon, 16 Feb 2009 16:13:01 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 762541065677 for ; Mon, 16 Feb 2009 16:13:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 650718FC1C for ; Mon, 16 Feb 2009 16:13:01 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGD1GY055306 for ; Mon, 16 Feb 2009 16:13:01 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGD1SG055304 for perforce@freebsd.org; Mon, 16 Feb 2009 16:13:01 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:13:01 GMT Message-Id: <200902161613.n1GGD1SG055304@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157797 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:13:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=157797 Change 157797 by andre@andre_flirtbox on 2009/02/16 16:12:36 Refine the segment size calculation in the TSO case. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_output.c#3 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_output.c#3 (text+ko) ==== @@ -722,9 +722,11 @@ if (len + optlen + ipoptlen > tp->t_maxopd) { flags &= ~TH_FIN; if (tso) { - if (len > TCP_MAXWIN - hdrlen - optlen) { - len = TCP_MAXWIN - hdrlen - optlen; - len = len - (len % (tp->t_maxopd - optlen)); + int hdrs = max_linkhdr + hdrlen + optlen + ipoptlen; + + if (len > TCP_MAXWIN - hdrs) { + len = TCP_MAXWIN - hdrs; + len -= len % (tp->t_maxopd - optlen); sendalot = 1; } else if (tp->t_flags & TF_NEEDFIN) sendalot = 1; From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:18:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5A1DE1065673; Mon, 16 Feb 2009 16:18:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16B78106564A for ; Mon, 16 Feb 2009 16:18:07 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DF9DD8FC16 for ; Mon, 16 Feb 2009 16:18:06 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGI6nt055864 for ; Mon, 16 Feb 2009 16:18:06 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGI6dK055862 for perforce@freebsd.org; Mon, 16 Feb 2009 16:18:06 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:18:06 GMT Message-Id: <200902161618.n1GGI6dK055862@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157798 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:18:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=157798 Change 157798 by andre@andre_flirtbox on 2009/02/16 16:17:35 Unify mbuf storage size calculation into common m_storagesize. Affected files ... .. //depot/projects/tcp_reass/netinet/tcp_reass.c#23 edit Differences ... ==== //depot/projects/tcp_reass/netinet/tcp_reass.c#23 (text+ko) ==== @@ -339,7 +339,7 @@ if (tcp_reass_spacetime) { tqe->trq_m = m_collapse(tqe->trq_m, M_DONTWAIT, 1024); tp->t_trqmcnt -= tqe->trq_mcnt; - tqe->trq_mcnt = m_storagespace(tqe->trq_m); + tqe->trq_mcnt = m_storagesize(tqe->trq_m); tqe->trq_mcnt += tp->t_trqmcnt; } if (LIST_FIRST(&tp->t_trq_sack) != tqe) { @@ -376,9 +376,7 @@ tcpstat.tcps_rcvpartduppack++; tcpstat.tcps_rcvpartdupbyte += i; /* Update accounting. */ - for (mcnt = 0, n = m; n; n = n->m_next) - mcnt += (n->m_flags & M_EXT) ? - n->m_ext.ext_size + MSIZE : MSIZE; + mcnt = m_storagesize(m); } tqe->trq_len += *tlenp; tqe->trq_mcnt += mcnt; @@ -459,7 +457,7 @@ tcpstat.tcps_rcvpartduppack++; tcpstat.tcps_rcvpartdupbyte += i; /* Update accounting. */ - mcnt = m_storagespace(m); + mcnt = m_storagesize(m); } tqe->trq_len += *tlenp; tqe->trq_mcnt += mcnt; @@ -526,6 +524,10 @@ tcpstat.tcps_reass_blocks++; } tcp_reass_qsize++; + if (tcp_reass_spacetime) { + m = m_collapse(); + mcnt = m_storagesize(m); + } tqen->trq_seq = th_seq; tqen->trq_len = *tlenp; tqen->trq_mcnt = mcnt; @@ -613,9 +615,6 @@ static void tcp_reass_merge(struct tcpcb *tp, struct trq *tqe, struct trq *tqen) { -#if 0 - struct mbuf *m; -#endif int i; KASSERT(tqe != NULL && tqen != NULL, @@ -644,15 +643,11 @@ m_adj(tqen->trq_m, i); tqen->trq_len -= i; tcpstat.tcps_rcvpartdupbyte += i; /* Statistics */ -#if 0 - /* Trim ... */ - while (tqen->trq_m->m_len == 0) { - m = tqen->trq_m; - tqen->trq_m = tqen->trq_m->m_next; - /* mcnt */ - m_free(m); + /* Dispose of empty mbufs. */ + if (tcp_reass_spacetime) { + tqen->trq_m = m_trimhead(tqen->trq_m); + tqen->trq_mcnt = m_storagesize(tqen->trq_m); } -#endif KASSERT(tqen->trq_m != NULL, ("%s: no remaining mbufs in block", __func__)); } From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:31:21 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BD6EE1065673; Mon, 16 Feb 2009 16:31:20 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BBF0106564A for ; Mon, 16 Feb 2009 16:31:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9058FC14 for ; Mon, 16 Feb 2009 16:31:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGVKDB068324 for ; Mon, 16 Feb 2009 16:31:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGVKrQ068322 for perforce@freebsd.org; Mon, 16 Feb 2009 16:31:20 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 16 Feb 2009 16:31:20 GMT Message-Id: <200902161631.n1GGVKrQ068322@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157799 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:31:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=157799 Change 157799 by hselasky@hselasky_laptop001 on 2009/02/16 16:31:00 Compatibility: Be compatible with Linux Version of videodev header files. Affected files ... .. //depot/projects/usb/src/sys/sys/videodev.h#9 edit Differences ... ==== //depot/projects/usb/src/sys/sys/videodev.h#9 (text+ko) ==== @@ -44,7 +44,12 @@ #include #include -#if !defined(__user) +#ifndef V4L2_UNION +/* Default is nameless union */ +#define V4L2_UNION +#endif + +#ifndef __user #define __user #endif @@ -337,7 +342,7 @@ union { /* Frame size */ struct v4l2_frmsize_discrete discrete; struct v4l2_frmsize_stepwise stepwise; - } u; + } V4L2_UNION; uint32_t reserved[2]; /* Reserved space for future use */ }; @@ -368,7 +373,7 @@ union { /* Frame interval */ struct v4l2_fract discrete; struct v4l2_frmival_stepwise stepwise; - } u; + } V4L2_UNION; uint32_t reserved[2]; /* Reserved space for future use */ }; @@ -694,7 +699,7 @@ int32_t value; int64_t value64; void *reserved; - } u; + } V4L2_UNION; } __packed; struct v4l2_ext_controls { @@ -1129,7 +1134,7 @@ struct { uint32_t data[8]; } raw; - } u; + } V4L2_UNION; }; #endif From owner-p4-projects@FreeBSD.ORG Mon Feb 16 16:53:44 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A6D4F1065677; Mon, 16 Feb 2009 16:53:43 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49EBD1065670 for ; Mon, 16 Feb 2009 16:53:43 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 32B9F8FC1B for ; Mon, 16 Feb 2009 16:53:43 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GGrhPA085563 for ; Mon, 16 Feb 2009 16:53:43 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GGrhNM085561 for perforce@freebsd.org; Mon, 16 Feb 2009 16:53:43 GMT (envelope-from andre@freebsd.org) Date: Mon, 16 Feb 2009 16:53:43 GMT Message-Id: <200902161653.n1GGrhNM085561@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 157800 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 16:53:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=157800 Change 157800 by andre@andre_flirtbox on 2009/02/16 16:53:08 Checkpoint WIP. Affected files ... .. //depot/projects/tcp_new/netinet/tcp_input.c#7 edit .. //depot/projects/tcp_new/netinet/tcp_output.c#4 edit .. //depot/projects/tcp_new/netinet/tcp_var.h#3 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp_input.c#7 (text+ko) ==== @@ -179,20 +179,6 @@ #endif /* - * Indicate whether this ack should be delayed. We can delay the ack if - * - there is no delayed ack timer in progress and - * - our last ack wasn't a 0-sized window. We never want to delay - * the ack that opens up a 0-sized window and - * - delayed acks are enabled or - * - this is a half-synchronized T/TCP connection. - */ -#define DELAY_ACK(tp) \ - ((!tcp_timer_active(tp, TT_DELACK) && \ - (tp->t_flags & TF_RXWIN0SENT) == 0) && \ - (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) - - -/* * TCP input handling is split into multiple parts: * tcp6_input is a thin wrapper around tcp_input for the extended * ip6_protox[] call format in ip6_input @@ -362,7 +348,7 @@ tcpstat.tcps_rcvbadoff++; goto drop; } - tlen -= off; /* tlen is used instead of ti->ti_len */ + tlen -= off; /* tlen is used instead of th->th_len */ if (off > sizeof (struct tcphdr)) { if (isipv6) { #ifdef INET6 @@ -932,9 +918,10 @@ * discouraged to shrink the window. * RFC793: section 3.7, page 42-44 * RFC1122: section 4.2.2.16 + * + * XXXAO: Fix up. rcv_wnd is an absolute pointer in seq space. */ - rwin = sbspace(&so->so_rcv); - rwin = imax(rwin, (int)(tp->rcv_advwin - tp->rcv_nxt)); + rwin = tp->rcv_wnd - tp->rcv_nxt; /* * Validation checks on any incoming segment. @@ -947,7 +934,7 @@ * into established state and initializations of the timers. */ case TCPS_SYN_RECEIVED: - tp->t_starttime = tcp_uptime(); + tp->t_starttime = time_uptime; TCPS_TRANS(tp, TCPS_ESTABLISHED); soisconnected(so); @@ -963,7 +950,7 @@ */ case TCPS_SYN_SENT: /* - * RST is handled separately below. + * RST is handled separatetly below. * RFC793: section 3.9, page 66-67, second check */ if (thflags & TH_RST) @@ -1029,11 +1016,14 @@ * RFC793: section 3.1, page 18-19 * RFC1122: section 4.2.2.6 * RFC1191: section 3.1 + * + * NB: MSS is computed twice. Once when we send the inital + * SYN and once when get back the SYN-ACK. */ if (to.to_flags & TOF_MSS) - tcp_mss(tp, to.to_mss); + tp->snd_mss = tcp_mss(tptoinpinc(tp), to.to_mss, 0); else - tcp_mss(tp, tcp_mssdflt); + tp->snd_mss = tcp_mss(tptoinpinc(tp), 0, 0); /* * Do window scaling on this connection? @@ -1129,7 +1119,7 @@ tp->snd_wu_ack = th->th_ack; th->th_seq++; /* SYN is acked */ - tp->t_starttime = tcp_uptime(); + tp->t_starttime = time_uptime; TCPS_TRANS(tp, TCPS_ESTABLISHED); #ifdef MAC SOCK_LOCK(so); @@ -1218,7 +1208,7 @@ * * We store the receive time as uptime with second * resolution. This makes us independent from the - * wrap-around after 2^32 / hz (24.8 days at 1ms hz). + * wrap-around after 2^32 / 2 / hz (24.8 days at 1ms hz). * * XXXAO: Linux says PAWS is broken. Analyze if true or not. * Retransmitted segments are not presented for further processing. @@ -1425,6 +1415,7 @@ case TCPS_SYN_SENT: /* * In TCPS_SYN_SENT the RST MUST carry the ACK flag. + * RFC793: section 3.4, page 37, Reset Processing * RFC793: section 3.9, page 66, first check */ if (!(thflags & TH_ACK)) { @@ -1434,12 +1425,17 @@ } /* - * The ACK must be within what we sent but does - * not have to ACK the SYN. + * The ACK must acknowledge the SYN and any data + * we may have sent with the original SYN. + * RFC793: section 3.4, page 37, Reset Processing * RFC793: section 3.9, page 66, first check + * + * NB: We accept ACKing the SYN w/o and with data + * as some implementations refuse to ACK data in + * a SYN. */ - if (SEQ_LT(th->th_ack, tp->snd_una) || - SEQ_GT(th->th_ack, th->snd_nxt)) { + if (th->th_ack != tp->snd_una || + th->th_ack != th->snd_nxt) { tcplog("RST does not match, segment ignored"); tcpstat.tcps_badrst++; goto drop; @@ -1735,6 +1731,8 @@ /* * Update send SACK information and tell us how much more * data has left the network (relative to last SACK we got). + * XXXAO: Determine if there was a duplicate ACK going on + * based on the changes of the SACK information. */ if ((to.to_flags & TOF_SACK) || !TAILQ_EMPTY(&tp->snd_holes)) sacked = tcp_sack_doack(tp, &to, th->th_ack); @@ -1759,7 +1757,7 @@ /* * Update congestion control information. */ - nudgeoutput = tcp_congest(tp, th, tiwin, acked, tlen, sacked); + nudgeoutput |= tcp_congest(tp, th, tiwin, acked, tlen, sacked); /* * Drop acknowledged data from send socket buffer @@ -1783,12 +1781,10 @@ * data from the socket buffer. */ if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { sbdrop_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; ourfinisacked = 0; } @@ -1896,6 +1892,19 @@ * NB: Continue with segment. */ } + + /* + * Stop the retransmit timer if all data we sent + * has been acknowledged. Otherwise restart it + * if we still have outstanding data. + * + * XXXAO: Refine the test. The TF_NEEDFIN may not + * enough. + */ + if (tp->snd_una == tp->snd_nxt && !(tp->t_flags & TF_NEEDFIN)) + tcp_timer_activate(TT_RXMIT, 0); + else + tcp_timer_activate(TT_RXMIT, tp->snd_rto); } /* @@ -1918,7 +1927,7 @@ */ if ((thflags & TH_URG) && th->th_urp > 0 && tlen > 0 && !TCPS_HAVERCVDFIN(tp->t_state)) { - tcp_do_urg(tp, th, tlen); + tcp_do_urg(tp, th, &tlen); } else if (SEQ_GT(tp->rcv_nxt, tp->rcv_up)) { tp->rcv_up = tp->rcv_nxt; } @@ -2090,6 +2099,11 @@ } /* + * Update size of receive window. + */ + tp->rcv_wnd = sbspace(so->so_rcv); + + /* * NB: sorwakeup_locked implicitly unlocks. */ sorwakeup_locked(so); @@ -2249,12 +2263,15 @@ * * XXXAO: Multi-delack? */ - if (nudgeoutput || (tp->t_flags & TF_ACKNOW)) + if ((tp->t_flags & TF_ACKNOW) || tp->snd_delack > 1 || + nudgeoutput || (tp->t_flags & TF_RXWIN0SENT) || + !tcp_delack_enabled) { (void) tcp_output(tp); - else if (tp->t_flags & TF_DELACK) { - tp->t_flags &= ~TF_DELACK; + } else if (SEQ_GT(tp->rcv_nxt, tp->snd_lastack)) { + tp->snd_delack++; tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); } + INP_UNLOCK(tp->t_inpcb); return; @@ -2374,7 +2391,7 @@ * XXXAO: Report violations of the options specs. */ static void -tcp_dooptions(struct tcpopt *to, u_char *cp, int cnt, int flags) +tcp_do_options(struct tcpopt *to, u_char *cp, int cnt, int flags) { int opt, optlen; @@ -2471,68 +2488,106 @@ * Finish this function and validate against all relevant RFCs. * Use bintime second part for t_rcvtime. * And a couple of other things. - * - * XXXAO: Linux talks about some problem with the RTO algorithm. - * Figure out what the problem is. - * - * XXXAO: The sliding window of eight measurements from RFC793 is - * way too little when using timestamps in fast networks. - * Average 10ms of measurements and integrate that into a 1000ms - * sliding window. The same for the variance. When using timestamps. */ static void tcp_do_time(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, int acked, int tlen, int sacked) { - int delta, rtt; + int rtt; int tick = tcp_ticks; + INP_LOCK_ASSERT(tp->t_inpcb); KASSERT(tp != NULL && th != NULL && to != NULL, - ("%s: ", __func__)); - INP_LOCK_ASSERT(tp->t_inpcb); + ("%s: insufficient parameters", __func__)); /* + * 1. We received a valid segment. + * * Make note of most recent segment received time. */ - tp->t_rcvtime = tcp_ticks; /* XXX: ticks64 */ + tp->t_rcvtime = tcp_uptime(); + tp->t_rcvticks = tick; /* + * 2. If timestamps are used decide which to reflect. + * * When using timestamps and delayed ACKs we should reply * with the TSval from the earliest unacknowledged segment. - * RFC1323: Section 3.4, Page 15, Case (A) + * RFC1323: section 3.4, Page 15, Case (A) * * On packet loss echo the TSval from the latest segment * that filled a hole. Only reflect timestamps that advance * the left edge of the window. - * RFC1323: Section 3.4, Page 15, Case (B & C) + * RFC1323: section 3.4, Page 15, Case (B & C) + * + * Corrected algorithm. + * Stevens Vol.2: section 26.6, page 870 + * Braden93 + * + * If SACK is enabled we should be able to reflect every + * timestamp as long as it GEQ than the one before. This + * way we avoid late out-of-order segments. Whenever more + * data was sacked advance reflected timestamp. * - * XXXAO: With SACK we could do better. - * if (sacked > 0) ... + * Does this give PAWS problems? */ if (to->to_flags & TOF_TS) { - if ((!(tp->t_flags & TF_DELACK) && th->th_seq == tp->rcv_nxt) || - (!TAILQ_EMPTY(tp->rcv_trq) && th->th_seq == tp->rcv_nxt)) +#ifdef TCP_RFC1323_BRADEN + if (TS_GEQ(to->to_tsval, tp->snd_tsecr) && + SEQ_LEQ(th->th_ack, tp->snd_lastack)) { +#endif +#ifdef TCP_RFC1323bis_plusSACK + if (TS_GT(to->to_tsval, tp->snd_tsecr) && + ((th->th_seq == tp->rcv_nxt && tp->snd_delack == 0) || + sacked > 0) { +#endif tp->snd_tsecr = to->to_tsval; - tp->snd_tsecrts = tcp_ticks; /* XXX: ticks64 */ + tp->snd_tsecrts = tcp_ticks; + } + KASSERT(!TS_GT(to->to_secr, tick), + ("%s: timestamp newer than our time", __func__)); /* * Remember highest most recent reflected TS. */ - if (to->to_tsecr > tp->ts_recent) + if (SEQ_LEQ(th->th_seq, tp->snd_lastack) && + TS_GT(to->to_tsecr > tp->ts_recent)) tp->ts_recent = to->to_tsecr; + tp->ts_recentts = tick; } /* + * 3. If timestamps are used calculate the current RTT. + */ + if (to->to_flags & TOF_TS) { + rtt = tick - to->to_tsecr; + } else if (acked > 0 && tp->snd_rtseq != 0 && + SEQ_GT(th->th_ack, tp->snd_rtseq) && + TAILQ_EMPTY(tp->rcv_trq) && tp->snd_rtoshift == 0) { + rtt = tick - tp->snd_rtts; + tp->snd_rtseq = 0; + } else + return; + + /* + * 4. If no timestamps are used see whether new data was ack'ed + * and if so, calculate the current RTT. + * * We can only measure the RTT if new data was acknowledged. * That means we can only update the RTT estimates when we * are sending data. * * XXXAO: Not really true with timestamps and a steady receive * stream. + * + * Karns algorithm. Only update on non-retransmitted segments. + * Compute the time delta in ticks (1/hz). + * + * XXXAO: How to deal with retransmits when using timestamps? */ - if (acked == 0) - return; /* + * 5. Update at all? + * * If we haven't sent anything for more than one RTO ignore * the time measurement or our estimate will be way off. */ @@ -2543,35 +2598,85 @@ } /* - * Karns algorithm. Only update on non-retransmitted segments. + * Remember the lowest RTT we've ever seen. + * Must be at least 1 tick. + */ + if (tp->t_rttlowest > rtt) + tp->t_rttlowest = max(rtt, 1); + + /* + * Recompute the SRTT, RTTVAR and RTO. * - * XXXAO: How to deal with retransmits when using timestamps? + * XXXAO: Make it pluggable so that different algorithms + * can be tested. */ + tp->snd_rto = tcp_do_rto(tp, rtt); /* - * Compute the time delta in ticks (1/hz). + * We received an ack for a packet that wasn't retransmitted; + * it is probably safe to discard any error indications we've + * received recently. This isn't quite right, but close enough + * for now (a route might have failed after we sent a segment, + * and the return path might not be symmetrical). + * XXXAO: Doesn't belong here. */ - if (to->to_flags & TOF_TS) { - rtt = tick - to->to_tsecr; - } else if (tp->t_rtseq != 0 && SEQ_GT(th->th_ack, tp->t_rtseq) && - TAILQ_EMPTY(tp->rcv_trq) && tp->snd_rtoshift == 0) { - rtt = tick - tp->t_rtseq; - tp->t_rtseq = 0; - } else - return; + tp->t_softerror = 0; /* - * Limit delta to some reasonable amount. + * Statistics. */ - rtt = min(60*hz, max(1, rtt)); + tp->t_rttupdated++; + tcpstat.tcps_rttupdated++; + + return; +} + +/* + * Compute the SRTT, RTTVAR and return the updated RTO. + * RFC1122: section 4.2.3.1 + * RFC2988: entire document + * + * External parameters that affect the RTO calculation: + * minimum RTO value (fixed sysctl) + * maximum RTO value (fixed sysctl) + * initial RTO value (fixed sysctl) + * + * XXXAO: Linux talks about some problem with the RTO algorithm. + * Figure out what the problem is. + * + * XXXAO: The sliding window of eight measurements from RFC793 is + * way too little when using timestamps in fast networks. + * Average 10ms of measurements and integrate that into a 1000ms + * sliding window. The same for the variance. When using timestamps. + * Or integrate over one RTO. + * + * XXXAO: We should use rttlowest as base and all deviations from it + * count as RTT variance. Use a squared algorithm to bias it to the + * upper level. Trying to calculate the actual RTT is futile and + * very volatile. rttlowest is a very good and fairly stable statistic + * baseline. One can't get better than speed of light in optical media. + * Everything faster than one tick doesn't concern us anyway. Having + * stable baseline simplifies and improves a number of statistical + * calculations and assumptions. Some magic has to be applied when + * a better lower baseline is measured though. + */ +static int +tcp_do_rto(struct tcpcb *tp, int rtt) +{ + int delta, rto; + INP_LOCK_ASSERT(tp->t_inpcb); + KASSERT(tp != NULL, + ("%s: insufficient parameters", __func__)); + /* - * Remember the lowest RTT we've ever seen. + * Limit delta to some reasonable amount. */ - if (tp->t_rttlowest > rtt) - tp->rttlowest = rtt; + rtt = min(60 * hz, max(1, rtt)); /* + * 6. Integrate new measurement. + * * Compute smoothed RTT and smoothed RTT variance. */ if (tp->t_srtt) { @@ -2595,7 +2700,7 @@ * rttvar is stored as fixed point with 4 bits after the * binary point (scaled by 16). The following is * equivalent to rfc793 smoothing with an alpha of .75 - * (rttvar = rttvar*3/4 + |delta| / 4). This replaces + * (rttvar = rttvar * 3/4 + |delta| / 4). This replaces * rfc793's wired-in beta. */ if (delta < 0) @@ -2616,29 +2721,17 @@ tp->t_rxtshift = 0; /* + * 7. Recompute RTO timer. + * * The retransmit should happen at rtt + 4 * rttvar. * XXX: Backoff. * RFC2988, Section 2, Page 2-3, Cases 2.1 through 2.5 */ - tp->snd_rto = max(((tp->t_srtt >> TCP_RTT_SHIFT) + - max(4 * (tp->t_rttvar >> TCP_RTTVAR_SHIFT), TCPTV_REXMTMAX)), - tcp_rexmit_min); + rto = max(((tp->t_srtt >> TCP_RTT_SHIFT) + + max(4 * (tp->t_rttvar >> TCP_RTTVAR_SHIFT), TCPTV_REXMTMAX)), + tcp_rexmit_min); - /* - * We received an ack for a packet that wasn't retransmitted; - * it is probably safe to discard any error indications we've - * received recently. This isn't quite right, but close enough - * for now (a route might have failed after we sent a segment, - * and the return path might not be symmetrical). - * XXX: Doesn't belong here. - */ - tp->t_softerror = 0; - - /* - * Statistics. - */ - tp->t_rttupdated++; - tcpstat.tcps_rttupdated++; + return (rto); } /* @@ -2757,7 +2850,7 @@ */ int tcp_do_wu(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, - int tiwin, in acked, int tlen, int sacked) + int tiwin, int acked, int tlen, int sacked) { KASSERT(tp != NULL && th != NULL, @@ -2810,14 +2903,14 @@ * RFC793: section 3.7, page 42-44, "Managing the Window" * RFC1122: section 4.2.2.16 */ - if (SEQ_DELTA(tp->snd_nxt, tp->snd_una) + tiwin < tp->snd_wnd) + if (SEQ_DELTA(tp->snd_nxt, tp->snd_una + acked) + tiwin < tp->snd_wnd) tcplog("peer shrank the window"); /* * Update the window and keep track of this update. */ tp->snd_wnd = tiwin; - if (th->th_seq > tp->snd_wu_seq) + if (SEQ_GT(th->th_seq, tp->snd_wu_seq)) tp->snd_wu_seq = th->th_seq; if (tp->snd_wnd > tp->snd_maxwnd) tp->snd_maxwnd = tp->snd_wnd; @@ -2936,61 +3029,63 @@ } /* - * Determine a reasonable value for maxseg size. - * If the route is known, check route for mtu. - * If none, use an mss that can be handled on the outgoing - * interface without forcing IP to fragment. + * Determine a reasonable value for MSS size. If the route is known, + * check route for mtu. If none, use an MSS that can be handled on + * the outgoing interface without forcing IP to fragment. * If no route is found, route has no mtu, or the destination * isn't local, use a default, hopefully conservative size (usually * 512 or the default IP max size, but no more than the mtu of the * interface), as we can't discover anything about intervening * gateways or networks. - * We also initialize the congestion/slow start window to be a single - * segment if the destination isn't local. - * While looking at the routing entry, we also initialize other - * path-dependent parameters from pre-set or cached values in the - * routing entry. + * RFC793: section x * - * Also take into account the space needed for options that we - * send regularly. Make maxseg shorter by that amount to assure - * that we can send maxseg amount of data even when the options - * are present. Store the upper limit of the length of options plus - * data in maxopd. XXX: No longer needed. - * - * NOTE that this routine is only called when we process an incoming - * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). - * - * XXXAO: - * Split up and simplify this function. - * Move initialization of cached values into its own function. + * NB: If no offer received pass as zero. */ -void -tcp_mss(struct tcpcb *tp, int offer) +uint16_t +tcp_mss(struct in_conninfo *inc, int offer, int mtuflags) { - struct inpcb *inp = tp->t_inpcb; - struct socket *so = inp->inp_socket; - u_long bufsize; - u_long maxmtu; - int rtt, mss; - int origoffer = offer; - int mtuflags = 0; + uint16_t mss = 0; + uint32_t maxmtu = 0; + uint32_t thcmtu = 0; + int min_protoh; +#ifdef INET6 + int isipv6 = inc->inc_isipv6 ? 1 : 0; +#endif + + KASSERT(inc != NULL, + ("%s: NULL in_conninfo pointer", __func__)); + #ifdef INET6 - int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; + if (isipv6) { + mss = tcp_v6mssdflt; + maxmtu = tcp_maxmtu6(inc, mtuflags); + min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + } else #endif - struct hc_metrics_lite metrics; + { + mss = tcp_mssdflt; + maxmtu = tcp_maxmtu(inc, mtuflags); + min_protoh = sizeof(struct tcpiphdr); + } + thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ /* - * Initialize. - * If there is no route to sender, - * we stay with the default mss. + * Determine MTU. */ - mss = tcp_mssopt(tcpcbtoinc(tp), &mtuflags); + if (maxmtu && thcmtu) + mss = min(maxmtu, thcmtu) - min_protoh; + else if (maxmtu || thcmtu) + mss = max(maxmtu, thcmtu) - min_protoh; + + if (offer == 0) + return (mss); /* * Prevent DoS attack with too small MSS. Round up * to at least minmss. */ offer = max(offer, tcp_minmss); + /* * Sanity check: make sure that maxopd will be large * enough to allow some data on segments even if the @@ -3000,14 +3095,61 @@ offer = max(offer, 64); /* - * maxopd stores the maximum length of data AND options - * in a segment; maxseg is the amount of data in a normal - * segment. We need to store this value (maxopd) apart - * from maxseg, because now every segment carries options - * and thus we normally have somewhat less data in segments. + * Use a symmetric MSS. It is very unlikely that we + * have a different MSS in on the way back. + * + * XXXAO: More comment */ - tp->snd_mss = mss = min(mss, offer); - tp->t_maxopd = mss; + mss = min(mss, offer); + + return (mss); +} + +/* + * Return the initial send window for a new connection or + * after an idle timeout. + * RFC3390: entire document + * + * min(4*MSS, max(2*MSS, 4380 bytes)) + * + * NB: MSS must already be initialized. + */ +int +tcp_init_cwnd(struct tcpcb *tp) +{ + int cwnd; + + if (tcp_do_rfc3390) + cwnd = min(4 * tp->snd_mss, max(2 * tp->snd_mss, 4380)); +#ifdef INET6 + else if (isipv6 && in6_localaddr(&inp->in6p_faddr)) + cwnd = tp->snd_mss * ss_fltsz_local; +#endif + else if (in_localaddr(inp->inp_faddr)) + cwnd = tp->snd_mss * ss_fltsz_local; + else + cwnd = tp->snd_mss * ss_fltsz; + + return (cwnd); +} + +/* + * Prime some TCP variables from cached values. + */ +static void +tcp_init_values(struct tcpcb *tp) +{ + struct inpcb *inp = tp->t_inpcb; + struct socket *so = inp->inp_socket; + u_long bufsize; + u_long maxmtu; + int rtt, mss; + int origoffer = offer; + int mtuflags = 0; +#ifdef INET6 + int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; +#endif + struct hc_metrics_lite metrics; /* * rmx information is now retrieved from tcp_hostcache. @@ -3038,17 +3180,6 @@ min(tp->snd_wnd, so->so_snd.sb_hiwat))); else #endif - if (tcp_do_rfc3390) - tp->snd_cwnd = min(4 * mss, max(2 * mss, 4380)); -#ifdef INET6 - else if ((isipv6 && in6_localaddr(&inp->in6p_faddr)) || - (!isipv6 && in_localaddr(inp->inp_faddr))) -#else - else if (in_localaddr(inp->inp_faddr)) -#endif - tp->snd_cwnd = mss * ss_fltsz_local; - else - tp->snd_cwnd = mss * ss_fltsz; /* * If there's a pipesize, change the socket buffer to that size, @@ -3125,40 +3256,3 @@ tp->t_flags |= TF_TSO; } - -/* - * Determine the MSS option to send on an outgoing SYN. - */ -int -tcp_mssopt(struct in_conninfo *inc, int mtuflags) -{ - int mss = 0; - u_long maxmtu = 0; - u_long thcmtu = 0; - size_t min_protoh; -#ifdef INET6 - int isipv6 = inc->inc_isipv6 ? 1 : 0; -#endif - - KASSERT(inc != NULL, ("%s: NULL in_conninfo pointer", __func__)); - -#ifdef INET6 - if (isipv6) { - mss = tcp_v6mssdflt; - maxmtu = tcp_maxmtu6(inc, mtuflags); - min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); - } else -#endif - { - mss = tcp_mssdflt; - maxmtu = tcp_maxmtu(inc, mtuflags); - min_protoh = sizeof(struct tcpiphdr); - } - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ - if (maxmtu && thcmtu) - mss = min(maxmtu, thcmtu) - min_protoh; - else if (maxmtu || thcmtu) - mss = max(maxmtu, thcmtu) - min_protoh; - - return (mss); -} ==== //depot/projects/tcp_new/netinet/tcp_output.c#4 (text+ko) ==== @@ -27,11 +27,9 @@ * SUCH DAMAGE. * * @(#)tcp_output.c 8.4 (Berkeley) 5/24/95 + * $FreeBSD: src/sys/netinet/tcp_output.c,v 1.139 2007/07/01 11:38:27 gnn Exp $ */ -#include -__FBSDID("$FreeBSD: src/sys/netinet/tcp_output.c,v 1.145 2007/11/30 23:46:51 bz Exp $"); - #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" @@ -74,85 +72,82 @@ #include #endif -#ifdef IPSEC +#ifdef FAST_IPSEC #include -#endif /*IPSEC*/ +#endif /*FAST_IPSEC*/ #include #include -#ifdef notyet -extern struct mbuf *m_copypack(); -#endif - -int path_mtu_discovery = 1; +int tcp_do_pmtud = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery, CTLFLAG_RW, - &path_mtu_discovery, 1, "Enable Path MTU Discovery"); - -int ss_fltsz = 1; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, - &ss_fltsz, 1, "Slow start flight size"); + &tcp_do_pmtud, 1, "Enable Path MTU Discovery"); -int ss_fltsz_local = 4; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW, - &ss_fltsz_local, 1, "Slow start flight size for local networks"); - -int tcp_do_newreno = 1; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, newreno, CTLFLAG_RW, - &tcp_do_newreno, 0, "Enable NewReno Algorithms"); - int tcp_do_tso = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_RW, - &tcp_do_tso, 0, "Enable TCP Segmentation Offload"); + &tcp_do_tso, 0, "Enable TCP Segmentation Offload"); int tcp_do_autosndbuf = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, - &tcp_do_autosndbuf, 0, "Enable automatic send buffer sizing"); + &tcp_do_autosndbuf, 0, "Enable automatic send buffer sizing"); int tcp_autosndbuf_inc = 8*1024; SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_RW, - &tcp_autosndbuf_inc, 0, "Incrementor step size of automatic send buffer"); + &tcp_autosndbuf_inc, 0, "Incrementor step size of automatic send buffer"); int tcp_autosndbuf_max = 256*1024; SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, - &tcp_autosndbuf_max, 0, "Max size of automatic send buffer"); + &tcp_autosndbuf_max, 0, "Max size of automatic send buffer"); - /* * Tcp output routine: figure out what should be sent and send it. + * + * 1. How much to send, if any + * 1.1 subject to nagles algorithm (don't send small segments) + * 1.2 subject to send window + * 1.3 subject to congestion window + * 2. Send window probe (persist mode) + * 3. Send an outstanding ACK + * 3.1 subject to delayed ack + * 4. Send a window update + * 4.1 subject to silly window avoidance + * 4.2 subject to delayed ack + * 5. Send retransmit + * 6. Send urgent data + * 7. Send based on flags */ int tcp_output(struct tcpcb *tp) { - struct socket *so = tp->t_inpcb->inp_socket; - long len, recwin, sendwin; - int off, flags, error; - struct mbuf *m; - struct ip *ip = NULL; - struct ipovly *ipov = NULL; - struct tcphdr *th; + int off, flags, error, optlen; + tcp_win len, recwin, swin; + struct inpcb *inp = tp->t_inpcb; + struct socket *so = inp->inp_socket; + struct tcphdr ths; + struct tcpopt to; u_char opt[TCP_MAXOLEN]; - unsigned ipoptlen, optlen, hdrlen; -#ifdef IPSEC - unsigned ipsec_optlen = 0; +#ifdef TCP_SIGNATURE + int sigoff = 0; #endif - int idle, sendalot; - int sack_rxmit, sack_bytes_rxmt; - struct sackhole *p; - int tso = 0; - struct tcpopt to; -#if 0 - int maxburst = TCP_MAXBURST; -#endif -#ifdef INET6 - struct ip6_hdr *ip6 = NULL; - int isipv6; + INP_LOCK_ASSERT(tp->t_inpcb); + KASSERT(tp->t_state > TCPS_LISTEN, + ("%s: TCPS_LISTEN invalid", __func__)); + KASSERT(tp->t_state != TCPS_SYN_RECEIVED, + ("%s: TCPS_SYN_RECEIVED invalid", __func__)); + KASSERT(tp->t_state < TCPS_TIME_WAIT, + ("%s: TCPS_TIME_WAIT invalid", __func__)); - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; -#endif + KASSERT(SEQ_GEQ(tp->snd_rxmit, tp->snd_una), + ("%s: snd_rxmit < snd_una", __func__)) + KASSERT(SEQ_LEQ(tp->snd_rxmit, tp->snd_nxt), + ("%s: snd_rxmit > snd_nxt", __func__)) - INP_LOCK_ASSERT(tp->t_inpcb); + /* + * Get standard flags. Removal of inappropriate flags for a + * specific segment is handled by the segmentation code. + */ + flags = tcp_outflags[tp->t_state]; /* * Determine length of data that should be transmitted, @@ -160,792 +155,610 @@ * If there is some data or critical controls (SYN, RST) * to send, then transmit; otherwise, investigate further. */ - idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { - /* - * We have been idle for "a while" and no acks are - * expected to clock out any data we send -- - * slow start to get ack "clock" running again. - * - * Set the slow-start flight size depending on whether - * this is a local network or not. - */ - int ss = ss_fltsz; -#ifdef INET6 - if (isipv6) { - if (in6_localaddr(&tp->t_inpcb->in6p_faddr)) - ss = ss_fltsz_local; - } else -#endif /* INET6 */ - if (in_localaddr(tp->t_inpcb->inp_faddr)) - ss = ss_fltsz_local; - tp->snd_cwnd = tp->t_maxseg * ss; - } - tp->t_flags &= ~TF_LASTIDLE; - if (idle) { - if (tp->t_flags & TF_MORETOCOME) { - tp->t_flags |= TF_LASTIDLE; - idle = 0; - } - } -again: - /* - * If we've recently taken a timeout, snd_max will be greater than - * snd_nxt. There may be SACK information that allows us to avoid - * resending already delivered data. Adjust snd_nxt accordingly. - */ - if ((tp->t_flags & TF_SACK_PERMIT) && - SEQ_LT(tp->snd_nxt, tp->snd_max)) - tcp_sack_adjust(tp); - sendalot = 0; - off = tp->snd_nxt - tp->snd_una; - sendwin = min(tp->snd_wnd, tp->snd_cwnd); + + - flags = tcp_outflags[tp->t_state]; /* - * Send any SACK-generated retransmissions. If we're explicitly trying - * to send out new data (when sendalot is 1), bypass this function. - * If we retransmit in fast recovery mode, decrement snd_cwnd, since - * we're replacing a (future) new transmission with a retransmission - * now, and we previously incremented snd_cwnd in tcp_input(). + * We have been idle for "a while" and no acks are + * expected to clock out any data we send -- + * slow start to get ack "clock" running again. + * + * Set the slow-start flight size depending on whether + * this is a local network or not. */ - /* - * Still in sack recovery , reset rxmit flag to zero. - */ - sack_rxmit = 0; - sack_bytes_rxmt = 0; - len = 0; - p = NULL; - if ((tp->t_flags & TF_SACK_PERMIT) && IN_FASTRECOVERY(tp) && - (p = tcp_sack_output(tp, &sack_bytes_rxmt))) { - long cwin; - - cwin = min(tp->snd_wnd, tp->snd_cwnd) - sack_bytes_rxmt; - if (cwin < 0) - cwin = 0; - /* Do not retransmit SACK segments beyond snd_recover */ - if (SEQ_GT(p->end, tp->snd_recover)) { - /* - * (At least) part of sack hole extends beyond - * snd_recover. Check to see if we can rexmit data - * for this hole. - */ >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 16 20:42:46 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B816E1065680; Mon, 16 Feb 2009 20:42:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAA5106564A for ; Mon, 16 Feb 2009 20:42:45 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5905D8FC08 for ; Mon, 16 Feb 2009 20:42:45 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GKgjbg007185 for ; Mon, 16 Feb 2009 20:42:45 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GKgjCX007183 for perforce@freebsd.org; Mon, 16 Feb 2009 20:42:45 GMT (envelope-from rene@FreeBSD.org) Date: Mon, 16 Feb 2009 20:42:45 GMT Message-Id: <200902162042.n1GKgjCX007183@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Cc: Subject: PERFORCE change 157813 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 20:42:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=157813 Change 157813 by rene@rene_self on 2009/02/16 20:41:44 IFC Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#15 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/hubs/article.sgml#3 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/developers-handbook/x86/chapter.sgml#2 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/faq/book.sgml#16 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/boot/chapter.sgml#6 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/l10n/chapter.sgml#5 integrate .. //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#22 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/cutting-edge/chapter.sgml#21 integrate .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/ppp-and-slip/chapter.sgml#19 integrate .. //depot/projects/docproj_nl/share/pgpkeys/maho.key#2 integrate .. //depot/projects/docproj_nl/share/pgpkeys/marck.key#2 integrate .. //depot/projects/docproj_nl/share/pgpkeys/miwi.key#2 integrate .. //depot/projects/docproj_nl/www/en/cgi/cgi-style.pl#3 integrate .. //depot/projects/docproj_nl/www/en/community/mailinglists.sgml#2 integrate .. //depot/projects/docproj_nl/www/en/docproj/translations.sgml#4 integrate .. //depot/projects/docproj_nl/www/en/donations/donors.sgml#13 integrate .. //depot/projects/docproj_nl/www/en/news/2008/Makefile#1 branch .. //depot/projects/docproj_nl/www/en/news/2008/news.xml#1 branch .. //depot/projects/docproj_nl/www/en/news/2008/press.xml#1 branch .. //depot/projects/docproj_nl/www/en/news/Makefile#3 integrate .. //depot/projects/docproj_nl/www/en/news/status/report-2008-10-2008-12.xml#2 integrate .. //depot/projects/docproj_nl/www/en/releases/index.sgml#6 integrate .. //depot/projects/docproj_nl/www/en/releng/index.sgml#13 integrate .. //depot/projects/docproj_nl/www/share/sgml/libcommon.xsl#5 integrate .. //depot/projects/docproj_nl/www/share/sgml/news.xml#28 integrate .. //depot/projects/docproj_nl/www/share/sgml/press.xml#8 integrate .. //depot/projects/docproj_nl/www/share/sgml/templates.oldnewsflash.xsl#3 integrate .. //depot/projects/docproj_nl/www/share/sgml/templates.oldpress.xsl#3 integrate Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/contributors/contrib.additional.sgml#15 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -892,7 +892,7 @@ If your system is not FreeBSD, you need to get nasm from its -home +home page. You can still use it to assemble FreeBSD code. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/faq/book.sgml#16 (text+ko) ==== @@ -12,7 +12,7 @@ The &os; Documentation Project - $FreeBSD: doc/en_US.ISO8859-1/books/faq/book.sgml,v 1.1108 2009/01/28 08:48:21 keramida Exp $ + $FreeBSD: doc/en_US.ISO8859-1/books/faq/book.sgml,v 1.1109 2009/02/02 19:46:41 pgj Exp $ 1995 @@ -2448,7 +2448,7 @@ drivers present, the Parallel Port drive should be available as /dev/da0s4. Disks can be mounted using mount /dev/da0s4 /mnt OR - (for DOS disks) mount_msdos /dev/da0s4 /mnt + (for DOS disks) mount -t msdosfs /dev/da0s4 /mnt as appropriate. Also check out the FAQ on ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/boot/chapter.sgml#6 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -606,7 +606,7 @@ Sample splash screen files can be downloaded from the gallery at . By + url="http://artwork.freebsdgr.org/node/3/">http://artwork.freebsdgr.org. By installing the sysutils/bsd-splash-changer port, splash images can be chosen from a collection randomly ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/handbook/l10n/chapter.sgml#5 (text+ko) ==== @@ -1,7 +1,7 @@ @@ -836,14 +836,15 @@ Also make sure that XkbDisable is turned off (commented out) there. - For grp:caps_toggle + For grp:toggle the RUS/LAT switch will be Right Alt, for grp:ctrl_shift_toggle switch will be CtrlShift. + For grp:caps_toggle + the RUS/LAT switch will be CapsLock. The old CapsLock function is still available via ShiftCapsLock (in LAT mode - only). For grp:toggle - the RUS/LAT switch will be Right Alt. + only). grp:caps_toggle does not work in &xorg; for unknown reason. ==== //depot/projects/docproj_nl/en_US.ISO8859-1/books/porters-handbook/book.sgml#22 (text+ko) ==== @@ -1,7 +1,7 @@ Getting fake DISPLAY using Xvfb Some applications require a working X11 display for compilation to - succeed. This pose a problem for machines which operates headless. + succeed. This pose a problem for machines that operate headless. When the following variable is used, the build infrastructure will start the virtual framebuffer X server. The working DISPLAY is then passed @@ -6639,7 +6639,7 @@ USE_TCL_WRAPPER - Ports that requrire the + Ports that require the Tcl shell and do not require a specific tclsh version should use this new variable. The tclsh wrapper @@ -8224,7 +8224,7 @@ If variable is set to yes, add dependency on databases/db41 port. The variable may also be set to values: 2, 3, 40, 41, - 42, 43, 44, 45 46, or 47. You can declare a range of + 42, 43, 44, 45, 46, or 47. You can declare a range of acceptable values, USE_BDB=42+ will find the highest installed version, and fall back to 42 if nothing else is installed. @@ -12048,6 +12048,19 @@ + 7.1-STABLE after the merge of + multi-/no-IPv4/v6 jails. + 701103 + + + + 7.1-STABLE after the store of the suspension owner + in the struct mount, and introduction of vfs_susp_clean + method into the struct vfsops. + 701104 + + + 8.0-CURRENT. Separating wide and single byte ctype. 800000 @@ -12202,7 +12215,7 @@ 8.0-CURRENT after axing out the lockwaiters and BUF_LOCKWAITERS functions, - changing the return value fo brelvp + changing the return value of brelvp from void to int and introducing new flags for &man.lockinit.9;. 800024 ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/cutting-edge/chapter.sgml#21 (text+ko) ==== @@ -1,7 +1,7 @@ + - Key fingerprint = 24E3 5A0F F224 D3EB 6D2F 1A49 E403 AD85 F970 CE42 -sub 1024g/F7781B04 2002-10-17 +pub 1024D/F28B4069 2009-02-09 + Key fingerprint = 3FE4 99A9 6F41 8161 4F5F 240C 8615 A60C F28B 4069 +uid Maho NAKATA (NAKATA's FreeBSD.org alias) +sub 2048g/6B49098E 2009-02-09 ]]> ==== //depot/projects/docproj_nl/share/pgpkeys/marck.key#2 (text+ko) ==== @@ -1,4 +1,4 @@ - + @@ -49,25 +49,40 @@ CSYSliA69FbO91G6e0uIRgQQEQIABgUCQ6Z5cwAKCRBEidDtZ5uBGa29AJ47BnH1 jsRMs1Az3/qXw+OID0GdIwCbBgpLoBudHg4tZ9v2mnPel8huOFOIRgQQEQIABgUC RJMPyAAKCRCpF+nMmW4UXgVsAJ48LTkwJc7H59xQE6xCH38czbBHrQCfXirFC4WS -rbLTvdyenUWrlQh5Hse0JURtaXRyeSBNb3Jvem92c2t5IDxtYXJja0BGcmVlQlNE -Lm9yZz6IXgQTEQIAHgUCQRh3SwIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRCF -1FBFa2kbAxEQAJ9p3vcTJCOwssNVA//wiyUximGelgCggaS4vscpI4GjDjz/5MAb -pZdk7kGIRgQQEQIABgUCQzlXOAAKCRDs8OkLLBcgg/fwAJ9sGQoHHykSPO9rFmiF -fspjyPgLmACffJ3+Z4wJXNKlmY6D3fqVTB4vkHKIRgQSEQIABgUCQ6G3KQAKCRCF -t2wt19VfGhdOAKC2gfth4x25oDhO5YKZuJRwTRIgUQCgnXHO5/rWDoYeKDxRsWze -zczDh4WIRgQQEQIABgUCQ6MnOgAKCRBNyUvYtx9gXX9kAKCR06Nt1BSKyMd07wSl -sWc4mq+N3ACdGLm3hFxWV5NhgjJyE/VRVPUAseyIRgQQEQIABgUCQ6O8OQAKCRCv -ItzveM4QX35KAJ4jsBq83Vo1/brrQn6h8njUoSe7PACdGW13bPB3zu7QEyL3Ur/K -86q8IsuIRgQQEQIABgUCQ6PrYgAKCRBd5Nf+GUncgAPQAJ9l3qLexbzF4JMoxoEo -flkuHwXpCQCbBK6bS0nJnmfoNGXDpRRo8qAEFSWIRgQQEQIABgUCQ6M/3QAKCRBC -sZN8yFUPTBYeAKCf1oHL86oyiPTxopWjzQY0G2v9oQCcCd5tbZrhAuo87Q2G7sS1 -ALHyUPuIRgQQEQIABgUCQ5xbHgAKCRDGBDxWcgdxNxpLAJwMZnLXTD2xOMaUbEWF -dfl0/YFUUwCfSAtJPGN9T5cP5Zy7cWvlNqt3UHqIRgQQEQIABgUCQ5xg5gAKCRB5 -4pxgsAY/54NzAKCsNx3hhz2XmW99A2dGRQPLx/v2LQCdENVtUKrjb61O8spFe6uR -QQ0CFvSIRgQQEQIABgUCQ6Z5dgAKCRBEidDtZ5uBGYTwAJ4vw7oifyiZ8Y2AgZhV -Z+kVTIf2IACcC1REuI07XJzwO9yiIZOsk+dvLOaIRgQQEQIABgUCRJMPzgAKCRCp -F+nMmW4UXkIhAJsG3I2+u3s9FxBlcS2swNLS3aPqeACfSOHu7LH2vZhZ83h4ctGr -Rq8tmoG5Ag0EO1hObhAIANX5TO/cDWaKqIaSRz4NyjTpHgtIDQpzT8D94KOnRmaP +rbLTvdyenUWrlQh5HseIRgQTEQIABgUCRJjuWgAKCRCZIuOb12P/ohUuAKCYHNqv +3IllO6KH2p2YVKyJE4ck0wCbBpPj4fmsWK60C7E8LS3Ao0wZOFWIRgQQEQIABgUC +RKMAZwAKCRBsA3Jjrf1cmtk8AKCV0MXR0SdAe24yKM4NASCB+OspkACfTZYJUESS +IMgzDbf2znuR5zrRZF2IRgQQEQIABgUCR5ZXewAKCRC3jomRJHtd3XmJAJ9SCvz7 +oY1sF5XePs7jBtc8HuQ5RwCgpfpzfsH9F16M41eM3DAPWbLpM8+IRgQQEQIABgUC +R5ZYAAAKCRBZxqJbrEANAufLAJ4lqSYjzrYabYUEG19D+B6ZlP3doACfVnkEb3T+ +bIJNiPP9e0HXQ9gdo9iIRgQQEQIABgUCSHJXhAAKCRA96g22+4pu9M5rAJ96Flw/ +ggrRWZH08gtU+yb8ObzHxQCcCDAzVaAJtOA9RG3TRXoHBDy4Ua+0JURtaXRyeSBN +b3Jvem92c2t5IDxtYXJja0BGcmVlQlNELm9yZz6IXgQTEQIAHgUCQRh3SwIbAwYL +CQgHAwIDFQIDAxYCAQIeAQIXgAAKCRCF1FBFa2kbAxEQAJ9p3vcTJCOwssNVA//w +iyUximGelgCggaS4vscpI4GjDjz/5MAbpZdk7kGIRgQQEQIABgUCQzlXOAAKCRDs +8OkLLBcgg/fwAJ9sGQoHHykSPO9rFmiFfspjyPgLmACffJ3+Z4wJXNKlmY6D3fqV +TB4vkHKIRgQSEQIABgUCQ6G3KQAKCRCFt2wt19VfGhdOAKC2gfth4x25oDhO5YKZ +uJRwTRIgUQCgnXHO5/rWDoYeKDxRsWzezczDh4WIRgQQEQIABgUCQ6MnOgAKCRBN +yUvYtx9gXX9kAKCR06Nt1BSKyMd07wSlsWc4mq+N3ACdGLm3hFxWV5NhgjJyE/VR +VPUAseyIRgQQEQIABgUCQ6O8OQAKCRCvItzveM4QX35KAJ4jsBq83Vo1/brrQn6h +8njUoSe7PACdGW13bPB3zu7QEyL3Ur/K86q8IsuIRgQQEQIABgUCQ6PrYgAKCRBd +5Nf+GUncgAPQAJ9l3qLexbzF4JMoxoEoflkuHwXpCQCbBK6bS0nJnmfoNGXDpRRo +8qAEFSWIRgQQEQIABgUCQ6M/3QAKCRBCsZN8yFUPTBYeAKCf1oHL86oyiPTxopWj +zQY0G2v9oQCcCd5tbZrhAuo87Q2G7sS1ALHyUPuIRgQQEQIABgUCQ5xbHgAKCRDG +BDxWcgdxNxpLAJwMZnLXTD2xOMaUbEWFdfl0/YFUUwCfSAtJPGN9T5cP5Zy7cWvl +Nqt3UHqIRgQQEQIABgUCQ5xg5gAKCRB54pxgsAY/54NzAKCsNx3hhz2XmW99A2dG +RQPLx/v2LQCdENVtUKrjb61O8spFe6uRQQ0CFvSIRgQQEQIABgUCQ6Z5dgAKCRBE +idDtZ5uBGYTwAJ4vw7oifyiZ8Y2AgZhVZ+kVTIf2IACcC1REuI07XJzwO9yiIZOs +k+dvLOaIRgQQEQIABgUCRJMPzgAKCRCpF+nMmW4UXkIhAJsG3I2+u3s9FxBlcS2s +wNLS3aPqeACfSOHu7LH2vZhZ83h4ctGrRq8tmoGIRgQTEQIABgUCRJjuXwAKCRCZ +IuOb12P/ol4FAJ9FaVLCtB/NmZwWjVT6ueGbpcsYIACfZe3LGC1iPQ7NvD8RNzGE +RN0NiMaIRgQQEQIABgUCRKMAcwAKCRBsA3Jjrf1cmnAjAJ48nosDD382QDoL9tYM +fiiNMsZIxgCcCoFh8aox6DYdM4dvu2TZgDZKQ7iIRgQQEQIABgUCR5ZXewAKCRC3 +jomRJHtd3QxeAJ0Q14bA+TDYg055FVCpskOYUVo4HgCfXvGbQz1RzSxF7qsbCTvG +x4EQJ+mIRgQQEQIABgUCR5ZYAgAKCRBZxqJbrEANAhg6AJ4nm2EzjE/SDAh4H+LF ++BKMOw2xGwCeOWOm7pr3bShpwsVtE8Os3NimZ/iIRgQQEQIABgUCSHJXhAAKCRA9 +6g22+4pu9KAzAJ0cfSUFB4HhdLve85oDa3m94RcPjACdGs+PIT5+jAX1O7Te/g7t +wu/j4kS5Ag0EO1hObhAIANX5TO/cDWaKqIaSRz4NyjTpHgtIDQpzT8D94KOnRmaP 0B46pcNxP62+zRXIP3iHFKTGits2EoGqsw/2Y+S4RxtL/669ykxb4W7TtBwHG9mX EsgoiEol5eylKhNHOe2ZUwm5BIq3PTPywueehMMB7A4cqg+k+PDLyibzz6lvYKrp oVvaXezfX8k6vOmiRIWyazhEG3KOjiS3fnzI+qYXHUiiWjGx/CM+DcBzcuvebW5e @@ -80,6 +95,6 @@ 0ETdYPy/t6AfbJ+avbIbH8rJUd6ifblrKUqGyrc+gJ5435T3YowGVGpVVRZQyyfg uRP+CIOIRgQYEQIABgUCO1hObgAKCRCF1FBFa2kbA5t6AJ9B0laWrFnyRvVGo/NV QHmv6xkKhwCbBo5yKzSSgAUpfzjAw5PKW481T6g= -=Zfaq +=nJcP -----END PGP PUBLIC KEY BLOCK----- ]]> ==== //depot/projects/docproj_nl/share/pgpkeys/miwi.key#2 (text+ko) ==== @@ -1,41 +1,51 @@ - + -sub 2048g/B3BEE707 2007-02-23 [expires: 2009-02-22] +sub 4096g/096DA69D 2009-01-31 ]]> ==== //depot/projects/docproj_nl/www/en/cgi/cgi-style.pl#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.37 2008/09/21 10:24:01 wosch Exp $ +# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.38 2009/02/14 21:14:27 miwi Exp $ # # Perl routines to encapsulate various elements of HTML page style. @@ -188,7 +188,7 @@ return qq` ==== //depot/projects/docproj_nl/www/en/community/mailinglists.sgml#2 (text+ko) ==== @@ -1,6 +1,6 @@ - + ]> @@ -54,7 +54,9 @@ or WWW.
  • Hungarian -- WWW
  • + href="mailto:bsd@hu.FreeBSD.org">bsd@hu.FreeBSD.org, Administration + or Search.
  • Indonesian -- id-freebsd-subscribe@egroups.com
  • ==== //depot/projects/docproj_nl/www/en/docproj/translations.sgml#4 (text+ko) ==== @@ -1,6 +1,6 @@ - + ]> @@ -210,6 +210,7 @@
    Documents available
    Web, + developers-handbook, FAQ, FDP Primer, Handbook, @@ -218,7 +219,6 @@
    Documents currently being worked on
    - developers-handbook, arch-handbook.
    ==== //depot/projects/docproj_nl/www/en/donations/donors.sgml#13 (text+ko) ==== @@ -1,6 +1,6 @@ - + %developers; @@ -1162,7 +1162,7 @@ 256MB PC2100 DDR 266MHz RAM, Savage8 3D Video Accelerator, 80GB 7200rpm ATA100 IDE Harddrive, Integrated 10/100 LAN VT8233 trhodes - shipping + Received ==== //depot/projects/docproj_nl/www/en/news/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: www/en/news/Makefile,v 1.51 2008/12/08 09:10:44 murray Exp $ +# $FreeBSD: www/en/news/Makefile,v 1.52 2009/02/11 17:15:28 pgj Exp $ .if exists(../Makefile.conf) .include "../Makefile.conf" @@ -47,6 +47,7 @@ SUBDIR+= 2005 SUBDIR+= 2006 SUBDIR+= 2007 +SUBDIR+= 2008 SUBDIR+= status .include "${WEB_PREFIX}/share/mk/web.site.mk" ==== //depot/projects/docproj_nl/www/en/news/status/report-2008-10-2008-12.xml#2 (text+ko) ==== @@ -2,7 +2,7 @@ - + October-December @@ -131,9 +131,9 @@ - Gàbor + Gábor - Kövesdàn + Kövesdán gabor@FreeBSD.org @@ -160,7 +160,7 @@ - Make a tinderbox run with BSD grep and fix possible + Make a portbuild run with BSD grep and fix possible bugs. @@ -348,9 +348,9 @@ - Gàbor + Gábor - Kövesdàn + Kövesdán gabor@FreeBSD.org @@ -358,9 +358,9 @@ - Gàbor + Gábor - Pàli + Páli pgj@FreeBSD.org ==== //depot/projects/docproj_nl/www/en/releases/index.sgml#6 (text+ko) ==== @@ -1,10 +1,10 @@ - + ]> - + &header; @@ -70,7 +70,6 @@ Announcement: Release Notes: Hardware Notes: - Installation Notes: Readme: Errata ==== //depot/projects/docproj_nl/www/en/releng/index.sgml#13 (text+ko) ==== @@ -1,6 +1,6 @@ - + @@ -47,12 +47,13 @@ Information + To be defined FreeBSD 7.2 ==== //depot/projects/docproj_nl/www/share/sgml/libcommon.xsl#5 (text+ko) ==== @@ -1,7 +1,7 @@ - +

    Old announcements: + 2008, 2007, 2006, 2005, @@ -410,6 +411,7 @@

    Old press publications: + 2008, 2007, 2006, 2005, ==== //depot/projects/docproj_nl/www/share/sgml/news.xml#28 (text+ko) ==== @@ -25,7 +25,7 @@ - $FreeBSD: www/share/sgml/news.xml,v 1.223 2009/01/30 22:09:36 jamie Exp $ + $FreeBSD: www/share/sgml/news.xml,v 1.225 2009/02/14 18:07:57 miwi Exp $ @@ -33,6 +33,25 @@ 2009 + 2 + + + 14 + + + KDE 4.2.0 available for FreeBSD + +

    KDE 4.2.0 has been merged into the ports tree. For a + detailed list of improvements, please refer to the + + announcement. For general information about KDE on + FreeBSD, please see the + KDE on FreeBSD project page.

    + + + + + 1 @@ -104,874 +123,4 @@ - - 2008 - - - 12 - - - 25 - - - FreeBSD 7.1-RC2 Available - -

    The second and last release candidate of &os; 7.1 is now - available. ISO images for Tier-1 architectures are now - available on most of the &os; - mirror sites.

    -
    -
    - - - 23 - - - &os; Foundation December 2008 Newsletter - -

    The &os; Foundation has published their Semi-Annual December 2008 newsletter - which summarizes what they have done to help the &os; - Project and community.

    -
    -
    - - - 9 - - - FreeBSD 7.1-RC1 Available - -

    The first release candidate of &os; 7.1 is now available. - ISO images for Tier-1 architectures are now available on - most of the &os; - mirror sites.

    -
    -
    - - - 3 - - - BSD channel launched on YouTube - -

    We are pleased to announce the availability of a - dedicated YouTube channel for technical lectures about - FreeBSD and other BSD operating systems. The channel is - available at www.youtube.com/bsdconferences.

    - -

    This channel allows us to post full hour long lectures - from FreeBSD conferences. The first four videos that - Julian Elisher recorded at MeetBSD have been - posted, and more are on the way.

    - -
    -
    -
    - - 11 - - - 28 - - - FreeBSD 6.4-RELEASE Available - -

    FreeBSD - 6.4-RELEASE is now available. Please be sure to check - the Release Notes - and Release - Errata - before installation for any late-breaking news and/or - issues with 6.4. More information about FreeBSD releases - can be found on the Release Information - page.

    -
    -
    - - - 18 - - -

    Commit bit restored: Peter - Holm (src)

    -
    -
    - - - 16 - - - Official FreeBSD Forums Launched - -

    The FreeBSD project is finally, after much work, pleased to - announce the availability of an official FreeBSD web based - discussion forum. It is our hope that this forum will serve - as a public support channel for FreeBSD users around the world - and as a complement to our fine mailing lists.

    - -

    You can register and start using our new service here: http://forums.FreeBSD.org.

    -
    -
    - - - 10 - - - July - September, 2008 Status Reports - -

    The July - September, 2008 Status Reports are now - available with 14 entries.

    -
    -
    - - - 3 - -

    New committer: - René Ladan (doc-nl)

    -
    - - - &os; 6.4-RC2 Available - -

    The second Release Candidate for &os; 6.4 is now available. - ISO images for Tier-1 architectures are available for - download on most of the &os; mirror sites. - &os; 6.4-RC2 should be the last of the public test builds - for the FreeBSD 6.4 release cycle, therefore we encourage - people to test and report any outstanding bugs as soon as - possible.

    -
    -
    - - - 1 - - New committer: <a href="mailto:versus@FreeBSD.org"> - Konrad Jankowski</a> (src) - SoC2008 alumnus. - -

    New committer: Konrad Jankowski (src). - Konrad participated in Summer Of Code 2008. - He will begin his work in the i18n area, specifically in - bringing his SoC code (UTF-8 collation) to the coming releases.

    -
    -
    - -
    - >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Mon Feb 16 20:59:02 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4590E1065673; Mon, 16 Feb 2009 20:59:02 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0353A106564A for ; Mon, 16 Feb 2009 20:59:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E456D8FC0A for ; Mon, 16 Feb 2009 20:59:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GKx1Vn018314 for ; Mon, 16 Feb 2009 20:59:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GKx1S4018312 for perforce@freebsd.org; Mon, 16 Feb 2009 20:59:01 GMT (envelope-from hselasky@FreeBSD.org) Date: Mon, 16 Feb 2009 20:59:01 GMT Message-Id: <200902162059.n1GKx1S4018312@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157814 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 20:59:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=157814 Change 157814 by hselasky@hselasky_laptop001 on 2009/02/16 20:58:33 HID patch: The software computed HID size is not always correct, because the algoritm does not handle unsorted HID descriptors. TODO: Probably libusbhid has the same bug. This needs checking. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.c#9 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.c#9 (text+ko) ==== @@ -392,22 +392,38 @@ { struct hid_data *d; struct hid_item h; - int hi, lo, size, id; + uint32_t size; + uint32_t hi; + uint32_t lo; + uint8_t id; id = 0; - hi = lo = -1; + hi = 0; + lo = (uint32_t)(0-1); for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) if (h.kind == k) { if (h.report_ID != 0 && !id) id = h.report_ID; if (h.report_ID == id) { - if (lo < 0) + /* check if "lo" is greater than "pos" */ + if (lo > h.loc.pos) lo = h.loc.pos; - hi = h.loc.pos + h.loc.size * h.loc.count; + /* compute end position */ + size = h.loc.pos + (h.loc.size * h.loc.count); + /* check if "size" wrapped */ + /* check if "hi" is less than "size" */ + if (size < h.loc.pos) + hi = (uint32_t)(0-1); + else if (hi < size) + hi = size; } } hid_end_parse(d); - size = hi - lo; + if (lo > hi) + size = 0; + else + size = hi - lo; + if (id != 0) { size += 8; *idp = id; /* XXX wrong */ From owner-p4-projects@FreeBSD.ORG Mon Feb 16 21:01:04 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8B7E31065675; Mon, 16 Feb 2009 21:01:04 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4955C106564A for ; Mon, 16 Feb 2009 21:01:04 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 32F858FC15 for ; Mon, 16 Feb 2009 21:01:04 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1GL14Zp018561 for ; Mon, 16 Feb 2009 21:01:04 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1GL14c8018559 for perforce@freebsd.org; Mon, 16 Feb 2009 21:01:04 GMT (envelope-from rene@FreeBSD.org) Date: Mon, 16 Feb 2009 21:01:04 GMT Message-Id: <200902162101.n1GL14c8018559@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Cc: Subject: PERFORCE change 157815 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2009 21:01:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=157815 Change 157815 by rene@rene_self on 2009/02/16 21:00:15 MFen handbook: o book.sgml, network-servers/chapter.sgml: SRCID bump o l10n: 1.127 -> 1.128 o boot: 1.69 -> 1.70 Affected files ... .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/book.sgml#11 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/boot/chapter.sgml#7 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/l10n/chapter.sgml#8 edit .. //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/network-servers/chapter.sgml#17 edit Differences ... ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/book.sgml#11 (text+ko) ==== @@ -3,7 +3,7 @@ $FreeBSDnl: doc/nl_NL.ISO8859-1/books/handbook/book.sgml,v 1.33 2006/01/08 10:06:50 siebrand Exp $ %SOURCE% en_US.ISO8859-1/books/handbook/book.sgml - %SRCID% 1.174 + %SRCID% 1.175 --> ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/boot/chapter.sgml#7 (text+ko) ==== @@ -5,7 +5,7 @@ $FreeBSDnl: doc/nl_NL.ISO8859-1/books/handbook/boot/chapter.sgml,v 1.34 2006/08/25 16:42:35 remko Exp $ %SOURCE% en_US.ISO8859-1/books/handbook/boot/chapter.sgml - %SRCID% 1.69 + %SRCID% 1.70 --> @@ -685,8 +685,8 @@ Voorbeelden van splash-schermen kunnen gedownload worden van de galerij op . Door de - port http://artwork.freebsdgr.org/. + Door de port sysutils/bsd-splash-changer te installeren, kunnen de splash-afbeeldingen willekeurig elke keer dat er wordt opgestart uit een verzameling worden ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/l10n/chapter.sgml#8 (text+ko) ==== @@ -5,7 +5,7 @@ $FreeBSDnl: doc/nl_NL.ISO8859-1/books/handbook/l10n/chapter.sgml,v 1.34 2006/08/12 22:53:14 remko Exp $ %SOURCE% en_US.ISO8859-1/books/handbook/l10n/chapter.sgml - %SRCID% 1.127 + %SRCID% 1.128 --> @@ -959,19 +959,20 @@ Ook moet daar XkbDisable uitgeschakeld (uitgecomment) zijn. - Voor grp:caps_toggle is de + Voor grp:toggle is de RUS/LAT-schakelaar Rechter Alt voor de grp:ctrl_shift_toggle schakelaar zal - dat CtrlShift - zijn. De oude CapsLock functie is nog - steeds beschikbaar via + dat Ctrl + Shift zijn. Voor + grp:caps_toggle zal de + RUS/LAT-schakelaar CapsLock zijn. De + oude CapsLock functie is nog steeds + beschikbaar via Shift CapsLock - (alleen in LAT-modus). Voor - grp:toggle is de RUS/LAT-schakelaar - Right Alt. - grp:caps_toggle werkt om onbekende - reden niet in &xorg;. + (alleen in LAT-modus). grp:caps_toggle + werkt om onbekende reden niet in + &xorg;. Als er &windows; toetsen op een toetsenbord zitten en het blijkt dat sommige ==== //depot/projects/docproj_nl/nl_NL.ISO8859-1/books/handbook/network-servers/chapter.sgml#17 (text+ko) ==== @@ -5,7 +5,7 @@ $FreeBSDnl: doc/nl_NL.ISO8859-1/books/handbook/network-servers/chapter.sgml,v 1.48 2006/01/05 21:13:23 siebrand Exp $ %SOURCE% en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml - %SRCID% 1.115 + %SRCID% 1.116 --> From owner-p4-projects@FreeBSD.ORG Tue Feb 17 07:21:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A65D106566C; Tue, 17 Feb 2009 07:21:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F78106564A for ; Tue, 17 Feb 2009 07:21:36 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D23048FC13 for ; Tue, 17 Feb 2009 07:21:36 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H7LaI9099400 for ; Tue, 17 Feb 2009 07:21:36 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1H7Lah5099398 for perforce@freebsd.org; Tue, 17 Feb 2009 07:21:36 GMT (envelope-from andrew@freebsd.org) Date: Tue, 17 Feb 2009 07:21:36 GMT Message-Id: <200902170721.n1H7Lah5099398@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157829 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 07:21:38 -0000 http://perforce.freebsd.org/chv.cgi?CH=157829 Change 157829 by andrew@andrew_bender on 2009/02/17 07:21:08 Create a uart device for all 3 uarts Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0.c#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0.c#4 (text+ko) ==== @@ -299,6 +299,8 @@ struct s3c24x0_softc *sc = device_get_softc(dev); bus_space_tag_t iot; device_t child; + u_long irq; + int i; s3c2xx0_softc = &(sc->sc_sx); sc->sc_sx.sc_iot = iot = &s3c2xx0_bs_tag; @@ -383,10 +385,25 @@ S3C2410_SDI_SIZE); /* Add the uart and set it's irq and registers */ - child = s3c24x0_add_child(dev, 0, "uart", 0); - bus_set_resource(child, SYS_RES_IRQ, 0, S3C24X0_INT_UART0, 1); - bus_set_resource(child, SYS_RES_IOPORT, 0, S3C24X0_UART0_BASE, - S3C24X0_UART_BASE(1) - S3C24X0_UART0_BASE); + for (i = 0; i < 3; i++) { + child = s3c24x0_add_child(dev, 0, "uart", i); + + irq = 0; + switch(i) { + case 0: + irq = S3C24X0_INT_UART0; + break; + case 1: + irq = S3C24X0_INT_UART1; + break; + case 2: + irq = S3C24X0_INT_UART2; + break; + } + bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); + bus_set_resource(child, SYS_RES_IOPORT, 0, S3C24X0_UART_BASE(i), + S3C24X0_UART_BASE(i + 1) - S3C24X0_UART_BASE(i)); + } bus_generic_probe(dev); bus_generic_attach(dev); From owner-p4-projects@FreeBSD.ORG Tue Feb 17 07:31:48 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 92F491065673; Tue, 17 Feb 2009 07:31:47 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53695106566C for ; Tue, 17 Feb 2009 07:31:47 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 418E28FC14 for ; Tue, 17 Feb 2009 07:31:47 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H7VlQx000367 for ; Tue, 17 Feb 2009 07:31:47 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1H7Vlox000365 for perforce@freebsd.org; Tue, 17 Feb 2009 07:31:47 GMT (envelope-from andrew@freebsd.org) Date: Tue, 17 Feb 2009 07:31:47 GMT Message-Id: <200902170731.n1H7Vlox000365@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157830 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 07:31:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=157830 Change 157830 by andrew@andrew_bender on 2009/02/17 07:31:44 Pass INTCTL_INTPND back into itself to clear the appropriate bit. Make sure the parent IRQ is masked as it can cause issues with UART if not. Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0.c#5 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0.c#5 (text+ko) ==== @@ -501,6 +501,7 @@ int arm_get_next_irq(void) { + uint32_t intpnd; int irq; if ((irq = bus_space_read_4(&s3c2xx0_bs_tag, @@ -509,8 +510,10 @@ /* Clear the pending bit */ bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_SRCPND, (1 << irq)); + intpnd = bus_space_read_4(&s3c2xx0_bs_tag, + s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTPND); bus_space_write_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, - INTCTL_INTPND, (1 << irq)); + INTCTL_INTPND, intpnd); switch (irq) { case S3C24X0_INT_ADCTC: @@ -600,6 +603,8 @@ /* We don't know which other IRQ to unmask */ return; } + arm_mask_irq(irq); + return; } mask = bus_space_read_4(&s3c2xx0_bs_tag, s3c2xx0_softc->sc_intctl_ioh, INTCTL_INTMSK); From owner-p4-projects@FreeBSD.ORG Tue Feb 17 07:35:52 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CEA471065673; Tue, 17 Feb 2009 07:35:51 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBDB1065670 for ; Tue, 17 Feb 2009 07:35:51 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7D1468FC19 for ; Tue, 17 Feb 2009 07:35:51 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H7Zp9s000731 for ; Tue, 17 Feb 2009 07:35:51 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1H7ZpoI000728 for perforce@freebsd.org; Tue, 17 Feb 2009 07:35:51 GMT (envelope-from andrew@freebsd.org) Date: Tue, 17 Feb 2009 07:35:51 GMT Message-Id: <200902170735.n1H7ZpoI000728@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157831 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 07:35:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=157831 Change 157831 by andrew@andrew_bender on 2009/02/17 07:35:46 Only set SER_INT_TXIDLE when we are busy. This if statement could be removed as we are never busy as s3c2410_putc will block when the FIFO is not empty which means we only ever have 1 character in it. Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/uart_dev_s3c2410.c#8 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/uart_dev_s3c2410.c#8 (text+ko) ==== @@ -254,7 +254,6 @@ s3c2410_putc(&sc->sc_bas, sc->sc_txbuf[i]); uart_barrier(&sc->sc_bas); } - sc->sc_txbusy = 1; uart_unlock(sc->sc_hwmtx); return (0); @@ -298,7 +297,7 @@ utrstat = uart_getreg(&sc->sc_bas, SSCOM_UTRSTAT); uart_unlock(sc->sc_hwmtx); - if ((utrstat & UTRSTAT_TXEMPTY) == UTRSTAT_TXEMPTY) { + if ((utrstat & UTRSTAT_TXEMPTY) == UTRSTAT_TXEMPTY && sc->sc_txbusy != 0) { ipend |= SER_INT_TXIDLE; } if ((utrstat & UTRSTAT_RXREADY) == UTRSTAT_RXREADY) { @@ -325,6 +324,7 @@ { return (EINVAL); } + struct uart_class uart_s3c2410_class = { "s3c2410 class", s3c2410_methods, From owner-p4-projects@FreeBSD.ORG Tue Feb 17 08:49:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 968421065674; Tue, 17 Feb 2009 08:49:06 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 323131065672 for ; Tue, 17 Feb 2009 08:49:06 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFFC8FC0C for ; Tue, 17 Feb 2009 08:49:06 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H8n6bV016744 for ; Tue, 17 Feb 2009 08:49:06 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1H8n57I016742 for perforce@freebsd.org; Tue, 17 Feb 2009 08:49:06 GMT (envelope-from andrew@freebsd.org) Date: Tue, 17 Feb 2009 08:49:06 GMT Message-Id: <200902170849.n1H8n57I016742@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157832 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 08:49:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=157832 Change 157832 by andrew@andrew_bender on 2009/02/17 08:48:48 Correct the spelling of S3C2410_SDI_IMSK Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_mci.c#6 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0_mci.c#6 (text+ko) ==== @@ -114,7 +114,7 @@ struct s3c24x0_mci_softc *sc; sc = device_get_softc(dev); - WR4(sc, SDI_IMSK, 0x3ffdf); /* Enable all interrupts */ + WR4(sc, S3C2410_SDI_IMSK, 0x3ffdf); /* Enable all interrupts */ } static void @@ -123,7 +123,7 @@ struct s3c24x0_mci_softc *sc; sc = device_get_softc(dev); - WR4(sc, SDI_IMSK, 0x0); /* Disable all interrupts */ + WR4(sc, S3C2410_SDI_IMSK, 0x0); /* Disable all interrupts */ } static int From owner-p4-projects@FreeBSD.ORG Tue Feb 17 08:50:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B30201065672; Tue, 17 Feb 2009 08:50:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7309B106566B for ; Tue, 17 Feb 2009 08:50:07 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 474818FC17 for ; Tue, 17 Feb 2009 08:50:07 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1H8o7a3016844 for ; Tue, 17 Feb 2009 08:50:07 GMT (envelope-from andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1H8o7h3016842 for perforce@freebsd.org; Tue, 17 Feb 2009 08:50:07 GMT (envelope-from andrew@freebsd.org) Date: Tue, 17 Feb 2009 08:50:07 GMT Message-Id: <200902170850.n1H8o7h3016842@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andrew@freebsd.org using -f From: Andrew Turner To: Perforce Change Reviews Cc: Subject: PERFORCE change 157833 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 08:50:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=157833 Change 157833 by andrew@andrew_bender on 2009/02/17 08:49:24 Remove the duplicate definition of S3C24X0_LCDC_SIZE Affected files ... .. //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0reg.h#3 edit Differences ... ==== //depot/projects/arm/src/sys/arm/s3c2xx0/s3c24x0reg.h#3 (text+ko) ==== @@ -371,8 +371,6 @@ #define LCDC_PALETTE 0x0400 #define LCDC_PALETTE_SIZE 0x0400 -#define S3C24X0_LCDC_SIZE (LCDC_PALETTE+LCDC_PALETTE_SIZE) - /* NAND Flash controller */ #define NANDFC_NFCONF 0x00 /* Configuration */ /* NANDFC_NFSTAT */ From owner-p4-projects@FreeBSD.ORG Tue Feb 17 16:19:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 225931065674; Tue, 17 Feb 2009 16:19:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54A21065670 for ; Tue, 17 Feb 2009 16:19:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C30E78FC22 for ; Tue, 17 Feb 2009 16:19:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HGJ2J3070062 for ; Tue, 17 Feb 2009 16:19:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HGJ2NG070060 for perforce@freebsd.org; Tue, 17 Feb 2009 16:19:02 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 17 Feb 2009 16:19:02 GMT Message-Id: <200902171619.n1HGJ2NG070060@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157847 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 16:19:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=157847 Change 157847 by hselasky@hselasky_laptop001 on 2009/02/17 16:18:09 USB CORE: Improvements to "usb2_transfer_setup()" and "usb2_transfer_unsetup()". Set "ppxfer[n]" when the transfer setup is complete to prevent races. Remove redundant NULL-checks from "usb2_transfer_unsetup()". Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#44 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#44 (text+ko) ==== @@ -887,18 +887,14 @@ parm.size[0] += ((-parm.size[0]) & (USB_HOST_ALIGN - 1)); if (buf) { - /* * Common initialization of the * "usb2_xfer" structure. */ xfer = USB_ADD_BYTES(buf, parm.size[0]); - - ppxfer[n] = xfer; xfer->address = udev->address; xfer->priv_sc = priv_sc; xfer->xroot = info; - info->setup_refcount++; usb2_callout_init_mtx(&xfer->timeout_handle, &udev->bus->bus_mtx, 0); @@ -915,9 +911,22 @@ refcount++; } + /* set transfer pipe pointer */ + xfer->pipe = pipe; + parm.size[0] += sizeof(xfer[0]); + parm.methods = xfer->pipe->methods; + parm.curr_xfer = xfer; - xfer->pipe = pipe; + /* + * Call the Host or Device controller transfer + * setup routine: + */ + (udev->bus->methods->xfer_setup) (&parm); + + /* check for error */ + if (parm.err) + goto done; if (buf) { /* @@ -930,18 +939,19 @@ * want more information. */ xfer->pipe->refcount++; - } - parm.methods = xfer->pipe->methods; - parm.curr_xfer = xfer; - /* - * Call the Host or Device controller transfer setup - * routine: - */ - (udev->bus->methods->xfer_setup) (&parm); + /* + * Whenever we set ppxfer[] then we + * also need to increment the + * "setup_refcount": + */ + info->setup_refcount++; - if (parm.err) { - goto done; + /* + * Transfer is successfully setup and + * can be used: + */ + ppxfer[n] = xfer; } } @@ -1121,72 +1131,60 @@ while (n_setup--) { xfer = pxfer[n_setup]; - if (xfer) { - if (xfer->pipe) { - USB_XFER_LOCK(xfer); - USB_BUS_LOCK(xfer->xroot->bus); + if (xfer == NULL) + continue; + + info = xfer->xroot; - /* - * HINT: when you start/stop a transfer, it - * might be a good idea to directly use the - * "pxfer[]" structure: - * - * usb2_transfer_start(sc->pxfer[0]); - * usb2_transfer_stop(sc->pxfer[0]); - * - * That way, if your code has many parts that - * will not stop running under the same - * lock, in other words "xfer_mtx", the - * usb2_transfer_start and - * usb2_transfer_stop functions will simply - * return when they detect a NULL pointer - * argument. - * - * To avoid any races we clear the "pxfer[]" - * pointer while holding the private mutex - * of the driver: - */ - pxfer[n_setup] = NULL; + USB_XFER_LOCK(xfer); + USB_BUS_LOCK(info->bus); - USB_BUS_UNLOCK(xfer->xroot->bus); - USB_XFER_UNLOCK(xfer); + /* + * HINT: when you start/stop a transfer, it might be a + * good idea to directly use the "pxfer[]" structure: + * + * usb2_transfer_start(sc->pxfer[0]); + * usb2_transfer_stop(sc->pxfer[0]); + * + * That way, if your code has many parts that will not + * stop running under the same lock, in other words + * "xfer_mtx", the usb2_transfer_start and + * usb2_transfer_stop functions will simply return + * when they detect a NULL pointer argument. + * + * To avoid any races we clear the "pxfer[]" pointer + * while holding the private mutex of the driver: + */ + pxfer[n_setup] = NULL; - usb2_transfer_drain(xfer); + USB_BUS_UNLOCK(info->bus); + USB_XFER_UNLOCK(xfer); - if (xfer->flags_int.bdma_enable) { - needs_delay = 1; - } - /* - * NOTE: default pipe does not have an - * interface, even if pipe->iface_index == 0 - */ - xfer->pipe->refcount--; + usb2_transfer_drain(xfer); - } else { - /* clear the transfer pointer */ - pxfer[n_setup] = NULL; - } + if (xfer->flags_int.bdma_enable) + needs_delay = 1; - usb2_callout_drain(&xfer->timeout_handle); + /* + * NOTE: default pipe does not have an + * interface, even if pipe->iface_index == 0 + */ + xfer->pipe->refcount--; - if (xfer->xroot) { - info = xfer->xroot; + usb2_callout_drain(&xfer->timeout_handle); - USB_BUS_LOCK(info->bus); + USB_BUS_LOCK(info->bus); - USB_ASSERT(info->setup_refcount != 0, - ("Invalid setup " - "reference count!\n")); + USB_ASSERT(info->setup_refcount != 0, ("Invalid setup " + "reference count!\n")); - info->setup_refcount--; + info->setup_refcount--; - if (info->setup_refcount == 0) { - usb2_transfer_unsetup_sub(info, - needs_delay); - } else { - USB_BUS_UNLOCK(info->bus); - } - } + if (info->setup_refcount == 0) { + usb2_transfer_unsetup_sub(info, + needs_delay); + } else { + USB_BUS_UNLOCK(info->bus); } } } From owner-p4-projects@FreeBSD.ORG Tue Feb 17 19:13:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5CDA91065893; Tue, 17 Feb 2009 19:13:06 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0211065882 for ; Tue, 17 Feb 2009 19:13:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 160BE8FC0A for ; Tue, 17 Feb 2009 19:13:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HJD393096193 for ; Tue, 17 Feb 2009 19:13:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HJD3Bf096191 for perforce@freebsd.org; Tue, 17 Feb 2009 19:13:03 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 17 Feb 2009 19:13:03 GMT Message-Id: <200902171913.n1HJD3Bf096191@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157853 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:13:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=157853 Change 157853 by hselasky@hselasky_laptop001 on 2009/02/17 19:12:32 USB: Clean up old way of polling the USB hardware. The existing polling support was a bit hackish. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#28 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/atmegadci.c#5 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#34 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#27 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#31 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#30 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#13 edit .. //depot/projects/usb/src/sys/dev/usb2/controller/uss820dci.c#24 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#37 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#34 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#45 edit .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#30 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/controller/at91dci.c#28 (text+ko) ==== @@ -260,23 +260,16 @@ at91dci_wakeup_peer(struct usb2_xfer *xfer) { struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); - uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, AT91_UDP_GSTATE_ESR); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0); } @@ -1826,7 +1819,6 @@ struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1844,8 +1836,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2459,7 +2449,6 @@ .pipe_init = &at91dci_pipe_init, .xfer_setup = &at91dci_xfer_setup, .xfer_unsetup = &at91dci_xfer_unsetup, - .do_poll = &at91dci_do_poll, .get_hw_ep_profile = &at91dci_get_hw_ep_profile, .set_stall = &at91dci_set_stall, .clear_stall = &at91dci_clear_stall, ==== //depot/projects/usb/src/sys/dev/usb2/controller/atmegadci.c#5 (text+ko) ==== @@ -204,25 +204,18 @@ atmegadci_wakeup_peer(struct usb2_xfer *xfer) { struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); - uint8_t use_polling; uint8_t temp; if (!sc->sc_flags.status_suspend) { return; } - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; temp = ATMEGA_READ_1(sc, ATMEGA_UDCON); ATMEGA_WRITE_1(sc, ATMEGA_UDCON, temp | ATMEGA_UDCON_RMWKUP); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); /* hardware should have cleared RMWKUP bit */ } @@ -1695,7 +1688,6 @@ struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1713,8 +1705,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2319,7 +2309,6 @@ .pipe_init = &atmegadci_pipe_init, .xfer_setup = &atmegadci_xfer_setup, .xfer_unsetup = &atmegadci_xfer_unsetup, - .do_poll = &atmegadci_do_poll, .get_hw_ep_profile = &atmegadci_get_hw_ep_profile, .set_stall = &atmegadci_set_stall, .clear_stall = &atmegadci_clear_stall, ==== //depot/projects/usb/src/sys/dev/usb2/controller/ehci2.c#34 (text+ko) ==== @@ -3051,7 +3051,6 @@ uint16_t value; uint16_t index; uint8_t l; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -3069,8 +3068,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -3217,23 +3214,13 @@ EOWRITE4(sc, port, v | EHCI_PS_FPR); } /* wait 20ms for resume sequence to complete */ - if (use_polling) { - /* polling */ - DELAY(20000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); EOWRITE4(sc, port, v & ~(EHCI_PS_SUSP | EHCI_PS_FPR | (3 << 10) /* High Speed */ )); - /* settle time */ - if (use_polling) { - /* polling */ - DELAY(4000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); - } + /* 4ms settle time */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 250); break; case UHF_PORT_POWER: EOWRITE4(sc, port, v & ~EHCI_PS_PP); @@ -3382,27 +3369,17 @@ v &= ~(EHCI_PS_PE | EHCI_PS_PR); EOWRITE4(sc, port, v | EHCI_PS_PR); - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); /* Terminate reset sequence. */ if (!(sc->sc_flags & EHCI_SCFLG_NORESTERM)) EOWRITE4(sc, port, v); - if (use_polling) { - /* polling */ - DELAY(EHCI_PORT_RESET_COMPLETE * 1000); - } else { - /* Wait for HC to complete reset. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); - } + /* Wait for HC to complete reset. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(EHCI_PORT_RESET_COMPLETE)); v = EOREAD4(sc, port); DPRINTF("ehci after reset, status=0x%08x\n", v); @@ -3956,7 +3933,6 @@ .pipe_init = ehci_pipe_init, .xfer_setup = ehci_xfer_setup, .xfer_unsetup = ehci_xfer_unsetup, - .do_poll = ehci_do_poll, .get_dma_delay = ehci_get_dma_delay, .device_resume = ehci_device_resume, .device_suspend = ehci_device_suspend, ==== //depot/projects/usb/src/sys/dev/usb2/controller/musb2_otg.c#27 (text+ko) ==== @@ -206,25 +206,18 @@ { struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint8_t temp; - uint8_t use_polling; if (!(sc->sc_flags.status_suspend)) { return; } - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp |= MUSB2_MASK_RESUME; MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); /* wait 8 milliseconds */ - if (use_polling) { - /* polling */ - DELAY(8000); - } else { - /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); - } + /* Wait for reset to complete. */ + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); temp &= ~MUSB2_MASK_RESUME; @@ -2232,7 +2225,6 @@ struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2250,8 +2242,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2867,7 +2857,6 @@ .pipe_init = &musbotg_pipe_init, .xfer_setup = &musbotg_xfer_setup, .xfer_unsetup = &musbotg_xfer_unsetup, - .do_poll = &musbotg_do_poll, .get_hw_ep_profile = &musbotg_get_hw_ep_profile, .set_stall = &musbotg_set_stall, .clear_stall = &musbotg_clear_stall, ==== //depot/projects/usb/src/sys/dev/usb2/controller/ohci2.c#31 (text+ko) ==== @@ -2156,7 +2156,6 @@ uint16_t value; uint16_t index; uint8_t l; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2174,8 +2173,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -2410,13 +2407,8 @@ OWRITE4(sc, port, UPS_RESET); for (v = 0;; v++) { if (v < 12) { - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); if ((OREAD4(sc, port) & UPS_RESET) == 0) { break; @@ -2853,7 +2845,6 @@ .pipe_init = ohci_pipe_init, .xfer_setup = ohci_xfer_setup, .xfer_unsetup = ohci_xfer_unsetup, - .do_poll = ohci_do_poll, .get_dma_delay = ohci_get_dma_delay, .device_resume = ohci_device_resume, .device_suspend = ohci_device_suspend, ==== //depot/projects/usb/src/sys/dev/usb2/controller/uhci2.c#30 (text+ko) ==== @@ -2382,7 +2382,7 @@ * events have been reset. */ static usb2_error_t -uhci_portreset(uhci_softc_t *sc, uint16_t index, uint8_t use_polling) +uhci_portreset(uhci_softc_t *sc, uint16_t index) { uint16_t port; uint16_t x; @@ -2406,23 +2406,14 @@ UHCICMD(sc, (UHCI_CMD_MAXP | UHCI_CMD_RS)); /* wait a little bit */ - if (use_polling) { - DELAY(10000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 100); } x = URWMASK(UREAD2(sc, port)); UWRITE2(sc, port, x | UHCI_PORTSC_PR); - if (use_polling) { - /* polling */ - DELAY(USB_PORT_ROOT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", index, UREAD2(sc, port)); @@ -2449,13 +2440,8 @@ for (lim = 0; lim < 12; lim++) { - if (use_polling) { - /* polling */ - DELAY(USB_PORT_RESET_DELAY * 1000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, + USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); x = UREAD2(sc, port); @@ -2540,7 +2526,6 @@ uint16_t index; uint16_t status; uint16_t change; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2558,8 +2543,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - DPRINTFN(3, "type=0x%02x request=0x%02x wLen=0x%04x " "wValue=0x%04x wIndex=0x%04x\n", std->req.bmRequestType, std->req.bRequest, @@ -2779,12 +2762,7 @@ UWRITE2(sc, port, URWMASK(x)); /* wait 20ms for resume sequence to complete */ - if (use_polling) { - /* polling */ - DELAY(20000); - } else { - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); - } + usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); /* clear suspend and resume detect */ UWRITE2(sc, port, URWMASK(x) & ~(UHCI_PORTSC_RD | @@ -2831,7 +2809,7 @@ UWRITE2(sc, port, x | UHCI_PORTSC_SUSP); break; case UHF_PORT_RESET: - std->err = uhci_portreset(sc, index, use_polling); + std->err = uhci_portreset(sc, index); goto done; case UHF_PORT_POWER: /* pretend we turned on power */ @@ -3372,7 +3350,6 @@ .pipe_init = uhci_pipe_init, .xfer_setup = uhci_xfer_setup, .xfer_unsetup = uhci_xfer_unsetup, - .do_poll = uhci_do_poll, .get_dma_delay = uhci_get_dma_delay, .device_resume = uhci_device_resume, .device_suspend = uhci_device_suspend, ==== //depot/projects/usb/src/sys/dev/usb2/controller/usb2_controller.h#13 (text+ko) ==== @@ -57,7 +57,6 @@ /* USB Device and Host mode - Mandatory */ void (*pipe_init) (struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc, struct usb2_pipe *pipe); - void (*do_poll) (struct usb2_bus *); void (*xfer_setup) (struct usb2_setup_params *parm); void (*xfer_unsetup) (struct usb2_xfer *xfer); void (*get_dma_delay) (struct usb2_bus *, uint32_t *pdelay); ==== //depot/projects/usb/src/sys/dev/usb2/controller/uss820dci.c#24 (text+ko) ==== @@ -1844,7 +1844,6 @@ struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus); uint16_t value; uint16_t index; - uint8_t use_polling; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -1862,8 +1861,6 @@ value = UGETW(std->req.wValue); index = UGETW(std->req.wIndex); - use_polling = mtx_owned(xfer->xroot->xfer_mtx) ? 1 : 0; - /* demultiplex the control request */ switch (std->req.bmRequestType) { @@ -2481,7 +2478,6 @@ .pipe_init = &uss820dci_pipe_init, .xfer_setup = &uss820dci_xfer_setup, .xfer_unsetup = &uss820dci_xfer_unsetup, - .do_poll = &uss820dci_do_poll, .get_hw_ep_profile = &uss820dci_get_hw_ep_profile, .set_stall = &uss820dci_set_stall, .clear_stall = &uss820dci_clear_stall, ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_core.h#37 (text+ko) ==== @@ -34,10 +34,6 @@ /* Default USB configuration */ -#ifndef USB_NO_POLL -#define USB_NO_POLL 0 -#endif - #ifndef USB_USE_CONDVAR #define USB_USE_CONDVAR 0 #endif ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#34 (text+ko) ==== @@ -201,10 +201,6 @@ * o USB_SHORT_XFER_OK: allows the data transfer to be shorter than * specified * - * o USB_USE_POLLING: forces the transfer to complete from the - * current context by polling the interrupt handler. This flag can be - * used to perform USB transfers after that the kernel has crashed. - * * o USB_DELAY_STATUS_STAGE: allows the status stage to be performed * at a later point in time. This is tunable by the "hw.usb.ss_delay" * sysctl. This flag is mostly useful for debugging. @@ -385,12 +381,8 @@ usb2_transfer_start(xfer); while (usb2_transfer_pending(xfer)) { - if ((flags & USB_USE_POLLING) || cold) { - usb2_do_poll(udev->default_xfer, USB_DEFAULT_XFER_MAX); - } else { - usb2_cv_wait(udev->default_cv, - xfer->xroot->xfer_mtx); - } + usb2_cv_wait(udev->default_cv, + xfer->xroot->xfer_mtx); } err = xfer->error; ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#45 (text+ko) ==== @@ -2705,120 +2705,14 @@ return (1); /* Clear Stall Finished */ } -#if (USB_NO_POLL == 0) - -/*------------------------------------------------------------------------* - * usb2_callout_poll - *------------------------------------------------------------------------*/ -static void -usb2_callout_poll(struct usb2_xfer *xfer) -{ - struct usb2_callout *co; - void (*cb) (void *); - void *arg; - struct mtx *mtx; - uint32_t delta; - - if (xfer == NULL) { - return; - } - co = &xfer->timeout_handle; - -#if __FreeBSD_version >= 800000 - mtx = (void *)(co->co.c_lock); -#else - mtx = co->co.c_mtx; -#endif - mtx_lock(mtx); - - if (usb2_callout_pending(co)) { - delta = ticks - co->co.c_time; - if (!(delta & 0x80000000)) { - - cb = co->co.c_func; - arg = co->co.c_arg; - - /* timed out */ - usb2_callout_stop(co); - - (cb) (arg); - } - } - mtx_unlock(mtx); -} - - -/*------------------------------------------------------------------------* - * usb2_do_poll - * - * This function is called from keyboard driver when in polling - * mode. - *------------------------------------------------------------------------*/ void usb2_do_poll(struct usb2_xfer **ppxfer, uint16_t max) { - struct usb2_xfer *xfer; - struct usb2_xfer_root *xroot; - struct usb2_device *udev; - struct usb2_proc_msg *pm; - uint32_t to; - uint16_t n; - - /* compute system tick delay */ - to = ((uint32_t)(1000000)) / ((uint32_t)(hz)); - DELAY(to); - atomic_add_int((volatile int *)&ticks, 1); - - for (n = 0; n != max; n++) { - xfer = ppxfer[n]; - if (xfer) { - xroot = xfer->xroot; - udev = xroot->udev; - - /* - * Poll hardware - signal that we are polling by - * locking the private mutex: - */ - USB_XFER_LOCK(xfer); - (udev->bus->methods->do_poll) (udev->bus); - USB_XFER_UNLOCK(xfer); - - /* poll clear stall start */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &udev->cs_msg[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - - if (udev->default_xfer[1]) { - - /* poll timeout */ - usb2_callout_poll(udev->default_xfer[1]); - - /* poll clear stall done thread */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &udev->default_xfer[1]-> - xroot->done_m[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - } - /* poll timeout */ - usb2_callout_poll(xfer); - - /* poll done thread */ - USB_BUS_LOCK(xfer->xroot->bus); - pm = &xroot->done_m[0].hdr; - (pm->pm_callback) (pm); - USB_BUS_UNLOCK(xfer->xroot->bus); - } + static uint8_t once = 0; + /* polling is currently not supported */ + if (!once) { + once = 1; + printf("usb2_do_poll: USB polling is " + "not supported!\n"); } } - -#else - -void -usb2_do_poll(struct usb2_xfer **ppxfer, uint16_t max) -{ - /* polling not supported */ -} - -#endif ==== //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#30 (text+ko) ==== @@ -48,7 +48,6 @@ struct usb2_ctl_request { void *ucr_data; uint16_t ucr_flags; -#define USB_USE_POLLING 0x0001 /* internal flag */ #define USB_SHORT_XFER_OK 0x0004 /* allow short reads */ #define USB_DELAY_STATUS_STAGE 0x0010 /* insert delay before STATUS stage */ #define USB_USER_DATA_PTR 0x0020 /* internal flag */ From owner-p4-projects@FreeBSD.ORG Tue Feb 17 19:21:12 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3CB49106566C; Tue, 17 Feb 2009 19:21:12 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0B61106566B for ; Tue, 17 Feb 2009 19:21:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DDED98FC19 for ; Tue, 17 Feb 2009 19:21:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HJLBn8096841 for ; Tue, 17 Feb 2009 19:21:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HJLBJw096839 for perforce@freebsd.org; Tue, 17 Feb 2009 19:21:11 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 17 Feb 2009 19:21:11 GMT Message-Id: <200902171921.n1HJLBJw096839@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157855 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 19:21:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=157855 Change 157855 by hselasky@hselasky_laptop001 on 2009/02/17 19:20:39 USB documentation: Update. Affected files ... .. //depot/projects/usb/src/share/man/man4/usb2_core.4#6 edit .. //depot/projects/usb/src/sys/dev/usb2/core/README.TXT#8 edit Differences ... ==== //depot/projects/usb/src/share/man/man4/usb2_core.4#6 (text+ko) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 20, 2008 +.Dd February 17, 2009 .Dt USB2_CORE 4 .Os . @@ -459,6 +459,11 @@ This flag allows the received transfer length, "xfer->actlen" to be less than "xfer->sumlen" upon completion of a transfer. This flag can be changed during operation. +.It short_frames_ok +This flag allows the reception of multiple short USB frames. This flag +only has effect for BULK and INTERRUPT endpoints and if the number of +frames received is greater than 1. This flag can be changed during +operation. .It pipe_bof This flag causes a failing USB transfer to remain first in the PIPE queue except in the case of "xfer->error" equal to ==== //depot/projects/usb/src/sys/dev/usb2/core/README.TXT#8 (text+ko) ==== @@ -1,411 +1,6 @@ $FreeBSD: src/sys/dev/usb2/core/README.TXT,v 1.1 2008/11/04 02:31:03 alfred Exp $ -DESCRIPTION OF THE NEW USB API - -The new USB 2.0 API consists of 5 functions. All transfer types are -managed using these functions. There is no longer need for separate -functions to setup INTERRUPT- and ISOCHRONOUS- transfers. - -+--------------------------------------------------------------+ -| | -| "usb2_transfer_setup" - This function will allocate all | -| necessary DMA memory and might | -| sleep! | -| | -| "usb2_transfer_unsetup" - This function will stop the USB | -| transfer, if it is currently | -| active, release all DMA | -| memory and might sleep! | -| | -| "usb2_transfer_start" - This function will start an USB | -| transfer, if not already started.| -| This function is always | -| non-blocking. ** | -| | -| "usb2_transfer_stop" - This function will stop an USB | -| transfer, if not already stopped.| -| The callback function will be | -| called before this function | -| returns. This function is always | -| non-blocking. ** | -| | -| "usb2_transfer_drain" - This function will stop an USB | -| transfer, if not already stopped | -| and wait for any additional | -| DMA load operations to complete. | -| Buffers that are loaded into DMA | -| using "usb2_set_frame_data" can | -| safely be freed after that | -| this function has returned. This | -| function can block the caller. | -| | -| ** These functions must be called with the private driver's | -| lock locked. | -| | -| NOTE: These USB API functions are NULL safe, with regard | -| to the USB transfer structure pointer. | -+--------------------------------------------------------------+ - -Reference: /sys/dev/usb2/core/usb2_transfer.c - -/* - * A simple USB callback state-machine: - * - * +->-----------------------+ - * | | - * +-<-+-------[tr_setup]--------+-<-+-<-[start/restart] - * | | - * | | - * | | - * +------>-[tr_transferred]---------+ - * | | - * +--------->-[tr_error]------------+ - */ - -void -usb2_default_callback(struct usb2_xfer *xfer) -{ - /* - * NOTE: it is not allowed to return - * before "USB_CHECK_STATUS()", - * even if the system is tearing down! - */ - switch (USB_GET_STATE(xfer)) { - case USB_ST_SETUP: - /* - * Setup xfer->frlengths[], xfer->nframes - * and write data to xfer->frbuffers[], if any - */ - - /**/ - usb2_start_hardware(xfer); - return; - - case USB_ST_TRANSFERRED: - /* - * Read data from xfer->frbuffers[], if any. - * "xfer->frlengths[]" should now have been - * updated to the actual length. - */ - return; - - default: /* Error */ - /* print error message and clear stall for example */ - return; - } -} - -=== Notes for USB control transfers === - -An USB control transfer has three parts. First the SETUP packet, then -DATA packet(s) and then a STATUS packet. The SETUP packet is always -pointed to by "xfer->frbuffers[0]" and the length is stored in -"xfer->frlengths[0]" also if there should not be sent any SETUP -packet! If an USB control transfer has no DATA stage, then -"xfer->nframes" should be set to 1. Else the default value is -"xfer->nframes" equal to 2. - -Example1: SETUP + STATUS - xfer->nframes = 1; - xfer->frlenghts[0] = 8; - usb2_start_hardware(xfer); - -Example2: SETUP + DATA + STATUS - xfer->nframes = 2; - xfer->frlenghts[0] = 8; - xfer->frlenghts[1] = 1; - usb2_start_hardware(xfer); - -Example3: SETUP + DATA + STATUS - split -1st callback: - xfer->nframes = 1; - xfer->frlenghts[0] = 8; - usb2_start_hardware(xfer); - -2nd callback: - /* IMPORTANT: frbuffer[0] must still point at the setup packet! */ - xfer->nframes = 2; - xfer->frlenghts[0] = 0; - xfer->frlenghts[1] = 1; - usb2_start_hardware(xfer); - -Example4: SETUP + STATUS - split -1st callback: - xfer->nframes = 1; - xfer->frlenghts[0] = 8; - xfer->flags.manual_status = 1; - usb2_start_hardware(xfer); - -2nd callback: - xfer->nframes = 1; - xfer->frlenghts[0] = 0; - xfer->flags.manual_status = 0; - usb2_start_hardware(xfer); - - -=== General USB transfer notes === - - 1) Something that one should be aware of is that all USB callbacks support -recursation. That means one can start/stop whatever transfer from the callback -of another transfer one desires. Also the transfer that is currently called -back. Recursion is handled like this that when the callback that wants to -recurse returns it is called one more time. - - 2) After that the "usb2_start_hardware()" function has been called in -the callback one can always depend on that "tr_error" or "tr_transferred" -will get jumped afterwards. Always! - - 3) Sleeping functions can only be called from the attach routine of the -driver. Else one should not use sleeping functions unless one has to. It is -very difficult with sleep, because one has to think that the device might have -detached when the thread returns from sleep. - - 4) Polling. - - use_polling - This flag can be used with any callback and will cause the - "usb2_transfer_start()" function to wait using "DELAY()", - without exiting any mutexes, until the transfer is finished or - has timed out. This flag can be changed during operation. - - NOTE: If polling is used the "timeout" field should be non-zero! - NOTE: USB_ERR_CANCELLED is returned in case of timeout - instead of USB_ERR_TIMEOUT! - - - -USB device driver examples: - -/sys/dev/usb2/ethernet/if_axe.c -/sys/dev/usb2/ethernet/if_aue.c - -QUICK REFERENCE -=============== - - -/*------------------------------------------------------------------------* - * usb2_error_t - * usb2_transfer_setup(udev, ifaces, pxfer, setup_start, - * n_setup, priv_sc, priv_mtx) - *------------------------------------------------------------------------*/ - -- "udev" is a pointer to "struct usb2_device". - -- "ifaces" array of interface index numbers to use. See "if_index". - -- "pxfer" is a pointer to an array of USB transfer pointers that are - initialized to NULL, and then pointed to allocated USB transfers. - -- "setup_start" is a pointer to an array of USB config structures. - -- "n_setup" is a number telling the USB system how many USB transfers - should be setup. - -- "priv_sc" is the private softc pointer, which will be used to - initialize "xfer->priv_sc". - -- "priv_mtx" is the private mutex protecting the transfer structure and - the softc. This pointer is used to initialize "xfer->priv_mtx". - -/*------------------------------------------------------------------------* - * void - * usb2_transfer_unsetup(pxfer, n_setup) - *------------------------------------------------------------------------*/ - -- "pxfer" is a pointer to an array of USB transfer pointers, that may - be NULL, that should be freed by the USB system. - -- "n_setup" is a number telling the USB system how many USB transfers - should be unsetup - -NOTE: This function can sleep, waiting for active mutexes to become unlocked! -NOTE: It is not allowed to call "usb2_transfer_unsetup" from the callback - of a USB transfer. - -/*------------------------------------------------------------------------* - * void - * usb2_transfer_start(xfer) - *------------------------------------------------------------------------*/ - -- "xfer" is pointer to a USB transfer that should be started - -NOTE: this function must be called with "priv_mtx" locked - -/*------------------------------------------------------------------------* - * void - * usb2_transfer_stop(xfer) - *------------------------------------------------------------------------*/ - -- "xfer" is a pointer to a USB transfer that should be stopped - -NOTE: this function must be called with "priv_mtx" locked - -NOTE: if the transfer was in progress, the callback will called with - "xfer->error=USB_ERR_CANCELLED", before this function returns - -/*------------------------------------------------------------------------* - * struct usb2_config { - * type, endpoint, direction, interval, timeout, frames, index - * flags, bufsize, callback - * }; - *------------------------------------------------------------------------*/ - -- The "type" field selects the USB pipe type. Valid values are: - UE_INTERRUPT, UE_CONTROL, UE_BULK, UE_ISOCHRONOUS. The special - value UE_BULK_INTR will select BULK and INTERRUPT pipes. - This field is mandatory. - -- The "endpoint" field selects the USB endpoint number. A value of - 0xFF, "-1" or "UE_ADDR_ANY" will select the first matching endpoint. - This field is mandatory. - -- The "direction" field selects the USB endpoint direction. A value of - "UE_DIR_ANY" will select the first matching endpoint. Else valid - values are: "UE_DIR_IN" and "UE_DIR_OUT". "UE_DIR_IN" and - "UE_DIR_OUT" can be binary ORed by "UE_DIR_SID" which means that the - direction will be swapped in case of USB_MODE_DEVICE. Note that - "UE_DIR_IN" refers to the data transfer direction of the "IN" tokens - and "UE_DIR_OUT" refers to the data transfer direction of the "OUT" - tokens. This field is mandatory. - -- The "interval" field selects the interrupt interval. The value of this - field is given in milliseconds and is independent of device speed. Depending - on the endpoint type, this field has different meaning: - - UE_INTERRUPT) - "0" use the default interrupt interval based on endpoint descriptor. - "Else" use the given value for polling rate. - - UE_ISOCHRONOUS) - "0" use default. - "Else" the value is ignored. - - UE_BULK) - UE_CONTROL) - "0" no transfer pre-delay. - "Else" a delay as given by this field in milliseconds is - inserted before the hardware is started when - "usb2_start_hardware()" is called. - NOTE: The transfer timeout, if any, is started after that - the pre-delay has elapsed! - -- The "timeout" field, if non-zero, will set the transfer timeout in - milliseconds. If the "timeout" field is zero and the transfer type - is ISOCHRONOUS a timeout of 250ms will be used. - -- The "frames" field sets the maximum number of frames. If zero is - specified it will yield the following results: - - UE_BULK) - UE_INTERRUPT) - xfer->nframes = 1; - - UE_CONTROL) - xfer->nframes = 2; - - UE_ISOCHRONOUS) - Not allowed. Will cause an error. - -- The "ep_index" field allows you to give a number, in case more - endpoints match the description, that selects which matching - "ep_index" should be used. - -- The "if_index" field allows you to select which of the interface - numbers in the "ifaces" array parameter passed to "usb2_transfer_setup" - that should be used when setting up the given USB transfer. - -- The "flags" field has type "struct usb2_xfer_flags" and allows one - to set initial flags an USB transfer. Valid flags are: - - force_short_xfer - This flag forces the last transmitted USB packet to be short. - A short packet has a length of less than "xfer->max_packet_size", - which derives from "wMaxPacketSize". This flag can be changed - during operation. - - short_xfer_ok - This flag allows the received transfer length, "xfer->actlen" - to be less than "xfer->sumlen" upon completion of a transfer. - This flag can be changed during operation. - - pipe_bof - This flag causes a failing USB transfer to remain first - in the PIPE queue except in the case of "xfer->error" equal - to "USB_ERR_CANCELLED". No other USB transfers in the affected - PIPE queue will be started until either: - - 1) The failing USB transfer is stopped using "usb2_transfer_stop()". - 2) The failing USB transfer performs a successful transfer. - - The purpose of this flag is to avoid races when multiple - transfers are queued for execution on an USB endpoint, and the - first executing transfer fails leading to the need for - clearing of stall for example. In this case this flag is used - to prevent the following USB transfers from being executed at - the same time the clear-stall command is executed on the USB - control endpoint. This flag can be changed during operation. - - "BOF" is short for "Block On Failure" - - NOTE: This flag should be set on all BULK and INTERRUPT - USB transfers which use an endpoint that can be shared - between userland and kernel. - - proxy_buffer - Setting this flag will cause that the total buffer size will - be rounded up to the nearest atomic hardware transfer - size. The maximum data length of any USB transfer is always - stored in the "xfer->max_data_length". For control transfers - the USB kernel will allocate additional space for the 8-bytes - of SETUP header. These 8-bytes are not counted by the - "xfer->max_data_length" variable. This flag can not be changed - during operation. - - ext_buffer - Setting this flag will cause that no data buffer will be - allocated. Instead the USB client must supply a data buffer. - This flag can not be changed during operation. - - manual_status - Setting this flag prevents an USB STATUS stage to be appended - to the end of the USB control transfer. If no control data is - transferred this flag must be cleared. Else an error will be - returned to the USB callback. This flag is mostly useful for - the USB device side. This flag can be changed during - operation. - - no_pipe_ok - Setting this flag causes the USB_ERR_NO_PIPE error to be - ignored. This flag can not be changed during operation. - - stall_pipe - Setting this flag will cause STALL pids to be sent to the - endpoint belonging to this transfer before the transfer is - started. The transfer is started at the moment the host issues - a clear-stall command on the STALL'ed endpoint. This flag can - be changed during operation. This flag does only have effect - in USB device side mode except for control endpoints. This - flag is cleared when the stall command has been executed. This - flag can only be changed outside the callback function by - using the functions "usb2_transfer_set_stall()" and - "usb2_transfer_clear_stall()" ! - -- The "bufsize" field sets the total buffer size in bytes. If - this field is zero, "wMaxPacketSize" will be used, multiplied by the - "frames" field if the transfer type is ISOCHRONOUS. This is useful for - setting up interrupt pipes. This field is mandatory. - - NOTE: For control transfers "bufsize" includes - the length of the request structure. - -- The "callback" pointer sets the USB callback. This field is mandatory. - -MUTEX NOTE: -=========== - -When you create a mutex using "mtx_init()", don't forget to call -"mtx_destroy()" at detach, else you can get "freed memory accessed" -panics. +Please see "man usb2_core" or "src/share/man/man4/usb2_core.4". --HPS From owner-p4-projects@FreeBSD.ORG Tue Feb 17 21:14:07 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9BEEA1065679; Tue, 17 Feb 2009 21:14:07 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 575CA106568D for ; Tue, 17 Feb 2009 21:14:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4436F8FC22 for ; Tue, 17 Feb 2009 21:14:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLE7O0017451 for ; Tue, 17 Feb 2009 21:14:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HLE7bq017449 for perforce@freebsd.org; Tue, 17 Feb 2009 21:14:07 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 17 Feb 2009 21:14:07 GMT Message-Id: <200902172114.n1HLE7bq017449@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157863 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:14:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=157863 Change 157863 by hselasky@hselasky_laptop001 on 2009/02/17 21:13:56 USB HID support: - Change the way we obtain the report ID. - Use the X/Y/Z+button locations instead for report ID source for ums. - Add more range checks. - Remove Microsoft Mouse quirks. If the positions are moduloed the report length multiplied by 8, the values seem correct. - Some minor style changes. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.c#10 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.h#10 edit .. //depot/projects/usb/src/sys/dev/usb2/input/ums2.c#15 edit .. //depot/projects/usb/src/sys/dev/usb2/quirk/usb2_quirk.c#15 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.c#10 (text+ko) ==== @@ -155,7 +155,7 @@ } for (;;) { p = s->p; - if (p >= s->end) + if ((p >= s->end) || (p < s->start)) return (0); bSize = *p++; @@ -388,48 +388,53 @@ * hid_report_size *------------------------------------------------------------------------*/ int -hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *idp) +hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *id) { struct hid_data *d; struct hid_item h; - uint32_t size; - uint32_t hi; - uint32_t lo; - uint8_t id; + uint32_t temp; + uint32_t hpos; + uint32_t lpos; + uint8_t any_id; + + any_id = 0; + hpos = 0; + lpos = 0xFFFFFFFF; - id = 0; - hi = 0; - lo = (uint32_t)(0-1); - for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) + for (d = hid_start_parse(buf, len, 1 << k); hid_get_item(d, &h);) { if (h.kind == k) { - if (h.report_ID != 0 && !id) - id = h.report_ID; - if (h.report_ID == id) { - /* check if "lo" is greater than "pos" */ - if (lo > h.loc.pos) - lo = h.loc.pos; - /* compute end position */ - size = h.loc.pos + (h.loc.size * h.loc.count); - /* check if "size" wrapped */ - /* check if "hi" is less than "size" */ - if (size < h.loc.pos) - hi = (uint32_t)(0-1); - else if (hi < size) - hi = size; + /* check for ID-byte presense */ + if ((h.report_ID != 0) && !any_id) { + if (id != NULL) + *id = h.report_ID; + any_id = 1; } + /* compute minimum */ + if (lpos > h.loc.pos) + lpos = h.loc.pos; + /* compute end position */ + temp = h.loc.pos + (h.loc.size * h.loc.count); + /* compute maximum */ + if (hpos < temp) + hpos = temp; } + } hid_end_parse(d); - if (lo > hi) - size = 0; + + /* safety check - can happen in case of currupt descriptors */ + if (lpos > hpos) + temp = 0; else - size = hi - lo; + temp = hpos - lpos; + + /* check for ID byte */ + if (any_id) + temp += 8; + else if (id != NULL) + *id = 0; - if (id != 0) { - size += 8; - *idp = id; /* XXX wrong */ - } else - *idp = 0; - return ((size + 7) / 8); + /* return length in bytes rounded up */ + return ((temp + 7) / 8); } /*------------------------------------------------------------------------* @@ -437,7 +442,7 @@ *------------------------------------------------------------------------*/ int hid_locate(const void *desc, int size, uint32_t u, enum hid_kind k, - struct hid_location *loc, uint32_t *flags) + struct hid_location *loc, uint32_t *flags, uint8_t *id) { struct hid_data *d; struct hid_item h; @@ -448,12 +453,19 @@ *loc = h.loc; if (flags != NULL) *flags = h.flags; + if (id != NULL) + *id = h.report_ID; hid_end_parse(d); return (1); } } + if (loc != NULL) + loc->size = 0; + if (flags != NULL) + *flags = 0; + if (id != NULL) + *id = 0; hid_end_parse(d); - loc->size = 0; return (0); } @@ -466,26 +478,35 @@ uint32_t hpos = loc->pos; uint32_t hsize = loc->size; uint32_t data; - int i, s, t; + uint32_t rpos; + uint8_t n; DPRINTFN(11, "hid_get_data: loc %d/%d\n", hpos, hsize); + /* Range check and limit */ if (hsize == 0) return (0); + if (hsize > 32) + hsize = 32; + /* Get data in a safe way */ data = 0; - s = hpos / 8; - for (i = hpos; i < (hpos + hsize); i += 8) { - t = (i / 8); - if (t < len) { - data |= buf[t] << ((t - s) * 8); - } + rpos = (hpos / 8); + n = (hsize + 7) / 8; + rpos += n; + while (n--) { + rpos--; + if (rpos < len) + data |= buf[rpos] << (8 * n); } - data >>= hpos % 8; - data &= (1 << hsize) - 1; - hsize = 32 - hsize; - /* Sign extend */ - data = ((int32_t)data << hsize) >> hsize; + + /* Correctly shift down data */ + data = (data >> (hpos % 8)); + + /* Mask and sign extend in one */ + n = 32 - hsize; + data = ((int32_t)data << n) >> n; + DPRINTFN(11, "hid_get_data: loc %d/%d = %lu\n", loc->pos, loc->size, (long)data); return (data); ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hid.h#10 (text+ko) ==== @@ -79,9 +79,11 @@ struct hid_data *hid_start_parse(const void *d, int len, int kindset); void hid_end_parse(struct hid_data *s); int hid_get_item(struct hid_data *s, struct hid_item *h); -int hid_report_size(const void *buf, int len, enum hid_kind k, uint8_t *id); +int hid_report_size(const void *buf, int len, enum hid_kind k, + uint8_t *id); int hid_locate(const void *desc, int size, uint32_t usage, - enum hid_kind kind, struct hid_location *loc, uint32_t *flags); + enum hid_kind kind, struct hid_location *loc, + uint32_t *flags, uint8_t *id); uint32_t hid_get_data(const uint8_t *buf, uint32_t len, struct hid_location *loc); int hid_is_collection(const void *desc, int size, uint32_t usage); ==== //depot/projects/usb/src/sys/dev/usb2/input/ums2.c#15 (text+ko) ==== @@ -89,8 +89,7 @@ enum { UMS_INTR_DT, - UMS_INTR_CS, - UMS_N_TRANSFER = 2, + UMS_N_TRANSFER, }; struct ums_softc { @@ -115,9 +114,8 @@ #define UMS_FLAG_Z_AXIS 0x0004 #define UMS_FLAG_T_AXIS 0x0008 #define UMS_FLAG_SBU 0x0010 /* spurious button up events */ -#define UMS_FLAG_INTR_STALL 0x0020 /* set if transfer error */ -#define UMS_FLAG_REVZ 0x0040 /* Z-axis is reversed */ -#define UMS_FLAG_W_AXIS 0x0080 +#define UMS_FLAG_REVZ 0x0020 /* Z-axis is reversed */ +#define UMS_FLAG_W_AXIS 0x0040 uint8_t sc_buttons; uint8_t sc_iid; @@ -126,7 +124,6 @@ static void ums_put_queue_timeout(void *__sc); -static usb2_callback_t ums_clear_stall_callback; static usb2_callback_t ums_intr_callback; static device_probe_t ums_probe; @@ -161,19 +158,6 @@ } static void -ums_clear_stall_callback(struct usb2_xfer *xfer) -{ - struct ums_softc *sc = xfer->priv_sc; - struct usb2_xfer *xfer_other = sc->sc_xfer[UMS_INTR_DT]; - - if (usb2_clear_stall_callback(xfer, xfer_other)) { - DPRINTF("stall cleared\n"); - sc->sc_flags &= ~UMS_FLAG_INTR_STALL; - usb2_transfer_start(xfer_other); - } -} - -static void ums_intr_callback(struct usb2_xfer *xfer) { struct ums_softc *sc = xfer->priv_sc; @@ -196,9 +180,9 @@ sizeof(sc->sc_temp)); len = sizeof(sc->sc_temp); } - if (len == 0) { + if (len == 0) goto tr_setup; - } + usb2_copy_out(xfer->frbuffers, 0, buf, len); DPRINTFN(6, "data = %02x %02x %02x %02x " @@ -209,21 +193,23 @@ (len > 6) ? buf[6] : 0, (len > 7) ? buf[7] : 0); /* - * The M$ Wireless Intellimouse 2.0 sends 1 extra leading byte - * of data compared to most USB mice. This byte frequently - * switches from 0x01 (usual state) to 0x02. I assume it is to - * allow extra, non-standard, reporting (say battery-life). + * The M$ Wireless Intellimouse 2.0 sends 1 extra + * leading byte of data compared to most USB + * mice. This byte frequently switches from 0x01 + * (usual state) to 0x02. I assume it is to allow + * extra, non-standard, reporting (say battery-life). * - * However at the same time it generates a left-click message - * on the button byte which causes spurious left-click's where - * there shouldn't be. This should sort that. Currently it's - * the only user of UMS_FLAG_T_AXIS so use it as an - * identifier. + * However at the same time it generates a left-click + * message on the button byte which causes spurious + * left-click's where there shouldn't be. This should + * sort that. Currently it's the only user of + * UMS_FLAG_T_AXIS so use it as an identifier. * * - * UPDATE: This problem affects the M$ Wireless Notebook Optical Mouse, - * too. However, the leading byte for this mouse is normally 0x11, - * and the phantom mouse click occurs when its 0x14. + * UPDATE: This problem affects the M$ Wireless + * Notebook Optical Mouse, too. However, the leading + * byte for this mouse is normally 0x11, and the + * phantom mouse click occurs when its 0x14. * * We probably should switch to some more official quirk. */ @@ -289,12 +275,14 @@ */ /* - * The Qtronix keyboard has a built in PS/2 port for a mouse. - * The firmware once in a while posts a spurious button up - * event. This event we ignore by doing a timeout for 50 msecs. - * If we receive dx=dy=dz=buttons=0 before we add the event to - * the queue. - * In any other case we delete the timeout event. + * The Qtronix keyboard has a built in PS/2 + * port for a mouse. The firmware once in a + * while posts a spurious button up + * event. This event we ignore by doing a + * timeout for 50 msecs. If we receive + * dx=dy=dz=buttons=0 before we add the event + * to the queue. In any other case we delete + * the timeout event. */ if ((sc->sc_flags & UMS_FLAG_SBU) && (dx == 0) && (dy == 0) && (dz == 0) && (dt == 0) && @@ -311,25 +299,21 @@ } case USB_ST_SETUP: tr_setup: - if (sc->sc_flags & UMS_FLAG_INTR_STALL) { - usb2_transfer_start(sc->sc_xfer[UMS_INTR_CS]); - } else { - /* check if we can put more data into the FIFO */ - if (usb2_fifo_put_bytes_max( - sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { - xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); - } + /* check if we can put more data into the FIFO */ + if (usb2_fifo_put_bytes_max( + sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { + xfer->frlengths[0] = xfer->max_data_length; + usb2_start_hardware(xfer); } - return; + break; default: /* Error */ if (xfer->error != USB_ERR_CANCELLED) { - /* start clear stall */ - sc->sc_flags |= UMS_FLAG_INTR_STALL; - usb2_transfer_start(sc->sc_xfer[UMS_INTR_CS]); + /* try clear stall first */ + xfer->flags.stall_pipe = 1; + goto tr_setup; } - return; + break; } } @@ -343,16 +327,6 @@ .mh.bufsize = 0, /* use wMaxPacketSize */ .mh.callback = &ums_intr_callback, }, - - [UMS_INTR_CS] = { - .type = UE_CONTROL, - .endpoint = 0x00, /* Control pipe */ - .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb2_device_request), - .mh.callback = &ums_clear_stall_callback, - .mh.timeout = 1000, /* 1 second */ - .mh.interval = 50, /* 50ms */ - }, }; static int @@ -361,39 +335,34 @@ struct usb2_attach_arg *uaa = device_get_ivars(dev); struct usb2_interface_descriptor *id; void *d_ptr; - int32_t error = 0; + int error; uint16_t d_len; DPRINTFN(11, "\n"); - if (uaa->usb2_mode != USB_MODE_HOST) { + if (uaa->usb2_mode != USB_MODE_HOST) return (ENXIO); - } - if (uaa->iface == NULL) { - return (ENXIO); - } + id = usb2_get_interface_descriptor(uaa->iface); if ((id == NULL) || - (id->bInterfaceClass != UICLASS_HID)) { + (id->bInterfaceClass != UICLASS_HID)) return (ENXIO); - } - error = usb2_req_get_hid_desc - (uaa->device, &Giant, + + error = usb2_req_get_hid_desc(uaa->device, &Giant, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); - if (error) { + if (error) return (ENXIO); - } + if (hid_is_collection(d_ptr, d_len, - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) { + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) error = 0; - } else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) && - (id->bInterfaceProtocol == UIPROTO_MOUSE)) { + else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) && + (id->bInterfaceProtocol == UIPROTO_MOUSE)) error = 0; - } else { + else error = ENXIO; - } free(d_ptr, M_TEMP); return (error); @@ -406,9 +375,10 @@ struct ums_softc *sc = device_get_softc(dev); void *d_ptr = NULL; int unit = device_get_unit(dev); - int32_t isize; + int isize; + int isizebits; + int err; uint32_t flags; - int32_t err; uint16_t d_len; uint8_t i; @@ -445,14 +415,14 @@ goto detach; } if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), - hid_input, &sc->sc_loc_x, &flags)) { + hid_input, &sc->sc_loc_x, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_X_AXIS; } } if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y), - hid_input, &sc->sc_loc_y, &flags)) { + hid_input, &sc->sc_loc_y, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Y_AXIS; @@ -460,9 +430,9 @@ } /* Try the wheel first as the Z activator since it's tradition. */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags) || + HUG_WHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid) || hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_TWHEEL), hid_input, &sc->sc_loc_z, &flags)) { + HUG_TWHEEL), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Z_AXIS; } @@ -471,14 +441,14 @@ * put the Z on the W coordinate. */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_w, &flags)) { + HUG_Z), hid_input, &sc->sc_loc_w, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_W_AXIS; } } } else if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, - HUG_Z), hid_input, &sc->sc_loc_z, &flags)) { + HUG_Z), hid_input, &sc->sc_loc_z, &flags, &sc->sc_iid)) { if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) { sc->sc_flags |= UMS_FLAG_Z_AXIS; @@ -492,7 +462,7 @@ * TWHEEL */ if (hid_locate(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_TWHEEL), - hid_input, &sc->sc_loc_t, &flags)) { + hid_input, &sc->sc_loc_t, &flags, &sc->sc_iid)) { sc->sc_loc_t.pos += 8; @@ -504,14 +474,14 @@ for (i = 0; i < UMS_BUTTON_MAX; i++) { if (!hid_locate(d_ptr, d_len, HID_USAGE2(HUP_BUTTON, (i + 1)), - hid_input, &sc->sc_loc_btn[i], NULL)) { + hid_input, &sc->sc_loc_btn[i], NULL, &sc->sc_iid)) { break; } } sc->sc_buttons = i; - isize = hid_report_size(d_ptr, d_len, hid_input, &sc->sc_iid); + isize = hid_report_size(d_ptr, d_len, hid_input, NULL); /* * The Microsoft Wireless Notebook Optical Mouse seems to be in worse @@ -535,27 +505,22 @@ sc->sc_loc_btn[1].pos = 9; sc->sc_loc_btn[2].pos = 10; } + /* - * The Microsoft Wireless Notebook Optical Mouse 3000 Model 1049 has - * five Report IDs: 19 23 24 17 18 (in the order they appear in report - * descriptor), it seems that report id 17 contains the necessary - * mouse information(3-buttons,X,Y,wheel) so we specify it manually. + * Some Microsoft devices have incorrectly high location + * positions. Correct this: */ - if ((uaa->info.idVendor == USB_VENDOR_MICROSOFT) && - (uaa->info.idProduct == USB_PRODUCT_MICROSOFT_WLNOTEBOOK3)) { - sc->sc_flags = (UMS_FLAG_X_AXIS | - UMS_FLAG_Y_AXIS | - UMS_FLAG_Z_AXIS); - sc->sc_buttons = 3; - isize = 5; - sc->sc_iid = 17; - sc->sc_loc_x.pos = 8; - sc->sc_loc_y.pos = 16; - sc->sc_loc_z.pos = 24; - sc->sc_loc_btn[0].pos = 0; - sc->sc_loc_btn[1].pos = 1; - sc->sc_loc_btn[2].pos = 2; + isizebits = isize * 8; + if (isizebits <= 0) { + sc->sc_loc_w.pos %= isizebits; + sc->sc_loc_x.pos %= isizebits; + sc->sc_loc_y.pos %= isizebits; + sc->sc_loc_z.pos %= isizebits; + sc->sc_loc_t.pos %= isizebits; + for (i = 0; i != UMS_BUTTON_MAX; i++) + sc->sc_loc_btn[i].pos %= isizebits; } + if (usb2_test_quirk(uaa, UQ_MS_REVZ)) { /* Some wheels need the Z axis reversed. */ sc->sc_flags |= UMS_FLAG_REVZ; @@ -670,7 +635,6 @@ { struct ums_softc *sc = fifo->priv_sc0; - usb2_transfer_stop(sc->sc_xfer[UMS_INTR_CS]); usb2_transfer_stop(sc->sc_xfer[UMS_INTR_DT]); usb2_callout_stop(&sc->sc_callout); } ==== //depot/projects/usb/src/sys/dev/usb2/quirk/usb2_quirk.c#15 (text+ko) ==== @@ -105,10 +105,7 @@ {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR, UQ_NONE)}, /* MS keyboards do weird things */ - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLNOTEBOOK2, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_COMFORT3000, 0x0000, 0xFFFF, UQ_MS_BAD_CLASS, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, }; From owner-p4-projects@FreeBSD.ORG Tue Feb 17 21:33:29 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AA63D1065676; Tue, 17 Feb 2009 21:33:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69A5E106564A for ; Tue, 17 Feb 2009 21:33:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 55F2F8FC0A for ; Tue, 17 Feb 2009 21:33:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLXTC2018946 for ; Tue, 17 Feb 2009 21:33:29 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HLXRPP018944 for perforce@freebsd.org; Tue, 17 Feb 2009 21:33:27 GMT (envelope-from julian@freebsd.org) Date: Tue, 17 Feb 2009 21:33:27 GMT Message-Id: <200902172133.n1HLXRPP018944@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157867 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:33:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=157867 Change 157867 by julian@julian_trafmon1 on 2009/02/17 21:33:07 IFC@157864 Affected files ... .. //depot/projects/vimage/src/share/man/man4/re.4#2 integrate .. //depot/projects/vimage/src/share/man/man4/rum.4#2 integrate .. //depot/projects/vimage/src/share/man/man4/smb.4#2 integrate .. //depot/projects/vimage/src/share/man/man4/snd_hda.4#3 integrate .. //depot/projects/vimage/src/share/man/man4/u3g.4#2 integrate .. //depot/projects/vimage/src/share/man/man5/rc.conf.5#4 integrate .. //depot/projects/vimage/src/share/man/man9/lock.9#2 integrate .. //depot/projects/vimage/src/sys/Makefile#12 integrate .. //depot/projects/vimage/src/sys/amd64/amd64/busdma_machdep.c#8 integrate .. //depot/projects/vimage/src/sys/amd64/amd64/pmap.c#23 integrate .. //depot/projects/vimage/src/sys/amd64/conf/DEFAULTS#6 integrate .. //depot/projects/vimage/src/sys/amd64/conf/GENERIC#25 integrate .. //depot/projects/vimage/src/sys/amd64/conf/NOTES#14 integrate .. //depot/projects/vimage/src/sys/amd64/include/legacyvar.h#3 integrate .. //depot/projects/vimage/src/sys/amd64/pci/pci_bus.c#6 integrate .. //depot/projects/vimage/src/sys/arm/arm/busdma_machdep.c#13 integrate .. //depot/projects/vimage/src/sys/arm/arm/genassym.c#7 integrate .. //depot/projects/vimage/src/sys/arm/arm/machdep.c#6 integrate .. //depot/projects/vimage/src/sys/arm/arm/swtch.S#8 integrate .. //depot/projects/vimage/src/sys/arm/include/proc.h#2 integrate .. //depot/projects/vimage/src/sys/arm/include/sysarch.h#3 integrate .. //depot/projects/vimage/src/sys/arm/mv/files.mv#4 integrate .. //depot/projects/vimage/src/sys/arm/xscale/ixp425/avila_machdep.c#13 integrate .. //depot/projects/vimage/src/sys/boot/common/loader.8#7 integrate .. //depot/projects/vimage/src/sys/boot/common/module.c#3 integrate .. //depot/projects/vimage/src/sys/boot/sparc64/loader/main.c#9 integrate .. //depot/projects/vimage/src/sys/cam/cam_periph.c#8 integrate .. //depot/projects/vimage/src/sys/cam/cam_xpt.c#16 integrate .. //depot/projects/vimage/src/sys/cam/scsi/scsi_cd.c#7 integrate .. //depot/projects/vimage/src/sys/cam/scsi/scsi_da.c#16 integrate .. //depot/projects/vimage/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c#7 integrate .. //depot/projects/vimage/src/sys/compat/linprocfs/linprocfs.c#33 integrate .. //depot/projects/vimage/src/sys/compat/linux/linux_file.c#13 integrate .. //depot/projects/vimage/src/sys/compat/linux/linux_getcwd.c#6 integrate .. //depot/projects/vimage/src/sys/compat/svr4/svr4_misc.c#7 integrate .. //depot/projects/vimage/src/sys/conf/NOTES#42 integrate .. //depot/projects/vimage/src/sys/conf/files#54 integrate .. //depot/projects/vimage/src/sys/conf/files.amd64#19 integrate .. //depot/projects/vimage/src/sys/conf/files.i386#26 integrate .. //depot/projects/vimage/src/sys/conf/files.ia64#8 integrate .. //depot/projects/vimage/src/sys/conf/files.pc98#17 integrate .. //depot/projects/vimage/src/sys/conf/files.sparc64#16 integrate .. //depot/projects/vimage/src/sys/conf/options#43 integrate .. //depot/projects/vimage/src/sys/conf/options.amd64#6 integrate .. //depot/projects/vimage/src/sys/conf/options.i386#8 integrate .. //depot/projects/vimage/src/sys/conf/options.ia64#3 integrate .. //depot/projects/vimage/src/sys/conf/options.mips#3 integrate .. //depot/projects/vimage/src/sys/conf/options.pc98#6 integrate .. //depot/projects/vimage/src/sys/crypto/via/padlock.c#8 integrate .. //depot/projects/vimage/src/sys/dev/acpi_support/acpi_panasonic.c#3 integrate .. //depot/projects/vimage/src/sys/dev/acpica/acpi_pcib_acpi.c#6 integrate .. //depot/projects/vimage/src/sys/dev/ae/if_ae.c#3 integrate .. //depot/projects/vimage/src/sys/dev/agp/agp.c#5 integrate .. //depot/projects/vimage/src/sys/dev/an/if_an.c#9 integrate .. //depot/projects/vimage/src/sys/dev/an/if_anreg.h#4 integrate .. //depot/projects/vimage/src/sys/dev/arcmsr/arcmsr.c#10 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-all.c#10 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-all.h#10 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-cbus.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-disk.c#9 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-pci.c#9 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-pci.h#19 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-queue.c#8 integrate .. //depot/projects/vimage/src/sys/dev/ata/ata-usb.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ata/atapi-cam.c#8 integrate .. //depot/projects/vimage/src/sys/dev/ata/atapi-cd.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ata/atapi-fd.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ata/atapi-tape.c#6 integrate .. //depot/projects/vimage/src/sys/dev/ata/chipsets/ata-ahci.c#3 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ah_internal.h#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ah_regdomain.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5212/ar5212.h#3 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5212/ar5212_rfgain.c#3 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5312/ar5312_attach.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ath/if_ath.c#28 integrate .. //depot/projects/vimage/src/sys/dev/ath/if_athioctl.h#5 integrate .. //depot/projects/vimage/src/sys/dev/atkbdc/atkbdc_isa.c#2 integrate .. //depot/projects/vimage/src/sys/dev/bge/if_bge.c#19 integrate .. //depot/projects/vimage/src/sys/dev/bm/if_bm.c#6 integrate .. //depot/projects/vimage/src/sys/dev/cardbus/cardbus_device.c#5 integrate .. //depot/projects/vimage/src/sys/dev/ce/if_ce.c#8 integrate .. //depot/projects/vimage/src/sys/dev/cfi/cfi_core.c#3 integrate .. //depot/projects/vimage/src/sys/dev/cfi/cfi_dev.c#3 integrate .. //depot/projects/vimage/src/sys/dev/cfi/cfi_reg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/cfi/cfi_var.h#2 integrate .. //depot/projects/vimage/src/sys/dev/cm/smc90cx6.c#4 integrate .. //depot/projects/vimage/src/sys/dev/cp/if_cp.c#7 integrate .. //depot/projects/vimage/src/sys/dev/ctau/if_ct.c#8 integrate .. //depot/projects/vimage/src/sys/dev/de/if_de.c#5 integrate .. //depot/projects/vimage/src/sys/dev/exca/exca.c#4 integrate .. //depot/projects/vimage/src/sys/dev/firewire/firewire.c#19 integrate .. //depot/projects/vimage/src/sys/dev/firewire/firewire.h#4 integrate .. //depot/projects/vimage/src/sys/dev/firewire/fwohci.c#7 integrate .. //depot/projects/vimage/src/sys/dev/firewire/fwohcireg.h#3 integrate .. //depot/projects/vimage/src/sys/dev/firewire/fwphyreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/firewire/if_fwe.c#5 integrate .. //depot/projects/vimage/src/sys/dev/firewire/if_fwip.c#7 integrate .. //depot/projects/vimage/src/sys/dev/firewire/sbp.c#7 integrate .. //depot/projects/vimage/src/sys/dev/fxp/if_fxp.c#12 integrate .. //depot/projects/vimage/src/sys/dev/hifn/hifn7751.c#3 integrate .. //depot/projects/vimage/src/sys/dev/iicbus/if_ic.c#4 integrate .. //depot/projects/vimage/src/sys/dev/iicbus/iicbb.c#5 integrate .. //depot/projects/vimage/src/sys/dev/iicbus/iicbus.c#5 integrate .. //depot/projects/vimage/src/sys/dev/iicbus/iicsmb.c#5 integrate .. //depot/projects/vimage/src/sys/dev/iscsi/initiator/isc_subr.c#3 integrate .. //depot/projects/vimage/src/sys/dev/iwn/if_iwn.c#6 integrate .. //depot/projects/vimage/src/sys/dev/kbdmux/kbdmux.c#7 integrate .. //depot/projects/vimage/src/sys/dev/lmc/if_lmc.c#8 integrate .. //depot/projects/vimage/src/sys/dev/lmc/if_lmc.h#3 integrate .. //depot/projects/vimage/src/sys/dev/mmc/mmcsd.c#13 integrate .. //depot/projects/vimage/src/sys/dev/mxge/if_mxge.c#14 integrate .. //depot/projects/vimage/src/sys/dev/my/if_my.c#5 integrate .. //depot/projects/vimage/src/sys/dev/nve/if_nve.c#7 integrate .. //depot/projects/vimage/src/sys/dev/pccard/card_if.m#2 integrate .. //depot/projects/vimage/src/sys/dev/pccard/pccard.c#5 integrate .. //depot/projects/vimage/src/sys/dev/pccard/pccard_cis.c#5 integrate .. //depot/projects/vimage/src/sys/dev/pccard/pccardvarp.h#4 integrate .. //depot/projects/vimage/src/sys/dev/pccbb/pccbb.c#10 integrate .. //depot/projects/vimage/src/sys/dev/pccbb/pccbb_pci.c#9 integrate .. //depot/projects/vimage/src/sys/dev/pccbb/pccbbvar.h#6 integrate .. //depot/projects/vimage/src/sys/dev/pci/pcireg.h#12 integrate .. //depot/projects/vimage/src/sys/dev/pcn/if_pcn.c#3 integrate .. //depot/projects/vimage/src/sys/dev/ppbus/lpt.c#9 integrate .. //depot/projects/vimage/src/sys/dev/ppc/ppc.c#8 integrate .. //depot/projects/vimage/src/sys/dev/ppc/ppc_pci.c#4 integrate .. //depot/projects/vimage/src/sys/dev/ppc/ppcvar.h#5 integrate .. //depot/projects/vimage/src/sys/dev/puc/pucdata.c#10 integrate .. //depot/projects/vimage/src/sys/dev/re/if_re.c#22 integrate .. //depot/projects/vimage/src/sys/dev/safe/safe.c#4 integrate .. //depot/projects/vimage/src/sys/dev/scc/scc_if.m#3 integrate .. //depot/projects/vimage/src/sys/dev/sdhci/sdhci.c#6 integrate .. //depot/projects/vimage/src/sys/dev/si/si.c#6 integrate .. //depot/projects/vimage/src/sys/dev/sis/if_sis.c#4 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/aoa.c#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/aoa.h#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/davbus.c#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/i2s.c#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/snapper.c#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/macio/tumbler.c#2 integrate .. //depot/projects/vimage/src/sys/dev/sound/pci/ds1.c#5 integrate .. //depot/projects/vimage/src/sys/dev/sound/pci/envy24.c#8 integrate .. //depot/projects/vimage/src/sys/dev/sound/pci/envy24ht.c#8 integrate .. //depot/projects/vimage/src/sys/dev/sound/pci/hda/hdac.c#28 integrate .. //depot/projects/vimage/src/sys/dev/sound/pci/spicds.c#4 integrate .. //depot/projects/vimage/src/sys/dev/streams/streams.c#7 integrate .. //depot/projects/vimage/src/sys/dev/syscons/scterm-teken.c#2 integrate .. //depot/projects/vimage/src/sys/dev/syscons/teken/teken.c#2 integrate .. //depot/projects/vimage/src/sys/dev/syscons/teken/teken.h#2 integrate .. //depot/projects/vimage/src/sys/dev/tl/if_tl.c#2 integrate .. //depot/projects/vimage/src/sys/dev/tsec/if_tsec.c#3 integrate .. //depot/projects/vimage/src/sys/dev/tsec/if_tsec.h#3 integrate .. //depot/projects/vimage/src/sys/dev/tsec/if_tsec_ocp.c#2 integrate .. //depot/projects/vimage/src/sys/dev/tsec/if_tsecreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/tx/if_tx.c#5 integrate .. //depot/projects/vimage/src/sys/dev/uart/uart_bus_pci.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb/if_rum.c#14 integrate .. //depot/projects/vimage/src/sys/dev/usb/if_urtw.c#2 integrate .. //depot/projects/vimage/src/sys/dev/usb/u3g.c#8 integrate .. //depot/projects/vimage/src/sys/dev/usb/usbdevs#40 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/at91dci.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/at91dci_atmelarm.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/atmegadci.c#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/ehci2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/ehci2.h#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/ehci2_ixp4xx.c#1 branch .. //depot/projects/vimage/src/sys/dev/usb2/controller/ehci2_mbus.c#1 branch .. //depot/projects/vimage/src/sys/dev/usb2/controller/ehci2_pci.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/musb2_otg.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/ohci2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/uhci2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/usb2_controller.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/controller/uss820dci.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_busdma.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_config_td.c#3 delete .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_config_td.h#3 delete .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_core.h#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_dev.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_device.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_generic.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_hub.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_msctest.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_process.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_process.h#3 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_request.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_request.h#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_transfer.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_transfer.h#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_util.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/core/usb2_util.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_aue2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_auereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_axe2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_axereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_cdce2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_cdcereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_cue2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_cuereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_kue2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_kuereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_rue2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_ruereg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_udav2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/if_udavreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/usb2_ethernet.c#3 integrate .. //depot/projects/vimage/src/sys/dev/usb2/ethernet/usb2_ethernet.h#3 integrate .. //depot/projects/vimage/src/sys/dev/usb2/include/usb2_cdc.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/include/usb2_devid.h#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/include/usb2_devtable.h#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/include/usb2_ioctl.h#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/misc/ufm2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/u3g2.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uark2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ubsa2.c#7 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ubser2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uchcom2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ucycom2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ufoma2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uftdi2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ugensa2.c#8 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uipaq2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/ulpt2.c#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/umct2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/umodem2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/umoscom2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uplcom2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/usb2_serial.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/usb2_serial.h#4 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uslcom2.c#1 branch .. //depot/projects/vimage/src/sys/dev/usb2/serial/uvisor2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/serial/uvscom2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/sound/uaudio2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/storage/umass2.c#6 integrate .. //depot/projects/vimage/src/sys/dev/usb2/template/usb2_template_cdce.c#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_rum2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_rumreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_rumvar.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_ural2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_uralreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_uralvar.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_zyd2.c#5 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_zydfw.h#2 integrate .. //depot/projects/vimage/src/sys/dev/usb2/wlan/if_zydreg.h#2 integrate .. //depot/projects/vimage/src/sys/dev/wpi/if_wpi.c#9 integrate .. //depot/projects/vimage/src/sys/dev/xen/netfront/netfront.c#9 integrate .. //depot/projects/vimage/src/sys/fs/cd9660/cd9660_vfsops.c#8 integrate .. //depot/projects/vimage/src/sys/fs/coda/coda_vnops.c#6 integrate .. //depot/projects/vimage/src/sys/fs/fifofs/fifo_vnops.c#11 integrate .. //depot/projects/vimage/src/sys/fs/procfs/procfs.c#5 integrate .. //depot/projects/vimage/src/sys/fs/pseudofs/pseudofs_vnops.c#10 integrate .. //depot/projects/vimage/src/sys/fs/tmpfs/tmpfs.h#9 integrate .. //depot/projects/vimage/src/sys/fs/tmpfs/tmpfs_subr.c#12 integrate .. //depot/projects/vimage/src/sys/fs/tmpfs/tmpfs_vnops.c#15 integrate .. //depot/projects/vimage/src/sys/fs/udf/ecma167-udf.h#2 integrate .. //depot/projects/vimage/src/sys/fs/udf/udf.h#3 integrate .. //depot/projects/vimage/src/sys/fs/udf/udf_vfsops.c#9 integrate .. //depot/projects/vimage/src/sys/fs/udf/udf_vnops.c#11 integrate .. //depot/projects/vimage/src/sys/geom/label/g_label_msdosfs.c#2 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part.c#14 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part.h#9 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_apm.c#9 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_bsd.c#9 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_ebr.c#1 branch .. //depot/projects/vimage/src/sys/geom/part/g_part_gpt.c#10 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_if.m#4 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_mbr.c#6 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_pc98.c#7 integrate .. //depot/projects/vimage/src/sys/geom/part/g_part_vtoc8.c#5 integrate .. //depot/projects/vimage/src/sys/i386/conf/DEFAULTS#10 integrate .. //depot/projects/vimage/src/sys/i386/conf/GENERIC#29 integrate .. //depot/projects/vimage/src/sys/i386/conf/NOTES#26 integrate .. //depot/projects/vimage/src/sys/i386/i386/busdma_machdep.c#10 integrate .. //depot/projects/vimage/src/sys/i386/i386/pmap.c#22 integrate .. //depot/projects/vimage/src/sys/i386/i386/vm_machdep.c#13 integrate .. //depot/projects/vimage/src/sys/i386/ibcs2/ibcs2_misc.c#5 integrate .. //depot/projects/vimage/src/sys/i386/xen/clock.c#5 integrate .. //depot/projects/vimage/src/sys/i386/xen/pmap.c#7 integrate .. //depot/projects/vimage/src/sys/ia64/conf/GENERIC#12 integrate .. //depot/projects/vimage/src/sys/ia64/conf/NOTES#2 integrate .. //depot/projects/vimage/src/sys/ia64/ia64/busdma_machdep.c#6 integrate .. //depot/projects/vimage/src/sys/ia64/ia64/mca.c#3 integrate .. //depot/projects/vimage/src/sys/ia64/ia64/mp_machdep.c#8 integrate .. //depot/projects/vimage/src/sys/ia64/include/mca.h#2 integrate .. //depot/projects/vimage/src/sys/kern/kern_descrip.c#23 integrate .. //depot/projects/vimage/src/sys/kern/kern_jail.c#23 integrate .. //depot/projects/vimage/src/sys/kern/kern_linker.c#24 integrate .. //depot/projects/vimage/src/sys/kern/kern_lock.c#13 integrate .. //depot/projects/vimage/src/sys/kern/kern_sysctl.c#19 integrate .. //depot/projects/vimage/src/sys/kern/link_elf.c#10 integrate .. //depot/projects/vimage/src/sys/kern/link_elf_obj.c#10 integrate .. //depot/projects/vimage/src/sys/kern/subr_bus.c#15 integrate .. //depot/projects/vimage/src/sys/kern/subr_clist.c#5 integrate .. //depot/projects/vimage/src/sys/kern/subr_disk.c#3 integrate .. //depot/projects/vimage/src/sys/kern/subr_taskqueue.c#8 integrate .. //depot/projects/vimage/src/sys/kern/tty.c#31 integrate .. //depot/projects/vimage/src/sys/kern/uipc_debug.c#6 integrate .. //depot/projects/vimage/src/sys/kern/uipc_socket.c#30 integrate .. //depot/projects/vimage/src/sys/kern/vfs_bio.c#17 integrate .. //depot/projects/vimage/src/sys/kern/vfs_init.c#3 integrate .. //depot/projects/vimage/src/sys/kern/vfs_mount.c#27 integrate .. //depot/projects/vimage/src/sys/kern/vfs_subr.c#25 integrate .. //depot/projects/vimage/src/sys/kern/vfs_syscalls.c#22 integrate .. //depot/projects/vimage/src/sys/libkern/crc32.c#2 integrate .. //depot/projects/vimage/src/sys/mips/include/fpu.h#2 integrate .. //depot/projects/vimage/src/sys/mips/include/frame.h#2 integrate .. //depot/projects/vimage/src/sys/mips/include/pmap.h#3 integrate .. //depot/projects/vimage/src/sys/mips/mips/busdma_machdep.c#3 integrate .. //depot/projects/vimage/src/sys/mips/mips/in_cksum.c#3 integrate .. //depot/projects/vimage/src/sys/mips/mips/pmap.c#8 integrate .. //depot/projects/vimage/src/sys/modules/Makefile#39 integrate .. //depot/projects/vimage/src/sys/modules/acpi/acpi/Makefile#5 integrate .. //depot/projects/vimage/src/sys/modules/agp/Makefile#4 integrate .. //depot/projects/vimage/src/sys/modules/dtrace/dtrace/Makefile#2 integrate .. //depot/projects/vimage/src/sys/modules/geom/geom_part/Makefile#2 integrate .. //depot/projects/vimage/src/sys/modules/geom/geom_part/geom_part_ebr/Makefile#1 branch .. //depot/projects/vimage/src/sys/modules/libalias/libalias/Makefile#3 integrate .. //depot/projects/vimage/src/sys/modules/linux/Makefile#5 integrate .. //depot/projects/vimage/src/sys/modules/svr4/Makefile#4 integrate .. //depot/projects/vimage/src/sys/modules/usb2/Makefile#5 integrate .. //depot/projects/vimage/src/sys/modules/usb2/core/Makefile#2 integrate .. //depot/projects/vimage/src/sys/modules/usb2/serial_slcom/Makefile#1 branch .. //depot/projects/vimage/src/sys/net/if.c#64 integrate .. //depot/projects/vimage/src/sys/net/if.h#10 integrate .. //depot/projects/vimage/src/sys/net/if_bridge.c#25 integrate .. //depot/projects/vimage/src/sys/net/if_spppsubr.c#15 integrate .. //depot/projects/vimage/src/sys/net/if_vlan.c#16 integrate .. //depot/projects/vimage/src/sys/net/rtsock.c#28 integrate .. //depot/projects/vimage/src/sys/net/vnet.h#19 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211.c#28 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_adhoc.c#7 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_crypto.h#9 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_ddb.c#18 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_freebsd.h#13 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_ioctl.c#19 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_node.c#18 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_output.c#18 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_proto.c#13 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_proto.h#13 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_regdomain.c#8 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_tdma.c#3 integrate .. //depot/projects/vimage/src/sys/net80211/ieee80211_var.h#21 integrate .. //depot/projects/vimage/src/sys/netatalk/ddp_usrreq.c#5 integrate .. //depot/projects/vimage/src/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c#4 integrate .. //depot/projects/vimage/src/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c#7 integrate .. //depot/projects/vimage/src/sys/netinet/if_ether.h#4 integrate .. //depot/projects/vimage/src/sys/netinet/in.c#27 integrate .. //depot/projects/vimage/src/sys/netinet/in_pcb.c#50 integrate .. //depot/projects/vimage/src/sys/netinet/in_systm.h#2 integrate .. //depot/projects/vimage/src/sys/netinet/ip.h#6 integrate .. //depot/projects/vimage/src/sys/netinet/ip_dummynet.c#13 integrate .. //depot/projects/vimage/src/sys/netinet/ip_fw.h#25 integrate .. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#67 integrate .. //depot/projects/vimage/src/sys/netinet/ip_fw_nat.c#13 integrate .. //depot/projects/vimage/src/sys/netinet/ip_fw_pfil.c#19 integrate .. //depot/projects/vimage/src/sys/netinet/ip_icmp.c#25 integrate .. //depot/projects/vimage/src/sys/netinet/ip_icmp.h#3 integrate .. //depot/projects/vimage/src/sys/netinet/ip_ipsec.c#20 integrate .. //depot/projects/vimage/src/sys/netinet/ip_options.c#18 integrate .. //depot/projects/vimage/src/sys/netinet/ip_output.c#30 integrate .. //depot/projects/vimage/src/sys/netinet/libalias/alias.c#7 integrate .. //depot/projects/vimage/src/sys/netinet/libalias/alias_db.c#9 integrate .. //depot/projects/vimage/src/sys/netinet/libalias/alias_local.h#5 integrate .. //depot/projects/vimage/src/sys/netinet/libalias/alias_sctp.c#1 branch .. //depot/projects/vimage/src/sys/netinet/libalias/alias_sctp.h#1 branch .. //depot/projects/vimage/src/sys/netinet/raw_ip.c#39 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#9 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_crc32.h#6 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_pcb.c#36 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_sysctl.c#15 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_uio.h#20 integrate .. //depot/projects/vimage/src/sys/netinet/sctp_usrreq.c#34 integrate .. //depot/projects/vimage/src/sys/netinet/sctputil.c#35 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_debug.h#3 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#72 integrate .. //depot/projects/vimage/src/sys/netinet/tcp_usrreq.c#31 integrate .. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#47 integrate .. //depot/projects/vimage/src/sys/netinet/vinet.h#44 integrate .. //depot/projects/vimage/src/sys/netinet6/in6.c#29 integrate .. //depot/projects/vimage/src/sys/netinet6/in6_pcb.c#31 integrate .. //depot/projects/vimage/src/sys/netinet6/in6_src.c#35 integrate .. //depot/projects/vimage/src/sys/netinet6/ip6_forward.c#20 integrate .. //depot/projects/vimage/src/sys/netinet6/ip6_ipsec.c#16 integrate .. //depot/projects/vimage/src/sys/netinet6/ip6_output.c#26 integrate .. //depot/projects/vimage/src/sys/netinet6/raw_ip6.c#36 integrate .. //depot/projects/vimage/src/sys/netinet6/udp6_usrreq.c#39 integrate .. //depot/projects/vimage/src/sys/netipsec/ipsec.c#39 integrate .. //depot/projects/vimage/src/sys/netipsec/ipsec.h#14 integrate .. //depot/projects/vimage/src/sys/netipsec/ipsec6.h#6 integrate .. //depot/projects/vimage/src/sys/nfsserver/nfs_serv.c#15 integrate .. //depot/projects/vimage/src/sys/nfsserver/nfs_syscalls.c#13 integrate .. //depot/projects/vimage/src/sys/opencrypto/cryptosoft.c#7 integrate .. //depot/projects/vimage/src/sys/pc98/conf/GENERIC#18 integrate .. //depot/projects/vimage/src/sys/pc98/conf/NOTES#11 integrate .. //depot/projects/vimage/src/sys/pccard/cardinfo.h#2 delete .. //depot/projects/vimage/src/sys/pccard/cis.h#2 delete .. //depot/projects/vimage/src/sys/pci/if_rl.c#14 integrate .. //depot/projects/vimage/src/sys/pci/if_rlreg.h#19 integrate .. //depot/projects/vimage/src/sys/powerpc/conf/GENERIC#18 integrate .. //depot/projects/vimage/src/sys/powerpc/conf/MPC85XX#3 integrate .. //depot/projects/vimage/src/sys/rpc/clnt_rc.c#5 integrate .. //depot/projects/vimage/src/sys/security/audit/audit_bsm.c#13 integrate .. //depot/projects/vimage/src/sys/security/audit/audit_bsm_klib.c#12 integrate .. //depot/projects/vimage/src/sys/security/audit/audit_pipe.c#12 integrate .. //depot/projects/vimage/src/sys/security/audit/audit_private.h#9 integrate .. //depot/projects/vimage/src/sys/sparc64/conf/GENERIC#17 integrate .. //depot/projects/vimage/src/sys/sparc64/include/bus_private.h#3 integrate .. //depot/projects/vimage/src/sys/sparc64/include/vmparam.h#8 integrate .. //depot/projects/vimage/src/sys/sparc64/sparc64/iommu.c#6 integrate .. //depot/projects/vimage/src/sys/sun4v/conf/GENERIC#15 integrate .. //depot/projects/vimage/src/sys/sun4v/include/vmparam.h#7 integrate .. //depot/projects/vimage/src/sys/sys/bus_dma.h#3 integrate .. //depot/projects/vimage/src/sys/sys/cfictl.h#3 integrate .. //depot/projects/vimage/src/sys/sys/conf.h#16 integrate .. //depot/projects/vimage/src/sys/sys/jail.h#8 integrate .. //depot/projects/vimage/src/sys/sys/kobj.h#4 integrate .. //depot/projects/vimage/src/sys/sys/libkern.h#6 integrate .. //depot/projects/vimage/src/sys/sys/lockmgr.h#8 integrate .. //depot/projects/vimage/src/sys/sys/mount.h#17 integrate .. //depot/projects/vimage/src/sys/sys/sysctl.h#32 integrate .. //depot/projects/vimage/src/sys/sys/tty.h#9 integrate .. //depot/projects/vimage/src/sys/ufs/ffs/ffs_alloc.c#9 integrate .. //depot/projects/vimage/src/sys/ufs/ffs/ffs_vfsops.c#18 integrate .. //depot/projects/vimage/src/sys/vm/vm_fault.c#12 integrate .. //depot/projects/vimage/src/sys/vm/vm_kern.c#11 integrate .. //depot/projects/vimage/src/sys/vm/vm_map.c#13 integrate .. //depot/projects/vimage/src/sys/vm/vm_map.h#6 integrate .. //depot/projects/vimage/src/sys/vm/vm_mmap.c#16 integrate .. //depot/projects/vimage/src/sys/vm/vm_object.c#19 integrate .. //depot/projects/vimage/src/sys/vm/vm_object.h#5 integrate .. //depot/projects/vimage/src/sys/vm/vm_unix.c#2 integrate .. //depot/projects/vimage/src/sys/vm/vnode_pager.c#11 integrate .. //depot/projects/vimage/src/sys/vm/vnode_pager.h#2 integrate Differences ... ==== //depot/projects/vimage/src/share/man/man4/re.4#2 (text+ko) ==== @@ -28,9 +28,9 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/re.4,v 1.20 2007/01/30 08:40:04 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/re.4,v 1.21 2009/02/09 05:09:52 yongari Exp $ .\" -.Dd January 14, 2006 +.Dd February 9, 2009 .Dt RE 4 .Os .Sh NAME @@ -169,6 +169,16 @@ .It Xterasys XN-152 10/100/1000 NIC (8169) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.re.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" ==== //depot/projects/vimage/src/share/man/man4/rum.4#2 (text+ko) ==== @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $FreeBSD: src/share/man/man4/rum.4,v 1.5 2008/08/25 05:51:58 kevlo Exp $ +.\" $FreeBSD: src/share/man/man4/rum.4,v 1.6 2009/02/06 15:03:17 kevlo Exp $ .\" .Dd April 13, 2008 .Os @@ -91,6 +91,7 @@ .It "Belkin F5D7050 ver 3" Ta USB .It "Belkin F5D9050 ver 3" Ta USB .It "Buffalo WLI-U2-SG54HP" Ta USB +.It "Buffalo WLI-U2-SG54HG" Ta USB .It "Buffalo WLI-U2-G54HP" Ta USB .It "CNet CWD-854 ver F" Ta USB .It "Conceptronic C54RU ver 2" Ta USB ==== //depot/projects/vimage/src/share/man/man4/smb.4#2 (text+ko) ==== @@ -23,9 +23,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/smb.4,v 1.12 2005/01/21 20:50:39 ru Exp $ +.\" $FreeBSD: src/share/man/man4/smb.4,v 1.13 2009/02/06 15:09:31 jhb Exp $ .\" -.Dd October 25, 1998 +.Dd February 6, 2009 .Dt SMB 4 .Os .Sh NAME @@ -72,6 +72,9 @@ .Fa slave field is always used, and provides the address of the SMBus slave device to talk to. +The slave address is specified in the seven most significant bits +.Pq i.e. Dq "left-justified" . +The least significant bit of the slave address must be zero. .Pp .Bl -column ".Dv SMB_QUICK_WRITE" -compact .It Em Ioctl Ta Em Description ==== //depot/projects/vimage/src/share/man/man4/snd_hda.4#3 (text+ko) ==== @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man4/snd_hda.4,v 1.30 2009/01/07 16:06:09 mav Exp $ +.\" $FreeBSD: src/share/man/man4/snd_hda.4,v 1.31 2009/02/12 13:04:13 mav Exp $ .\" .Dd January 7, 2009 .Dt SND_HDA 4 @@ -298,7 +298,7 @@ .Pp So high codec uniformity and flexibility allow driver to configure it in many different ways, depending on requested pins usage decribed by pins configuration. -Driver reports such default pin configuration when verbose messages enabled: +The driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1 @@ -313,8 +313,8 @@ hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 .Ed .Pp -Here we can see, that the nodes with ID (nid) 25 and 27 are front pannel -connectors (Jack, loc 2), nids 20, 24 and 26 are rear pannel connectors +Here we can see, that the nodes with ID (nid) 25 and 27 are front panel +connectors (Jack, loc 2), nids 20, 24 and 26 are rear panel connectors (Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" connectivity. So the pin count and description matches to connectors that ==== //depot/projects/vimage/src/share/man/man4/u3g.4#2 (text+ko) ==== @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $FreeBSD: src/share/man/man4/u3g.4,v 1.8 2008/10/29 18:49:37 brueffer Exp $ +.\" $FreeBSD: src/share/man/man4/u3g.4,v 1.9 2009/02/13 20:09:11 n_hibma Exp $ .\" .Dd October 7, 2008 .Dt U3G 4 @@ -56,50 +56,51 @@ .Pp .Bl -bullet -compact .It -Option Globetrotter 3G Fusion (only 3G part, not WLAN) +Option GT 3G Fusion, GT Fusion Quad, etc. (only 3G part, not WLAN) .It -Option Globetrotter 3G Fusion Quad (only 3G part, not WLAN) +Option GT 3G, GT 3G Quad, etc. .It -Option Globetrotter 3G Quad -.It -Option Globetrotter 3G -.It Vodafone Mobile Connect Card 3G .It Qualcomm Inc. CDMA MSM .It -Huawei E220 (E270?) +Huawei B190, E220 ('') .It -Huawei Mobile +Novatal U740, MC950D, X950D, etc. .It -Novatal MC950D -.It -Sierra cards +Sierra MC875U, MC8775U, etc. .El .Pp -See +(See .Pa /sys/dev/u3g.c for the complete list of supported cards for each vendor -mentioned above. +mentioned above.) .Pp -The supported 3G cards provide the necessary modem port for ppp, -pppd, or mpd connections as well as extra ports (depending on the specific -device) to provide other functions (diagnostic port, SIM toolkit port). +The supported 3G cards provide the necessary modem port for ppp, pppd, or mpd +connections as well as extra ports (depending on the specific device) to +provide other functions (additional command port, diagnostic port, SIM toolkit +port). .Pp In some of these devices a mass storage device supported by the .Xr umass 4 driver is present which contains Windows and Mac OS X drivers. -This device is -hidden, unless the machine was booted in verbose mode (see +The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires +additional commands to switch it to modem mode. +.Pp +The +.Xr u3gstub 4 +device will attach temporarily to a 3G device with a mass storage device and +force it to switch to modem mode, +The attach and detach of +.Xr u3gstub +and any driver disk device present on the 3G device is is hidden, unless the +machine was booted in verbose mode (see .Xr boot 8 ) . To temporarily unhide the device, set .Va debug.bootverbose to 1 using .Xr sysctl 8 and replug the device. -The -.Xr u3gstub 4 -device will attach temporarily and detach within seconds. .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , ==== //depot/projects/vimage/src/share/man/man5/rc.conf.5#4 (text+ko) ==== @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.355 2009/01/29 06:43:29 keramida Exp $ +.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.356 2009/02/17 11:55:50 mtm Exp $ .\" .Dd January 27, 2009 .Dt RC.CONF 5 @@ -406,7 +406,7 @@ .Dq Li SYNCDHCP or .Dq Li NOSYNCDHCP . -.It Va if_up_delay +.It Va defaultroute_delay .Pq Vt int When set to a positive value, wait up to this long after configuring DHCP interfaces at startup to give the interfaces time to receive a lease. ==== //depot/projects/vimage/src/share/man/man9/lock.9#2 (text+ko) ==== @@ -24,9 +24,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.\" $FreeBSD: src/share/man/man9/lock.9,v 1.33 2008/04/12 20:18:02 attilio Exp $ +.\" $FreeBSD: src/share/man/man9/lock.9,v 1.34 2009/02/05 15:09:04 attilio Exp $ .\" -.Dd April 12, 2008 +.Dd February 05, 2009 .Dt LOCK 9 .Os .Sh NAME @@ -279,14 +279,6 @@ Assert that the current thread has no lock on the .Vt lkp lock pointed to by the first argument. -.It Dv KA_HELD -Assert that an unspecified thread has a lock on the -.Vt lkp -lock pointed to by the first argument. -.It Dv KA_UNHELD -Assert that no thread has a lock on the -.Vt lkp -lock pointed to by the first argument. .El .Pp In addition, one of the following optional assertions can be used with @@ -305,15 +297,6 @@ .Fa lkp . .El .Pp -Note that -.Dv KA_HELD -and -.Dv KA_UNHELD -usage is highly discouraged. -They are intended to cater a bad behaviour -introduced by buffer cache lock handling. -They will hopefully be -made useless by revisiting such locks. .Sh RETURN VALUES The .Fn lockmgr ==== //depot/projects/vimage/src/sys/Makefile#12 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/Makefile,v 1.53 2008/08/15 14:11:30 philip Exp $ +# $FreeBSD: src/sys/Makefile,v 1.54 2009/02/15 18:19:24 imp Exp $ .include @@ -12,7 +12,7 @@ geom gnu isa kern libkern modules net net80211 netatalk \ netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfs4client nfsclient nfsserver nlm opencrypto \ - pccard pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} + pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} .if defined(ALL_ARCH) CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v .else ==== //depot/projects/vimage/src/sys/amd64/amd64/busdma_machdep.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.86 2008/07/15 03:34:49 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.88 2009/02/09 18:03:31 cognet Exp $"); #include #include @@ -93,6 +93,7 @@ int active_bpages; int total_bounced; int total_deferred; + int map_count; bus_size_t alignment; bus_size_t boundary; bus_addr_t lowaddr; @@ -418,7 +419,7 @@ else maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 - || (dmat->map_count > 0 && bz->total_bpages < maxpages)) { + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; pages = MAX(atop(dmat->maxsize), 1); @@ -434,6 +435,7 @@ error = 0; } } + bz->map_count++; } else { *mapp = NULL; } @@ -457,6 +459,8 @@ __func__, dmat, EBUSY); return (EBUSY); } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; free(map, M_DEVBUF); } dmat->map_count--; @@ -989,6 +993,7 @@ bz->lowaddr = dmat->lowaddr; bz->alignment = dmat->alignment; bz->boundary = dmat->boundary; + bz->map_count = 0; snprintf(bz->zoneid, 8, "zone%d", busdma_zonecount); busdma_zonecount++; snprintf(bz->lowaddrid, 18, "%#jx", (uintmax_t)bz->lowaddr); @@ -1128,6 +1133,13 @@ bz->active_bpages++; mtx_unlock(&bounce_lock); + if (dmat->flags & BUS_DMA_KEEP_PG_OFFSET) { + /* page offset needs to be preserved */ + bpage->vaddr &= ~PAGE_MASK; + bpage->busaddr &= ~PAGE_MASK; + bpage->vaddr |= vaddr & PAGE_MASK; + bpage->busaddr |= vaddr & PAGE_MASK; + } bpage->datavaddr = vaddr; bpage->datacount = size; STAILQ_INSERT_TAIL(&(map->bpages), bpage, links); ==== //depot/projects/vimage/src/sys/amd64/amd64/pmap.c#23 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.646 2008/12/06 19:37:52 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.647 2009/02/14 18:23:52 alc Exp $"); /* * Manages physical address maps. @@ -3400,9 +3400,7 @@ } p = vm_page_lookup(object, pindex); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); } ptepa = VM_PAGE_TO_PHYS(p); @@ -3416,15 +3414,11 @@ while ((pdpg = pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { PMAP_UNLOCK(pmap); - vm_page_lock_queues(); vm_page_busy(p); - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); VM_WAIT; VM_OBJECT_LOCK(object); - vm_page_lock_queues(); vm_page_wakeup(p); - vm_page_unlock_queues(); PMAP_LOCK(pmap); } pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); ==== //depot/projects/vimage/src/sys/amd64/conf/DEFAULTS#6 (text+ko) ==== @@ -1,7 +1,7 @@ # # DEFAULTS -- Default kernel configuration file for FreeBSD/amd64 # -# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.14 2008/12/17 17:43:22 marcel Exp $ +# $FreeBSD: src/sys/amd64/conf/DEFAULTS,v 1.15 2009/02/10 00:08:39 marcel Exp $ machine amd64 @@ -17,4 +17,5 @@ # Default partitioning schemes options GEOM_PART_BSD +options GEOM_PART_EBR options GEOM_PART_MBR ==== //depot/projects/vimage/src/sys/amd64/conf/GENERIC#25 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.518 2009/01/19 15:33:06 sobomax Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.520 2009/02/15 23:40:37 svn Exp $ cpu HAMMER ident GENERIC @@ -281,40 +281,97 @@ # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter -# USB support -device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) +# USB core support +device usb2_core +# USB controller support +device usb2_controller +device usb2_controller_ehci +device usb2_controller_ohci +device usb2_controller_uhci +# USB mass storage support +device usb2_storage +device usb2_storage_mass +# USB ethernet support, requires miibus +device usb2_ethernet +device usb2_ethernet_aue +device usb2_ethernet_axe +device usb2_ethernet_cdce +device usb2_ethernet_cue +device usb2_ethernet_kue +device usb2_ethernet_rue +device usb2_ethernet_dav +# USB wireless LAN support +device usb2_wlan +device usb2_wlan_rum +device usb2_wlan_ral +device usb2_wlan_zyd +# USB serial device support +device usb2_serial +device usb2_serial_ark +device usb2_serial_bsa +device usb2_serial_bser +device usb2_serial_chcom +device usb2_serial_cycom +device usb2_serial_foma +device usb2_serial_ftdi +device usb2_serial_gensa +device usb2_serial_ipaq +device usb2_serial_lpt +device usb2_serial_mct +device usb2_serial_modem +device usb2_serial_moscom +device usb2_serial_plcom +device usb2_serial_slcom +device usb2_serial_visor +device usb2_serial_vscom +# USB bluetooth support +#device usb2_bluetooth +#device usb2_bluetooth_ng +# USB input device support +device usb2_input +device usb2_input_hid +device usb2_input_kbd +device usb2_input_ms +# USB sound and MIDI device support +#device usb2_sound +# USB scanner support +device usb2_image +device usb2_scanner + +# USB support (deprecated) +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices -device ugen # Generic -device uhid # "Human Interface Devices" -device ukbd # Keyboard -device ulpt # Printer -device umass # Disks/Mass storage - Requires scbus and da -device ums # Mouse -device ural # Ralink Technology RT2500USB wireless NICs -device rum # Ralink Technology RT2501USB wireless NICs -device urio # Diamond Rio 500 MP3 player -device uscanner # Scanners +#device ugen # Generic +#device uhid # "Human Interface Devices" +#device ukbd # Keyboard +#device ulpt # Printer +#device umass # Disks/Mass storage - Requires scbus and da +#device ums # Mouse +#device ural # Ralink Technology RT2500USB wireless NICs +#device rum # Ralink Technology RT2501USB wireless NICs +#device urio # Diamond Rio 500 MP3 player +#device uscanner # Scanners # USB Serial devices -device ucom # Generic com ttys -device uark # Technologies ARK3116 based serial adapters -device ubsa # Belkin F5U103 and compatible serial adapters -device uftdi # For FTDI usb serial adapters -device uipaq # Some WinCE based devices -device uplcom # Prolific PL-2303 serial adapters -device uslcom # SI Labs CP2101/CP2102 serial adapters -device uvisor # Visor and Palm devices -device uvscom # USB serial support for DDI pocket's PHS +#device ucom # Generic com ttys +#device uark # Technologies ARK3116 based serial adapters +#device ubsa # Belkin F5U103 and compatible serial adapters +#device uftdi # For FTDI usb serial adapters +#device uipaq # Some WinCE based devices +#device uplcom # Prolific PL-2303 serial adapters +#device uslcom # SI Labs CP2101/CP2102 serial adapters +#device uvisor # Visor and Palm devices +#device uvscom # USB serial support for DDI pocket's PHS # USB Ethernet, requires miibus -device aue # ADMtek USB Ethernet -device axe # ASIX Electronics USB Ethernet -device cdce # Generic USB over Ethernet -device cue # CATC USB Ethernet -device kue # Kawasaki LSI USB Ethernet -device rue # RealTek RTL8150 USB Ethernet -device udav # Davicom DM9601E USB +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB # FireWire support device firewire # FireWire bus code ==== //depot/projects/vimage/src/sys/amd64/conf/NOTES#14 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.83 2008/12/01 16:53:01 sam Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.86 2009/02/07 00:01:10 wkoszek Exp $ # # @@ -150,6 +150,11 @@ # AGP GART support >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Tue Feb 17 21:35:33 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CD461065703; Tue, 17 Feb 2009 21:35:32 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D461F106567E for ; Tue, 17 Feb 2009 21:35:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8D1668FC16 for ; Tue, 17 Feb 2009 21:35:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLZVtv019156 for ; Tue, 17 Feb 2009 21:35:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HLZVMY019154 for perforce@freebsd.org; Tue, 17 Feb 2009 21:35:31 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 17 Feb 2009 21:35:31 GMT Message-Id: <200902172135.n1HLZVMY019154@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157868 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:35:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=157868 Change 157868 by hselasky@hselasky_laptop001 on 2009/02/17 21:34:44 USB INPUT: Correct my Microsoft UMS patch. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/input/ums2.c#16 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/input/ums2.c#16 (text+ko) ==== @@ -511,7 +511,8 @@ * positions. Correct this: */ isizebits = isize * 8; - if (isizebits <= 0) { + if ((sc->sc_iid != 0) && (isizebits > 8)) { + isizebits -= 8; /* remove size of report ID */ sc->sc_loc_w.pos %= isizebits; sc->sc_loc_x.pos %= isizebits; sc->sc_loc_y.pos %= isizebits; From owner-p4-projects@FreeBSD.ORG Tue Feb 17 21:40:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 51BB21065673; Tue, 17 Feb 2009 21:40:37 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CF98106566B for ; Tue, 17 Feb 2009 21:40:37 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EF59D8FC1F for ; Tue, 17 Feb 2009 21:40:36 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLeaH7019579 for ; Tue, 17 Feb 2009 21:40:36 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HLeaIi019577 for perforce@freebsd.org; Tue, 17 Feb 2009 21:40:36 GMT (envelope-from julian@freebsd.org) Date: Tue, 17 Feb 2009 21:40:36 GMT Message-Id: <200902172140.n1HLeaIi019577@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157870 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:40:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=157870 Change 157870 by julian@julian_trafmon1 on 2009/02/17 21:40:35 IFC@157865 Affected files ... .. //depot/projects/vimage/src/sys/sys/jail.h#9 integrate Differences ... ==== //depot/projects/vimage/src/sys/sys/jail.h#9 (text+ko) ==== @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $FreeBSD: src/sys/sys/jail.h,v 1.35 2009/02/05 14:15:18 jamie Exp $ + * $FreeBSD: src/sys/sys/jail.h,v 1.36 2009/02/17 21:29:39 jamie Exp $ * */ @@ -195,21 +195,5 @@ int prison_if(struct ucred *cred, struct sockaddr *sa); int prison_priv_check(struct ucred *cred, int priv); -/* - * Kernel jail services. - */ -struct prison_service; -typedef int (*prison_create_t)(struct prison_service *psrv, struct prison *pr); -typedef int (*prison_destroy_t)(struct prison_service *psrv, struct prison *pr); - -struct prison_service *prison_service_register(const char *name, - prison_create_t create, prison_destroy_t destroy); -void prison_service_deregister(struct prison_service *psrv); - -void prison_service_data_set(struct prison_service *psrv, struct prison *pr, - void *data); -void *prison_service_data_get(struct prison_service *psrv, struct prison *pr); -void *prison_service_data_del(struct prison_service *psrv, struct prison *pr); - #endif /* _KERNEL */ #endif /* !_SYS_JAIL_H_ */ From owner-p4-projects@FreeBSD.ORG Tue Feb 17 21:44:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 902E41065692; Tue, 17 Feb 2009 21:44:41 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 485C2106567B for ; Tue, 17 Feb 2009 21:44:41 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 36E188FC18 for ; Tue, 17 Feb 2009 21:44:41 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1HLif6Q019885 for ; Tue, 17 Feb 2009 21:44:41 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1HLifsY019883 for perforce@freebsd.org; Tue, 17 Feb 2009 21:44:41 GMT (envelope-from julian@freebsd.org) Date: Tue, 17 Feb 2009 21:44:41 GMT Message-Id: <200902172144.n1HLifsY019883@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157871 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 21:44:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=157871 Change 157871 by julian@julian_trafmon1 on 2009/02/17 21:44:30 chase -current.. IFC@157869 Affected files ... .. //depot/projects/vimage/src/sys/dev/ata/ata-all.c#11 integrate .. //depot/projects/vimage/src/sys/netinet/ipprotosw.h#3 delete Differences ... ==== //depot/projects/vimage/src/sys/dev/ata/ata-all.c#11 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.292 2009/02/17 21:17:21 mav Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.293 2009/02/17 21:35:17 mav Exp $"); #include "opt_ata.h" #include @@ -358,7 +358,6 @@ } } while (0); mtx_unlock(&ch->state_mtx); - return; } /* From owner-p4-projects@FreeBSD.ORG Wed Feb 18 09:30:44 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 45AE71065675; Wed, 18 Feb 2009 09:30:44 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F031D1065670 for ; Wed, 18 Feb 2009 09:30:43 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C47EE8FC15 for ; Wed, 18 Feb 2009 09:30:43 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1I9Uh8P029420 for ; Wed, 18 Feb 2009 09:30:43 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1I9Uh7o029418 for perforce@freebsd.org; Wed, 18 Feb 2009 09:30:43 GMT (envelope-from zec@icir.org) Date: Wed, 18 Feb 2009 09:30:43 GMT Message-Id: <200902180930.n1I9Uh7o029418@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157883 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 09:30:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=157883 Change 157883 by zec@zec_amdx2 on 2009/02/18 09:29:49 Unbreak build. Affected files ... .. //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#27 edit Differences ... ==== //depot/projects/vimage/src/sys/nfsclient/nfs_vnops.c#27 (text+ko) ==== @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include From owner-p4-projects@FreeBSD.ORG Wed Feb 18 16:45:14 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 032061065675; Wed, 18 Feb 2009 16:45:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B532E106566B for ; Wed, 18 Feb 2009 16:45:13 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A25BB8FC27 for ; Wed, 18 Feb 2009 16:45:13 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IGjDCM078744 for ; Wed, 18 Feb 2009 16:45:13 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1IGjDww078742 for perforce@freebsd.org; Wed, 18 Feb 2009 16:45:13 GMT (envelope-from zec@icir.org) Date: Wed, 18 Feb 2009 16:45:13 GMT Message-Id: <200902181645.n1IGjDww078742@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157896 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 16:45:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=157896 Change 157896 by zec@zec_amdx2 on 2009/02/18 16:44:56 First pass at simplifying the initializer infrastructure. Define IS_DEFAULT_VNET() macro to always return true for non-VIMAGE builds, which paves the path for removal of many #ifdef VIMAGE lines in initializer functions. Consistently allocate a uma zone pool for each vnet subsystem, where needed. This might not be the most memory efficient strategy, but ATM releives us of the issue of handling overcommited zone pools shared by multiple vnets. OTOH we still haven't addressed the issue of potential uma_zcreate() failures on vnet creation. While here, nuke struct uma_zone *divcbzone, as it seems that no code uses / references it. Hmm. TODO: inet6, ipsec etc. Affected files ... .. //depot/projects/vimage/src/sys/net/if.c#65 edit .. //depot/projects/vimage/src/sys/net/if_loop.c#37 edit .. //depot/projects/vimage/src/sys/netinet/igmp.c#24 edit .. //depot/projects/vimage/src/sys/netinet/ip_divert.c#26 edit .. //depot/projects/vimage/src/sys/netinet/ip_input.c#47 edit .. //depot/projects/vimage/src/sys/netinet/raw_ip.c#40 edit .. //depot/projects/vimage/src/sys/netinet/tcp_sack.c#18 edit .. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#73 edit .. //depot/projects/vimage/src/sys/netinet/tcp_timewait.c#26 edit .. //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#48 edit .. //depot/projects/vimage/src/sys/netinet/vinet.h#45 edit .. //depot/projects/vimage/src/sys/sys/vimage.h#78 edit Differences ... ==== //depot/projects/vimage/src/sys/net/if.c#65 (text+ko) ==== @@ -661,17 +661,13 @@ mac_ifnet_create(ifp); #endif -#ifdef VIMAGE if (IS_DEFAULT_VNET(curvnet)) { -#endif - ifdev_setbyindex(ifp->if_index, make_dev(&net_cdevsw, - ifp->if_index, UID_ROOT, GID_WHEEL, 0600, "%s/%s", - net_cdevsw.d_name, ifp->if_xname)); - make_dev_alias(ifdev_byindex(ifp->if_index), "%s%d", - net_cdevsw.d_name, ifp->if_index); -#ifdef VIMAGE + ifdev_setbyindex(ifp->if_index, make_dev(&net_cdevsw, + ifp->if_index, UID_ROOT, GID_WHEEL, 0600, "%s/%s", + net_cdevsw.d_name, ifp->if_xname)); + make_dev_alias(ifdev_byindex(ifp->if_index), "%s%d", + net_cdevsw.d_name, ifp->if_index); } -#endif ifq_attach(&ifp->if_snd, ifp); @@ -723,10 +719,8 @@ if_attachdomain1(ifp); EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); -#ifdef VIMAGE if (IS_DEFAULT_VNET(curvnet)) -#endif - devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); + devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); /* Announce the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); @@ -931,13 +925,8 @@ * Clean up all addresses. */ ifp->if_addr = NULL; -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - destroy_dev(ifdev_byindex(ifp->if_index)); -#ifdef VIMAGE - } -#endif + if (IS_DEFAULT_VNET(curvnet)) + destroy_dev(ifdev_byindex(ifp->if_index)); ifdev_setbyindex(ifp->if_index, NULL); /* We can now free link ifaddr. */ @@ -966,10 +955,8 @@ /* Announce that the interface is gone. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE); EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); -#ifdef VIMAGE if (IS_DEFAULT_VNET(curvnet)) -#endif - devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); + devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); IF_AFDATA_LOCK(ifp); for (dp = domains; dp; dp = dp->dom_next) { @@ -1633,11 +1620,10 @@ (*lagg_linkstate_p)(ifp, link_state); } -#ifdef VIMAGE if (IS_DEFAULT_VNET(curvnet)) -#endif - devctl_notify("IFNET", ifp->if_xname, - (link_state == LINK_STATE_UP) ? "LINK_UP" : "LINK_DOWN", NULL); + devctl_notify("IFNET", ifp->if_xname, + (link_state == LINK_STATE_UP) ? "LINK_UP" : "LINK_DOWN", + NULL); if (pending > 1) if_printf(ifp, "%d link states coalesced\n", pending); if (log_link_state_change) ==== //depot/projects/vimage/src/sys/net/if_loop.c#37 (text+ko) ==== @@ -185,14 +185,10 @@ INIT_VNET_NET(curvnet); LIST_INIT(&V_lo_list); -#ifdef VIMAGE if (IS_DEFAULT_VNET(curvnet)) if_clone_attach(&lo_cloner); else lo_cloner.ifc_attach(&lo_cloner); -#else - if_clone_attach(&lo_cloner); -#endif return 0; } ==== //depot/projects/vimage/src/sys/netinet/igmp.c#24 (text+ko) ==== @@ -125,9 +125,11 @@ INIT_VNET_INET(curvnet); struct ipoption *ra; -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif + SLIST_INIT(&V_router_info_head); + + if (!IS_DEFAULT_VNET(curvnet)) + return; + /* * To avoid byte-swapping the same value over and over again. */ @@ -149,11 +151,6 @@ router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1]; mtx_init(&igmp_mtx, "igmp_mtx", NULL, MTX_DEF); -#ifdef VIMAGE - } -#endif - - SLIST_INIT(&V_router_info_head); } static struct router_info * ==== //depot/projects/vimage/src/sys/netinet/ip_divert.c#26 (text+ko) ==== @@ -122,56 +122,16 @@ static struct inpcbhead divcb; static struct inpcbinfo divcbinfo; #endif -static struct uma_zone *divcbzone; static u_long div_sendspace = DIVSNDQ; /* XXX sysctl ? */ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? */ -/* - * Initialize divert connection block queue. - */ -static void -div_zone_change(void *tag) -{ - - uma_zone_set_max(divcbzone, maxsockets); -} - -static int -div_inpcb_init(void *mem, int size, int flags) -{ - struct inpcb *inp = mem; - - INP_LOCK_INIT(inp, "inp", "divinp"); - return (0); -} - -static void -div_inpcb_fini(void *mem, int size) -{ - struct inpcb *inp = mem; - - INP_LOCK_DESTROY(inp); -} - void div_init(void) { INIT_VNET_INET(curvnet); -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - divcbzone = uma_zcreate("divcb", sizeof(struct inpcb), - NULL, NULL, div_inpcb_init, div_inpcb_fini, UMA_ALIGN_PTR, - UMA_ZONE_NOFREE); - uma_zone_set_max(divcbzone, maxsockets); - EVENTHANDLER_REGISTER(maxsockets_change, div_zone_change, - NULL, EVENTHANDLER_PRI_ANY); -#ifdef VIMAGE - } V_divcbinfo.ipi_vnet = curvnet; -#endif INP_INFO_LOCK_INIT(&V_divcbinfo, "div"); LIST_INIT(&V_divcb); V_divcbinfo.ipi_listhead = &V_divcb; @@ -727,7 +687,7 @@ static int div_modevent(module_t mod, int type, void *unused) { - INIT_VNET_INET(curvnet); /* XXX fixme! */ + INIT_VNET_INET(curvnet); /* XXX fixme! MARKO */ int err = 0; int n; @@ -772,7 +732,6 @@ err = pf_proto_unregister(PF_INET, IPPROTO_DIVERT, SOCK_RAW); INP_INFO_WUNLOCK(&V_divcbinfo); INP_INFO_LOCK_DESTROY(&V_divcbinfo); - uma_zdestroy(divcbzone); break; default: err = EOPNOTSUPP; ==== //depot/projects/vimage/src/sys/netinet/ip_input.c#47 (text+ko) ==== @@ -294,11 +294,11 @@ NULL, UMA_ALIGN_PTR, 0); maxnipq_update(); -#ifdef VIMAGE + V_ip_id = time_second & 0xffff; + /* Skip initialization of globals for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; -#endif pr = pffindproto(PF_INET, IPPROTO_RAW, SOCK_RAW); if (pr == NULL) @@ -337,7 +337,6 @@ /* Initialize various other remaining things. */ IPQ_LOCK_INIT(); - V_ip_id = time_second & 0xffff; ipintrq.ifq_maxlen = ipqmaxlen; mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF); netisr_register(NETISR_IP, ip_input, &ipintrq, 0); ==== //depot/projects/vimage/src/sys/netinet/raw_ip.c#40 (text+ko) ==== @@ -82,8 +82,8 @@ #ifdef VIMAGE_GLOBALS struct inpcbhead ripcb; struct inpcbinfo ripcbinfo; +static struct uma_zone *ripcb_zone; #endif -static struct uma_zone *ripcb_zone; /* control hooks for ipfw and dummynet */ ip_fw_ctl_t *ip_fw_ctl_ptr = NULL; @@ -185,15 +185,9 @@ { INIT_VNET_INET(curvnet); -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - ripcb_zone = uma_zcreate("ripcb", sizeof(struct inpcb), + V_ripcb_zone = uma_zcreate("ripcb", sizeof(struct inpcb), NULL, NULL, rip_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); -#ifdef VIMAGE - } V_ripcbinfo.ipi_vnet = curvnet; -#endif INP_INFO_LOCK_INIT(&V_ripcbinfo, "rip"); LIST_INIT(&V_ripcb); @@ -202,7 +196,7 @@ hashinit(INP_PCBHASH_RAW_SIZE, M_PCB, &V_ripcbinfo.ipi_hashmask); V_ripcbinfo.ipi_porthashbase = hashinit(1, M_PCB, &V_ripcbinfo.ipi_porthashmask); - V_ripcbinfo.ipi_zone = ripcb_zone; + V_ripcbinfo.ipi_zone = V_ripcb_zone; uma_zone_set_max(V_ripcbinfo.ipi_zone, maxsockets); EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, NULL, EVENTHANDLER_PRI_ANY); ==== //depot/projects/vimage/src/sys/netinet/tcp_sack.c#18 (text+ko) ==== @@ -123,9 +123,8 @@ #include +#ifdef VIMAGE_GLOBALS extern struct uma_zone *sack_hole_zone; - -#ifdef VIMAGE_GLOBALS int tcp_do_sack; int tcp_sack_maxholes; int tcp_sack_globalmaxholes; @@ -265,7 +264,7 @@ return NULL; } - hole = (struct sackhole *)uma_zalloc(sack_hole_zone, M_NOWAIT); + hole = (struct sackhole *)uma_zalloc(V_sack_hole_zone, M_NOWAIT); if (hole == NULL) return NULL; @@ -287,7 +286,7 @@ { INIT_VNET_INET(tp->t_vnet); - uma_zfree(sack_hole_zone, hole); + uma_zfree(V_sack_hole_zone, hole); tp->snd_numholes--; V_tcp_sack_globalholes--; ==== //depot/projects/vimage/src/sys/netinet/tcp_subr.c#73 (text+ko) ==== @@ -269,7 +269,6 @@ struct tcp_timer tt; }; -static uma_zone_t tcpcb_zone; MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); struct callout isn_callout; static struct mtx isn_mtx; @@ -278,7 +277,10 @@ #define ISN_LOCK() mtx_lock(&isn_mtx) #define ISN_UNLOCK() mtx_unlock(&isn_mtx) +#ifdef VIMAGE_GLOBALS +static uma_zone_t tcpcb_zone; static struct uma_zone *tcp_ipi_zone; +#endif /* * TCP initialization. @@ -286,9 +288,10 @@ static void tcp_zone_change(void *tag) { + INIT_VNET_INET(curvnet); /* XXX */ - uma_zone_set_max(tcp_ipi_zone, maxsockets); - uma_zone_set_max(tcpcb_zone, maxsockets); + uma_zone_set_max(V_tcp_ipi_zone, maxsockets); + uma_zone_set_max(V_tcpcb_zone, maxsockets); tcp_tw_zone_change(); } @@ -344,23 +347,17 @@ V_tcp_autosndbuf_max = 256*1024; -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - tcp_ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb), + V_tcp_ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb), NULL, NULL, tcp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(tcp_ipi_zone, maxsockets); + uma_zone_set_max(V_tcp_ipi_zone, maxsockets); /* * These have to be type stable for the benefit of the timers. */ - tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem), + V_tcpcb_zone = uma_zcreate("tcpcb", sizeof(struct tcpcb_mem), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(tcpcb_zone, maxsockets); - sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), + uma_zone_set_max(V_tcpcb_zone, maxsockets); + V_sack_hole_zone = uma_zcreate("sackhole", sizeof(struct sackhole), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); -#ifdef VIMAGE - } -#endif tcp_tw_init(); @@ -398,7 +395,7 @@ &V_tcbinfo.ipi_hashmask); V_tcbinfo.ipi_porthashbase = hashinit(hashsize, M_PCB, &V_tcbinfo.ipi_porthashmask); - V_tcbinfo.ipi_zone = tcp_ipi_zone; + V_tcbinfo.ipi_zone = V_tcp_ipi_zone; V_tcbinfo.ipi_vnet = curvnet; #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) @@ -413,13 +410,11 @@ syncache_init(); tcp_hc_init(); + tcp_reass_init(); -#ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return; -#endif - tcp_reass_init(); ISN_LOCK_INIT(); callout_init(&isn_callout, CALLOUT_MPSAFE); callout_reset(&isn_callout, 1, tcp_isn_tick, NULL); @@ -723,7 +718,7 @@ int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ - tm = uma_zalloc(tcpcb_zone, M_NOWAIT | M_ZERO); + tm = uma_zalloc(V_tcpcb_zone, M_NOWAIT | M_ZERO); if (tm == NULL) return (NULL); tp = &tm->tcb; @@ -896,7 +891,7 @@ tcp_free_sackholes(tp); inp->inp_ppcb = NULL; tp->t_inpcb = NULL; - uma_zfree(tcpcb_zone, tp); + uma_zfree(V_tcpcb_zone, tp); } /* ==== //depot/projects/vimage/src/sys/netinet/tcp_timewait.c#26 (text+ko) ==== @@ -94,7 +94,6 @@ #include -static uma_zone_t tcptw_zone; static int maxtcptw; /* @@ -104,6 +103,7 @@ * tcbinfo lock, which must be held over queue iteration and modification. */ #ifdef VIMAGE_GLOBALS +static uma_zone_t tcptw_zone; static TAILQ_HEAD(, tcptw) twq_2msl; int nolocaltimewait; #endif @@ -132,6 +132,7 @@ static int sysctl_maxtcptw(SYSCTL_HANDLER_ARGS) { + INIT_VNET_INET(curvnet); int error, new; if (maxtcptw == 0) @@ -142,7 +143,7 @@ if (error == 0 && req->newptr) if (new >= 32) { maxtcptw = new; - uma_zone_set_max(tcptw_zone, maxtcptw); + uma_zone_set_max(V_tcptw_zone, maxtcptw); } return (error); } @@ -158,9 +159,10 @@ void tcp_tw_zone_change(void) { + INIT_VNET_INET(curvnet); /* XXX */ if (maxtcptw == 0) - uma_zone_set_max(tcptw_zone, tcptw_auto_size()); + uma_zone_set_max(V_tcptw_zone, tcptw_auto_size()); } void @@ -170,18 +172,13 @@ TAILQ_INIT(&V_twq_2msl); -#ifdef VIMAGE - if (!IS_DEFAULT_VNET(curvnet)) - return; -#endif - - tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw), + V_tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); TUNABLE_INT_FETCH("net.inet.tcp.maxtcptw", &maxtcptw); if (maxtcptw == 0) - uma_zone_set_max(tcptw_zone, tcptw_auto_size()); + uma_zone_set_max(V_tcptw_zone, tcptw_auto_size()); else - uma_zone_set_max(tcptw_zone, maxtcptw); + uma_zone_set_max(V_tcptw_zone, maxtcptw); } #ifdef VIMAGE @@ -224,7 +221,7 @@ return; } - tw = uma_zalloc(tcptw_zone, M_NOWAIT); + tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { tw = tcp_tw_2msl_scan(1); if (tw == NULL) { @@ -542,7 +539,7 @@ tw->tw_cred = NULL; if (reuse) return; - uma_zfree(tcptw_zone, tw); + uma_zfree(V_tcptw_zone, tw); } int ==== //depot/projects/vimage/src/sys/netinet/udp_usrreq.c#48 (text+ko) ==== @@ -152,13 +152,16 @@ static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *); +#ifdef VIMAGE_GLOBALS static struct uma_zone *udp_ipi_zone; +#endif static void udp_zone_change(void *tag) { + INIT_VNET_INET(curvnet); /* XXX */ - uma_zone_set_max(udp_ipi_zone, maxsockets); + uma_zone_set_max(V_udp_ipi_zone, maxsockets); } static int @@ -178,18 +181,12 @@ V_udp_blackhole = 0; -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - udp_ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL, + V_udp_ipi_zone = uma_zcreate("udpcb", sizeof(struct inpcb), NULL, NULL, udp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(udp_ipi_zone, maxsockets); + uma_zone_set_max(V_udp_ipi_zone, maxsockets); EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL, EVENTHANDLER_PRI_ANY); -#ifdef VIMAGE - } V_udbinfo.ipi_vnet = curvnet; -#endif INP_INFO_LOCK_INIT(&V_udbinfo, "udp"); LIST_INIT(&V_udb); @@ -198,7 +195,7 @@ &V_udbinfo.ipi_hashmask); V_udbinfo.ipi_porthashbase = hashinit(UDBHASHSIZE, M_PCB, &V_udbinfo.ipi_porthashmask); - V_udbinfo.ipi_zone = udp_ipi_zone; + V_udbinfo.ipi_zone = V_udp_ipi_zone; } #ifdef VIMAGE ==== //depot/projects/vimage/src/sys/netinet/vinet.h#45 (text+ko) ==== @@ -86,6 +86,12 @@ struct tcp_hostcache _tcp_hostcache; struct callout _tcp_hc_callout; + struct uma_zone *_tcp_ipi_zone; + struct uma_zone *_tcpcb_zone; + struct uma_zone *_tcptw_zone; + struct uma_zone *_sack_hole_zone; + struct uma_zone *_udp_ipi_zone; + struct tcp_syncache _tcp_syncache; int _tcp_syncookies; int _tcp_syncookiesonly; @@ -149,6 +155,7 @@ struct inpcbhead _ripcb; struct inpcbinfo _ripcbinfo; + struct uma_zone *_ripcb_zone; struct socket *_ip_mrouter; struct socket *_ip_rsvpd; @@ -277,6 +284,7 @@ #define V_reply_src VNET_INET(reply_src) #define V_ripcb VNET_INET(ripcb) #define V_ripcbinfo VNET_INET(ripcbinfo) +#define V_ripcb_zone VNET_INET(ripcb_zone) #define V_router_info_head VNET_INET(router_info_head) #define V_rsvp_on VNET_INET(rsvp_on) #define V_rtq_minreallyold VNET_INET(rtq_minreallyold) @@ -284,6 +292,7 @@ #define V_rtq_timeout VNET_INET(rtq_timeout) #define V_rtq_timer VNET_INET(rtq_timer) #define V_rtq_toomany VNET_INET(rtq_toomany) +#define V_sack_hole_zone VNET_INET(sack_hole_zone) #define V_sameprefixcarponly VNET_INET(sameprefixcarponly) #define V_ss_fltsz VNET_INET(ss_fltsz) #define V_ss_fltsz_local VNET_INET(ss_fltsz_local) @@ -315,6 +324,7 @@ #define V_tcp_inflight_rttthresh VNET_INET(tcp_inflight_rttthresh) #define V_tcp_inflight_stab VNET_INET(tcp_inflight_stab) #define V_tcp_insecure_rst VNET_INET(tcp_insecure_rst) +#define V_tcp_ipi_zone VNET_INET(tcp_ipi_zone) #define V_tcp_isn_reseed_interval VNET_INET(tcp_isn_reseed_interval) #define V_tcp_minmss VNET_INET(tcp_minmss) #define V_tcp_mssdflt VNET_INET(tcp_mssdflt) @@ -330,11 +340,14 @@ #define V_tcp_syncookies VNET_INET(tcp_syncookies) #define V_tcp_syncookiesonly VNET_INET(tcp_syncookiesonly) #define V_tcp_v6mssdflt VNET_INET(tcp_v6mssdflt) +#define V_tcpcb_zone VNET_INET(tcpcb_zone) +#define V_tcptw_zone VNET_INET(tcptw_zone) #define V_tcpstat VNET_INET(tcpstat) #define V_twq_2msl VNET_INET(twq_2msl) #define V_udb VNET_INET(udb) #define V_udbinfo VNET_INET(udbinfo) #define V_udp_blackhole VNET_INET(udp_blackhole) +#define V_udp_ipi_zone VNET_INET(udp_ipi_zone) #define V_udpstat VNET_INET(udpstat) #define V_useloopback VNET_INET(useloopback) ==== //depot/projects/vimage/src/sys/sys/vimage.h#78 (text+ko) ==== @@ -311,6 +311,7 @@ #else /* !VIMAGE */ /* Non-VIMAGE null-macros */ +#define IS_DEFAULT_VNET(arh) 1 #define CURVNET_SET(arg) #define CURVNET_SET_QUIET(arg) #define CURVNET_RESTORE() From owner-p4-projects@FreeBSD.ORG Wed Feb 18 17:54:25 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0D295106568E; Wed, 18 Feb 2009 17:54:24 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB749106568C for ; Wed, 18 Feb 2009 17:54:23 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9913B8FC17 for ; Wed, 18 Feb 2009 17:54:23 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IHsNHf094841 for ; Wed, 18 Feb 2009 17:54:23 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1IHsNM5094839 for perforce@freebsd.org; Wed, 18 Feb 2009 17:54:23 GMT (envelope-from zec@icir.org) Date: Wed, 18 Feb 2009 17:54:23 GMT Message-Id: <200902181754.n1IHsNM5094839@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157897 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 17:54:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=157897 Change 157897 by zec@zec_tpx32 on 2009/02/18 17:54:09 Remove the rest of unnecessary #ifdef / #ifndef lines, now that IS_DEFAULT_VNET() is always defined. s/arh/arg/ typo in vimage.h. Affected files ... .. //depot/projects/vimage/src/sys/netinet6/frag6.c#26 edit .. //depot/projects/vimage/src/sys/netinet6/in6_src.c#36 edit .. //depot/projects/vimage/src/sys/netinet6/ip6_input.c#48 edit .. //depot/projects/vimage/src/sys/netinet6/scope6.c#22 edit .. //depot/projects/vimage/src/sys/netipsec/key.c#35 edit .. //depot/projects/vimage/src/sys/netipsec/xform_ipip.c#24 edit .. //depot/projects/vimage/src/sys/sys/vimage.h#79 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet6/frag6.c#26 (text+ko) ==== @@ -112,10 +112,10 @@ V_ip6q.ip6q_next = V_ip6q.ip6q_prev = &V_ip6q; V_ip6_maxfragpackets = nmbclusters / 4; V_ip6_maxfrags = nmbclusters / 4; -#ifdef VIMAGE + if (!IS_DEFAULT_VNET(curvnet)) return; -#endif + EVENTHANDLER_REGISTER(nmbclusters_change, frag6_change, NULL, EVENTHANDLER_PRI_ANY); ==== //depot/projects/vimage/src/sys/netinet6/in6_src.c#36 (text+ko) ==== @@ -930,10 +930,8 @@ bzero(&V_defaultaddrpolicy, sizeof(V_defaultaddrpolicy)); V_defaultaddrpolicy.label = ADDR_LABEL_NOTAPP; -#ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return; -#endif ADDRSEL_LOCK_INIT(); ADDRSEL_SXLOCK_INIT(); ==== //depot/projects/vimage/src/sys/netinet6/ip6_input.c#48 (text+ko) ==== @@ -252,11 +252,11 @@ nd6_init(); frag6_init(); -#ifdef VIMAGE + V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; + /* Skip global initialization stuff for non-default instances. */ if (!IS_DEFAULT_VNET(curvnet)) return; -#endif #ifdef DIAGNOSTIC if (sizeof(struct protosw) != sizeof(struct ip6protosw)) @@ -292,7 +292,6 @@ ip6intrq.ifq_maxlen = V_ip6qmaxlen; mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF); netisr_register(NETISR_IPV6, ip6_input, &ip6intrq, 0); - V_ip6_desync_factor = arc4random() % MAX_TEMP_DESYNC_FACTOR; } #ifdef VIMAGE ==== //depot/projects/vimage/src/sys/netinet6/scope6.c#22 (text+ko) ==== @@ -84,10 +84,8 @@ bzero(&V_sid_default, sizeof(V_sid_default)); -#ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return; -#endif SCOPE6_LOCK_INIT(); } ==== //depot/projects/vimage/src/sys/netipsec/key.c#35 (text+ko) ==== @@ -7190,17 +7190,6 @@ V_ipsec_esp_auth = 0; V_ipsec_ah_keymin = 128; -#ifdef VIMAGE - if (IS_DEFAULT_VNET(curvnet)) { -#endif - SPTREE_LOCK_INIT(); - REGTREE_LOCK_INIT(); - SAHTREE_LOCK_INIT(); - ACQ_LOCK_INIT(); - SPACQ_LOCK_INIT(); -#ifdef VIMAGE - } -#endif for (i = 0; i < IPSEC_DIR_MAX; i++) LIST_INIT(&V_sptree[i]); @@ -7216,10 +7205,14 @@ V_ip4_def_policy.policy = IPSEC_POLICY_NONE; V_ip4_def_policy.refcnt++; /*never reclaim this*/ -#ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return; -#endif + + SPTREE_LOCK_INIT(); + REGTREE_LOCK_INIT(); + SAHTREE_LOCK_INIT(); + ACQ_LOCK_INIT(); + SPACQ_LOCK_INIT(); #ifndef IPSEC_DEBUG2 timeout((void *)key_timehandler, (void *)0, hz); ==== //depot/projects/vimage/src/sys/netipsec/xform_ipip.c#24 (text+ko) ==== @@ -708,10 +708,8 @@ V_ipip_allow = 0; -#ifdef VIMAGE if (!IS_DEFAULT_VNET(curvnet)) return 0; -#endif xform_register(&ipe4_xformsw); /* attach to encapsulation framework */ ==== //depot/projects/vimage/src/sys/sys/vimage.h#79 (text+ko) ==== @@ -311,7 +311,7 @@ #else /* !VIMAGE */ /* Non-VIMAGE null-macros */ -#define IS_DEFAULT_VNET(arh) 1 +#define IS_DEFAULT_VNET(arg) 1 #define CURVNET_SET(arg) #define CURVNET_SET_QUIET(arg) #define CURVNET_RESTORE() From owner-p4-projects@FreeBSD.ORG Wed Feb 18 19:02:42 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7E6F31065672; Wed, 18 Feb 2009 19:02:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D3F41065670 for ; Wed, 18 Feb 2009 19:02:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8AD8FC1C for ; Wed, 18 Feb 2009 19:02:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IJ2fJt001353 for ; Wed, 18 Feb 2009 19:02:41 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1IJ2fmh001351 for perforce@freebsd.org; Wed, 18 Feb 2009 19:02:41 GMT (envelope-from julian@freebsd.org) Date: Wed, 18 Feb 2009 19:02:41 GMT Message-Id: <200902181902.n1IJ2fmh001351@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157903 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 19:02:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=157903 Change 157903 by julian@julian_trafmon1 on 2009/02/18 19:02:37 make epair compile may not be correct Affected files ... .. //depot/projects/vimage/src/sys/net/if_epair.c#4 edit Differences ... ==== //depot/projects/vimage/src/sys/net/if_epair.c#4 (text+ko) ==== @@ -323,12 +323,12 @@ #ifdef ALTQ /* Support ALTQ via the clasic if_start() path. */ - IF_LOCK(ifq); + IF_LOCK(&epairinq); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); if (error) ifp->if_snd.ifq_drops++; - IF_UNLOCK(ifq); + IF_UNLOCK(&epairinq); if (!error) { ifp->if_obytes += len; if (mflags & (M_BCAST|M_MCAST)) @@ -341,7 +341,7 @@ } return (error); } - IF_UNLOCK(ifq); + IF_UNLOCK(&epairinq); #endif if ((epair_drv_flags & IFF_DRV_OACTIVE) != 0) { From owner-p4-projects@FreeBSD.ORG Wed Feb 18 21:36:23 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 76F831065674; Wed, 18 Feb 2009 21:36:23 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36A7B106566B for ; Wed, 18 Feb 2009 21:36:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 19DD48FC1F for ; Wed, 18 Feb 2009 21:36:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ILaMNT025932 for ; Wed, 18 Feb 2009 21:36:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1ILaMBI025930 for perforce@freebsd.org; Wed, 18 Feb 2009 21:36:22 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 18 Feb 2009 21:36:22 GMT Message-Id: <200902182136.n1ILaMBI025930@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157909 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 21:36:24 -0000 http://perforce.freebsd.org/chv.cgi?CH=157909 Change 157909 by hselasky@hselasky_laptop001 on 2009/02/18 21:35:44 USB CORE: Changes to make implementing USB NDIS easier. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#53 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.h#13 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#35 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#12 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#53 (text+ko) ==== @@ -323,6 +323,40 @@ } /*------------------------------------------------------------------------* + * usb2_pipe_foreach + * + * This function will iterate all the USB endpoints except the control + * endpoint. This function is NULL safe. + * + * Return values: + * NULL: End of USB pipes + * Else: Pointer to next USB pipe + *------------------------------------------------------------------------*/ +struct usb2_pipe * +usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe) +{ + struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX; + + /* be NULL safe */ + if (udev == NULL) + return (NULL); + + /* get next pipe */ + if (pipe == NULL) + pipe = udev->pipes; + else + pipe++; + + /* find next allocated pipe */ + while (pipe != pipe_end) { + if (pipe->edesc != NULL) + return (pipe); + pipe++; + } + return (NULL); +} + +/*------------------------------------------------------------------------* * usb2_fill_iface_data * * This function will fill in interface data and allocate USB pipes @@ -1430,7 +1464,7 @@ * 0. If this value is different from "USB_MAX_IPACKET" a new * USB control request will be setup! */ - err = usb2_req_get_desc(udev, &Giant, &udev->ddesc, + err = usb2_req_get_desc(udev, &Giant, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.h#13 (text+ko) ==== @@ -183,5 +183,6 @@ uint8_t subtype, uint8_t subtype_mask); void usb_linux_free_device(struct usb_device *dev); uint8_t usb2_peer_can_wakeup(struct usb2_device *udev); +struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe); #endif /* _USB2_DEVICE_H_ */ ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.c#35 (text+ko) ==== @@ -615,17 +615,24 @@ * argument specifies the minimum descriptor length. The "max_len" * argument specifies the maximum descriptor length. If the real * descriptor length is less than the minimum length the missing - * byte(s) will be zeroed. The length field, first byte, of the USB - * descriptor will get overwritten in case it indicates a length that - * is too big. Also the type field, second byte, of the USB descriptor - * will get forced to the correct type. + * byte(s) will be zeroed. The type field, the second byte of the USB + * descriptor, will get forced to the correct type. If the "actlen" + * pointer is non-NULL, the actual length of the transfer will get + * stored in the 16-bit unsigned integer which it is pointing to. The + * first byte of the descriptor will not get updated. If the "actlen" + * pointer is NULL the first byte of the descriptor will get updated + * to reflect the actual length instead. If "min_len" is not equal to + * "max_len" then this function will try to retrive the beginning of + * the descriptor and base the maximum length on the first byte of the + * descriptor. * * Returns: * 0: Success * Else: Failure *------------------------------------------------------------------------*/ usb2_error_t -usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, void *desc, +usb2_req_get_desc(struct usb2_device *udev, + struct mtx *mtx, uint16_t *actlen, void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, uint8_t type, uint8_t index, uint8_t retries) @@ -667,11 +674,11 @@ if (min_len == max_len) { - /* enforce correct type and length */ + /* enforce correct length */ + if ((buf[0] > min_len) && (actlen == NULL)) + buf[0] = min_len; - if (buf[0] > min_len) { - buf[0] = min_len; - } + /* enforce correct type */ buf[1] = type; goto done; @@ -693,6 +700,12 @@ min_len = max_len; } done: + if (actlen != NULL) { + if (err) + *actlen = 0; + else + *actlen = min_len; + } return (err); } @@ -808,7 +821,7 @@ uint16_t max_len, uint16_t lang_id, uint8_t string_index) { - return (usb2_req_get_desc(udev, mtx, sdesc, 2, max_len, lang_id, + return (usb2_req_get_desc(udev, mtx, NULL, sdesc, 2, max_len, lang_id, UDESC_STRING, string_index, 0)); } @@ -827,7 +840,7 @@ DPRINTFN(4, "confidx=%d\n", conf_index); - err = usb2_req_get_desc(udev, mtx, d, sizeof(*d), + err = usb2_req_get_desc(udev, mtx, NULL, d, sizeof(*d), sizeof(*d), 0, UDESC_CONFIG, conf_index, 0); if (err) { goto done; @@ -878,7 +891,7 @@ if (cdesc == NULL) { return (USB_ERR_NOMEM); } - err = usb2_req_get_desc(udev, mtx, cdesc, len, len, 0, + err = usb2_req_get_desc(udev, mtx, NULL, cdesc, len, len, 0, UDESC_CONFIG, index, 3); if (err) { free(cdesc, mtype); @@ -904,7 +917,7 @@ struct usb2_device_descriptor *d) { DPRINTFN(4, "\n"); - return (usb2_req_get_desc(udev, mtx, d, sizeof(*d), + return (usb2_req_get_desc(udev, mtx, NULL, d, sizeof(*d), sizeof(*d), 0, UDESC_DEVICE, 0, 3)); } @@ -1407,7 +1420,7 @@ usb2_pause_mtx(mtx, USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); /* get the device descriptor */ - err = usb2_req_get_desc(udev, mtx, &udev->ddesc, + err = usb2_req_get_desc(udev, mtx, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_request.h#12 (text+ko) ==== @@ -50,8 +50,9 @@ struct mtx *mtx, struct usb2_config_descriptor **ppcd, struct malloc_type *mtype, uint8_t conf_index); usb2_error_t usb2_req_get_desc(struct usb2_device *udev, struct mtx *mtx, - void *desc, uint16_t min_len, uint16_t max_len, uint16_t id, - uint8_t type, uint8_t index, uint8_t retries); + uint16_t *actlen, void *desc, uint16_t min_len, + uint16_t max_len, uint16_t id, uint8_t type, + uint8_t index, uint8_t retries); usb2_error_t usb2_req_get_device_desc(struct usb2_device *udev, struct mtx *mtx, struct usb2_device_descriptor *d); usb2_error_t usb2_req_get_device_status(struct usb2_device *udev, From owner-p4-projects@FreeBSD.ORG Wed Feb 18 22:06:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CDD201065676; Wed, 18 Feb 2009 22:06:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B67F106564A for ; Wed, 18 Feb 2009 22:06:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6013A8FC0C for ; Wed, 18 Feb 2009 22:06:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IM6stt029301 for ; Wed, 18 Feb 2009 22:06:54 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1IM6sFF029299 for perforce@freebsd.org; Wed, 18 Feb 2009 22:06:54 GMT (envelope-from jhb@freebsd.org) Date: Wed, 18 Feb 2009 22:06:54 GMT Message-Id: <200902182206.n1IM6sFF029299@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 157912 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:06:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=157912 Change 157912 by jhb@jhb_jhbbsd on 2009/02/18 22:05:55 Add new branch. Affected files ... .. //depot/projects/smpng/sys/notes#97 edit Differences ... ==== //depot/projects/smpng/sys/notes#97 (text+ko) ==== @@ -70,5 +70,6 @@ - jhb_needresched - scheduler fun - jhb_preemption - preemption - jhb_proc - proc locking +- jhb_socket - socket hacking Space reserved for child branches: From owner-p4-projects@FreeBSD.ORG Thu Feb 19 01:19:16 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6042C1065670; Thu, 19 Feb 2009 01:19:16 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D925106566B for ; Thu, 19 Feb 2009 01:19:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0BE6A8FC17 for ; Thu, 19 Feb 2009 01:19:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1J1JFME059643 for ; Thu, 19 Feb 2009 01:19:15 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1J1JFTw059641 for perforce@freebsd.org; Thu, 19 Feb 2009 01:19:15 GMT (envelope-from julian@freebsd.org) Date: Thu, 19 Feb 2009 01:19:15 GMT Message-Id: <200902190119.n1J1JFTw059641@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157918 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 01:19:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=157918 Change 157918 by julian@julian_trafmon1 on 2009/02/19 01:18:56 make LINT compile Affected files ... .. //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#10 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet/sctp_crc32.c#10 (text+ko) ==== @@ -30,17 +30,16 @@ /* $KAME: sctp_crc32.c,v 1.12 2005/03/06 16:04:17 itojun Exp $ */ - #include __FBSDID("$FreeBSD: src/sys/netinet/sctp_crc32.c,v 1.14 2009/02/14 11:34:57 rrs Exp $"); +#include #include #include #include #include #include #include -#include #include #include From owner-p4-projects@FreeBSD.ORG Thu Feb 19 11:37:51 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 83CBD1065675; Thu, 19 Feb 2009 11:37:50 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 326B4106564A for ; Thu, 19 Feb 2009 11:37:50 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 16DA48FC1F for ; Thu, 19 Feb 2009 11:37:50 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JBbnpn040899 for ; Thu, 19 Feb 2009 11:37:49 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JBbnO2040897 for perforce@freebsd.org; Thu, 19 Feb 2009 11:37:49 GMT (envelope-from zec@icir.org) Date: Thu, 19 Feb 2009 11:37:49 GMT Message-Id: <200902191137.n1JBbnO2040897@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157930 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 11:37:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=157930 Change 157930 by zec@zec_amdx2 on 2009/02/19 11:37:02 Make ipfw_dyn_rule_zone and tcp_reass_zone per-vnet. Affected files ... .. //depot/projects/vimage/src/sys/netinet/ip_fw.h#26 edit .. //depot/projects/vimage/src/sys/netinet/ip_fw2.c#68 edit .. //depot/projects/vimage/src/sys/netinet/tcp_reass.c#12 edit .. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#74 edit .. //depot/projects/vimage/src/sys/netinet/vinet.h#46 edit Differences ... ==== //depot/projects/vimage/src/sys/netinet/ip_fw.h#26 (text+ko) ==== @@ -718,6 +718,7 @@ int _fw_debug; int _autoinc_step; ipfw_dyn_rule **_ipfw_dyn_v; + uma_zone_t _ipfw_dyn_rule_zone; struct ip_fw_chain _layer3_chain; u_int32_t _dyn_buckets; u_int32_t _curr_dyn_buckets; @@ -762,6 +763,7 @@ #define V_fw_debug VNET_IPFW(fw_debug) #define V_autoinc_step VNET_IPFW(autoinc_step) #define V_ipfw_dyn_v VNET_IPFW(ipfw_dyn_v) +#define V_ipfw_dyn_rule_zone VNET_IPFW(ipfw_dyn_rule_zone) #define V_layer3_chain VNET_IPFW(layer3_chain) #define V_dyn_buckets VNET_IPFW(dyn_buckets) #define V_curr_dyn_buckets VNET_IPFW(curr_dyn_buckets) ==== //depot/projects/vimage/src/sys/netinet/ip_fw2.c#68 (text+ko) ==== @@ -129,14 +129,7 @@ static int fw_verbose; static struct callout ipfw_timeout; static int verbose_limit; -#endif - static uma_zone_t ipfw_dyn_rule_zone; - -/* - * list of rules for layer 3 - */ -#ifdef VIMAGE_GLOBALS struct ip_fw_chain layer3_chain; #endif @@ -1079,7 +1072,7 @@ else \ head = q = q->next; \ V_dyn_count--; \ - uma_zfree(ipfw_dyn_rule_zone, old_q); } + uma_zfree(V_ipfw_dyn_rule_zone, old_q); } #define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) @@ -1380,7 +1373,7 @@ } i = hash_packet(id); - r = uma_zalloc(ipfw_dyn_rule_zone, M_NOWAIT | M_ZERO); + r = uma_zalloc(V_ipfw_dyn_rule_zone, M_NOWAIT | M_ZERO); if (r == NULL) { printf ("ipfw: sorry cannot allocate state\n"); return NULL; @@ -4557,12 +4550,9 @@ V_layer3_chain.rules = NULL; IPFW_LOCK_INIT(&V_layer3_chain); -#if 0 /* XXX Marko fix this! */ - ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule", + V_ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule", sizeof(ipfw_dyn_rule), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - IPFW_DYN_LOCK_INIT(); -#endif callout_init(&V_ipfw_timeout, CALLOUT_MPSAFE); bzero(&default_rule, sizeof default_rule); @@ -4583,13 +4573,13 @@ if (error != 0) { printf("ipfw2: error %u initializing default rule " "(support disabled)\n", error); - IPFW_DYN_LOCK_DESTROY(); + IPFW_DYN_LOCK_DESTROY(); /* XXX MARKO REVISIT */ IPFW_LOCK_DESTROY(&V_layer3_chain); - uma_zdestroy(ipfw_dyn_rule_zone); + uma_zdestroy(V_ipfw_dyn_rule_zone); return (error); } - ip_fw_default_rule = V_layer3_chain.rules; + ip_fw_default_rule = V_layer3_chain.rules; /* XXX V_ this ? MARKO */ #ifdef IPFIREWALL_VERBOSE V_fw_verbose = 1; @@ -4618,21 +4608,8 @@ int ipfw_init(void) { - ipfw_dyn_rule_zone = uma_zcreate("IPFW dynamic rule", - sizeof(ipfw_dyn_rule), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); IPFW_DYN_LOCK_INIT(); -#if 0 /* MARKO XXX */ - /* error = init_tables(&V_layer3_chain); moved to _iattach() */ - if (error) { - IPFW_DYN_LOCK_DESTROY(); - IPFW_LOCK_DESTROY(&V_layer3_chain); - uma_zdestroy(ipfw_dyn_rule_zone); - return (error); - } -#endif - #ifndef VIMAGE_GLOBALS vnet_mod_register(&vnet_ipfw_modinfo); #else @@ -4704,6 +4681,7 @@ if (V_ipfw_dyn_v != NULL) free(V_ipfw_dyn_v, M_IPFW); + uma_zdestroy(V_ipfw_dyn_rule_zone); return 0; } @@ -4723,7 +4701,6 @@ ipfw_nat_destroy(); #endif IPFW_DYN_LOCK_DESTROY(); - uma_zdestroy(ipfw_dyn_rule_zone); printf("IP firewall unloaded\n"); } ==== //depot/projects/vimage/src/sys/netinet/tcp_reass.c#12 (text+ko) ==== @@ -108,10 +108,12 @@ INIT_VNET_INET(curvnet); V_tcp_reass_maxseg = nmbclusters / 16; - uma_zone_set_max(tcp_reass_zone, V_tcp_reass_maxseg); + uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); } +#ifdef VIMAGE_GLOBALS uma_zone_t tcp_reass_zone; +#endif void tcp_reass_init(void) @@ -126,9 +128,9 @@ V_tcp_reass_maxseg = nmbclusters / 16; TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments", &V_tcp_reass_maxseg); - tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), + V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(tcp_reass_zone, V_tcp_reass_maxseg); + uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -180,7 +182,7 @@ * Allocate a new queue entry. If we can't, or hit the zone limit * just drop the pkt. */ - te = uma_zalloc(tcp_reass_zone, M_NOWAIT); + te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { V_tcpstat.tcps_rcvmemdrop++; m_freem(m); @@ -213,7 +215,7 @@ V_tcpstat.tcps_rcvduppack++; V_tcpstat.tcps_rcvdupbyte += *tlenp; m_freem(m); - uma_zfree(tcp_reass_zone, te); + uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; V_tcp_reass_qsize--; /* @@ -250,7 +252,7 @@ nq = LIST_NEXT(q, tqe_q); LIST_REMOVE(q, tqe_q); m_freem(q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; q = nq; @@ -287,7 +289,7 @@ m_freem(q->tqe_m); else sbappendstream_locked(&so->so_rcv, q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; q = nq; ==== //depot/projects/vimage/src/sys/netinet/tcp_subr.c#74 (text+ko) ==== @@ -881,7 +881,7 @@ while ((q = LIST_FIRST(&tp->t_segq)) != NULL) { LIST_REMOVE(q, tqe_q); m_freem(q->tqe_m); - uma_zfree(tcp_reass_zone, q); + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; V_tcp_reass_qsize--; } @@ -964,7 +964,7 @@ != NULL) { LIST_REMOVE(te, tqe_q); m_freem(te->tqe_m); - uma_zfree(tcp_reass_zone, te); + uma_zfree(V_tcp_reass_zone, te); tcpb->t_segqlen--; V_tcp_reass_qsize--; } ==== //depot/projects/vimage/src/sys/netinet/vinet.h#46 (text+ko) ==== @@ -87,6 +87,7 @@ struct callout _tcp_hc_callout; struct uma_zone *_tcp_ipi_zone; + struct uma_zone *_tcp_reass_zone; struct uma_zone *_tcpcb_zone; struct uma_zone *_tcptw_zone; struct uma_zone *_sack_hole_zone; @@ -332,6 +333,7 @@ #define V_tcp_reass_maxseg VNET_INET(tcp_reass_maxseg) #define V_tcp_reass_overflows VNET_INET(tcp_reass_overflows) #define V_tcp_reass_qsize VNET_INET(tcp_reass_qsize) +#define V_tcp_reass_zone VNET_INET(tcp_reass_zone) #define V_tcp_sack_globalholes VNET_INET(tcp_sack_globalholes) #define V_tcp_sack_globalmaxholes VNET_INET(tcp_sack_globalmaxholes) #define V_tcp_sack_maxholes VNET_INET(tcp_sack_maxholes) From owner-p4-projects@FreeBSD.ORG Thu Feb 19 13:53:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6835510656D1; Thu, 19 Feb 2009 13:53:08 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5DA10656C8 for ; Thu, 19 Feb 2009 13:53:08 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EAEC58FC25 for ; Thu, 19 Feb 2009 13:53:07 +0000 (UTC) (envelope-from zec@icir.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JDr7qH063120 for ; Thu, 19 Feb 2009 13:53:07 GMT (envelope-from zec@icir.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JDr7NB063118 for perforce@freebsd.org; Thu, 19 Feb 2009 13:53:07 GMT (envelope-from zec@icir.org) Date: Thu, 19 Feb 2009 13:53:07 GMT Message-Id: <200902191353.n1JDr7NB063118@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zec@icir.org using -f From: Marko Zec To: Perforce Change Reviews Cc: Subject: PERFORCE change 157932 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 13:53:12 -0000 http://perforce.freebsd.org/chv.cgi?CH=157932 Change 157932 by zec@zec_amdx2 on 2009/02/19 13:52:15 Fix a panic when reassigning ifnet from one vnet to another. Affected files ... .. //depot/projects/vimage/src/sys/kern/kern_vimage.c#75 edit .. //depot/projects/vimage/src/sys/net/if.c#66 edit .. //depot/projects/vimage/src/sys/net/if_var.h#28 edit Differences ... ==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#75 (text+ko) ==== @@ -382,7 +382,8 @@ IFNET_WLOCK(); ifnet_setbyindex(ifp->if_index, NULL); - while (V_if_index > 0 && ifnet_byindex(V_if_index) == NULL) + while (V_if_index > 0 && + ifnet_byindex_locked(V_if_index) == NULL) V_if_index--; IFNET_WUNLOCK(); } while (0); @@ -395,7 +396,7 @@ */ IFNET_WLOCK(); for (ifp->if_index = 1; ifp->if_index <= V_if_index; ifp->if_index++) { - if (ifnet_byindex(ifp->if_index) == NULL) + if (ifnet_byindex_locked(ifp->if_index) == NULL) break; } /* Catch if_index overflow. */ ==== //depot/projects/vimage/src/sys/net/if.c#66 (text+ko) ==== @@ -216,7 +216,7 @@ MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); -static struct ifnet * +struct ifnet * ifnet_byindex_locked(u_short idx) { INIT_VNET_NET(curvnet); ==== //depot/projects/vimage/src/sys/net/if_var.h#28 (text+ko) ==== @@ -704,6 +704,7 @@ void ifnet_setbyindex(u_short idx, struct ifnet *ifp); struct ifnet *ifnet_byindex(u_short idx); +struct ifnet *ifnet_byindex_locked(u_short idx); /* * Given the index, ifaddr_byindex() returns the one and only From owner-p4-projects@FreeBSD.ORG Thu Feb 19 14:25:43 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EAA0510656F2; Thu, 19 Feb 2009 14:25:42 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E60B10656C8 for ; Thu, 19 Feb 2009 14:25:42 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id ED3F48FC42 for ; Thu, 19 Feb 2009 14:25:40 +0000 (UTC) (envelope-from antab@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JEPe4K066471 for ; Thu, 19 Feb 2009 14:25:40 GMT (envelope-from antab@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JEPe04066469 for perforce@freebsd.org; Thu, 19 Feb 2009 14:25:40 GMT (envelope-from antab@FreeBSD.org) Date: Thu, 19 Feb 2009 14:25:40 GMT Message-Id: <200902191425.n1JEPe04066469@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to antab@FreeBSD.org using -f From: Arnar Mar Sig To: Perforce Change Reviews Cc: Subject: PERFORCE change 157933 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 14:25:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=157933 Change 157933 by antab@antab_farm on 2009/02/19 14:25:27 More AVR32 code. The kernel is now able to go thru 5 kernel thread switches before giving up. It crashes somewhere in cpu_switch because old kstack is no longer in the tlb, not sure why this doesn't happen before the 5 switch. Affected files ... .. //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#5 edit .. //depot/projects/avr32/src/sys/avr32/avr32/exception.S#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/genassym.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/intr.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/locore.S#2 edit .. //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#6 edit .. //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/support.S#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/switch.S#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/tlb.c#3 edit .. //depot/projects/avr32/src/sys/avr32/avr32/trap.c#4 edit .. //depot/projects/avr32/src/sys/avr32/avr32/vm_machdep.c#5 edit .. //depot/projects/avr32/src/sys/avr32/conf/NGW100#6 edit .. //depot/projects/avr32/src/sys/avr32/include/atomic.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/db_machdep.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/intr.h#4 edit .. //depot/projects/avr32/src/sys/avr32/include/param.h#2 edit .. //depot/projects/avr32/src/sys/avr32/include/pcb.h#4 edit .. //depot/projects/avr32/src/sys/avr32/include/pmap.h#2 edit .. //depot/projects/avr32/src/sys/avr32/include/proc.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/reg.h#5 edit .. //depot/projects/avr32/src/sys/avr32/include/reg_ocd.h#1 add .. //depot/projects/avr32/src/sys/avr32/include/tlb.h#3 edit .. //depot/projects/avr32/src/sys/avr32/include/trap.h#2 edit .. //depot/projects/avr32/src/sys/conf/Makefile.avr32#2 edit .. //depot/projects/avr32/src/sys/conf/files.avr32#5 edit Differences ... ==== //depot/projects/avr32/src/sys/avr32/avr32/cpu.c#5 (text+ko) ==== @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -71,6 +72,18 @@ /* Set exception vector */ sysreg_write(EVBA, (uint32_t)&_evba); __asm__ __volatile__ ("csrf %0" : : "i"(AT32_SYS_SR_EM)); + +#if 0 // defined(DDB) + /* + * Enable Debug mode in monitor mode. Allow peripherals to run + * while in debug mode so we can report tru uart. + */ + ocdreg_write(DC, + bit_offset(OCD, DC, DBE) | + bit_offset(OCD, DC, RID) | + bit_offset(OCD, DC, MM)); + __asm__ __volatile__ ("csrf %0" : : "i"(AT32_SYS_SR_DM)); +#endif } void @@ -88,7 +101,7 @@ void cpu_reset(void) { - avr32_impl(); + ocdreg_write(DC, bit_offset(OCD, DC, RES)); } /** ==== //depot/projects/avr32/src/sys/avr32/avr32/exception.S#4 (text+ko) ==== @@ -64,14 +64,6 @@ .long AT32AP700X_BASE + AT32AP700X_INTC_OFFSET + \ AT32_INTC_ICR0 - (4 * num); -#if 0 -#define IRQ(num) \ - GLOBAL(intr_handle##num); \ - sub r12, pc, (. - i##num); \ - bral panic; \ -i##num: .asciz "IRQ!"; - -#endif .section .text.evba,"ax",@progbits .align 2 @@ -79,11 +71,11 @@ .align 2 /* 0x00 Unrecoverable exception */ bral handle_critical .align 2 /* 0x04 TLB multiple hit */ - bral handle_critical + bral tlb_critical .align 2 /* 0x08 Bus error data fetch */ - bral handle_critical + bral handle_bus_data_fetch_error .align 2 /* 0x0C Bus error instruction fetch */ - bral handle_critical + bral handle_bus_instruction_fetch_error .align 2 /* 0x10 nmi */ bral handle_mni .align 2 /* 0x14 Instruction Address */ @@ -100,7 +92,7 @@ bral handle_illegal_opcode .align 2 /* 0x2C FPU */ bral handle_illegal_opcode -.align 2 /* 0x30 Coprocessor absent */ +.align 2 /* 0x30 Coprocessor absent */ bral handle_illegal_opcode .align 2 /* 0x34 Data Address (Read) */ bral handle_address_fault @@ -131,7 +123,10 @@ .section .text.evba.syscall /* 0x100 Supervisor call */ .global supervisor_call supervisor_call: - rete + PUSH_TRAPFRAME(SUP) + /* call C syscall handler */ + POP_TRAPFRAME(SUP) + rets /* later this should be done in assembly, but using C for now */ tlb_miss: @@ -144,10 +139,28 @@ rete handle_critical: + breakpoint + mov r12, 0 + rcall panic rete +tlb_critical: + breakpoint + rete + +handle_bus_data_fetch_error: + breakpoint + rete + +handle_bus_instruction_fetch_error: + breakpoint + rete + handle_mni: + PUSH_TRAPFRAME(NMI) + mov r12, sp rcall intr_handle_mni + POP_TRAPFRAME(NMI) rete handle_illegal_opcode: @@ -155,6 +168,7 @@ mfsr r12, AT32_SYS_ECR mov r11, sp rcall trap_handle_illegal_opcode + POP_TRAPFRAME(EX) rete handle_address_fault: @@ -166,6 +180,7 @@ rete handle_protection_fault: + breakpoint PUSH_TRAPFRAME(EX) mfsr r12, AT32_SYS_ECR mov r11, sp @@ -174,16 +189,20 @@ rete handle_dtlb_modified: + PUSH_TRAPFRAME(EX) + mfsr r12, AT32_SYS_ECR + mov r11, sp rcall trap_handle_dtlb_modified + POP_TRAPFRAME(EX) rete handle_breakpoint: - PUSH_TRAPFRAME(EX) + PUSH_TRAPFRAME(DBG) mov r12, AT32_SYS_ECR mov r11, sp rcall trap_handle_breakpoint - POP_TRAPFRAME(EX) - rete + POP_TRAPFRAME(DBG) + retd IRQ(0) IRQ(1) ==== //depot/projects/avr32/src/sys/avr32/avr32/genassym.c#3 (text+ko) ==== @@ -40,3 +40,7 @@ ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PCB_SIZE, sizeof(struct trapframe)); +ASSYM(TD_KPTE, offsetof(struct thread, td_md.md_kpte)); +ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); +ASSYM(PMAP_ASID, offsetof(struct pmap, pm_asid)); +ASSYM(PMAP_PD, offsetof(struct pmap, pm_pd)); ==== //depot/projects/avr32/src/sys/avr32/avr32/intr.c#4 (text+ko) ==== @@ -66,7 +66,7 @@ } void -intr_handle_mni(void) +intr_handle_mni(struct trapframe *tf) { avr32_impl(); } ==== //depot/projects/avr32/src/sys/avr32/avr32/locore.S#2 (text+ko) ==== @@ -25,6 +25,7 @@ * $FreeBSD: $ */ +#include "opt_ddb.h" #include #include #include @@ -49,6 +50,12 @@ cp.w r2, r3 brlo 1b +#ifdef DDB + /* Set first frame pointer */ + mov lr, 0 + mov r7, 0 +#endif + /* Store tags address */ lddpc r0, uboot_tags_addr st.w r0[0], r11 @@ -85,8 +92,8 @@ proc0_stack_ptr: .long proc0_stack_end -proc0_stack: +GLOBAL(proc0_stack) .space KSTACK_SIZE .align 4 -GLOBAL(proc0_stack_end) +proc0_stack_end: ==== //depot/projects/avr32/src/sys/avr32/avr32/machdep.c#6 (text+ko) ==== @@ -78,7 +78,7 @@ struct pcpu __pcpu; struct pcpu *pcpup = &__pcpu; struct pcb proc0_pcb; -extern vm_offset_t proc0_stack_end; +extern vm_offset_t proc0_stack; extern uint64_t clock_cpu_frequency; vm_offset_t phys_avail[10]; @@ -111,7 +111,7 @@ avr32_init_proc0() { proc_linkup(&proc0, &thread0); - thread0.td_kstack = proc0_stack_end; + thread0.td_kstack = proc0_stack; thread0.td_kstack_pages = KSTACK_PAGES - 1; thread0.td_pcb = &proc0_pcb; thread0.td_frame = &thread0.td_pcb->pcb_regs; @@ -272,7 +272,7 @@ void makectx(struct trapframe *tf, struct pcb *pcb) { - avr32_impl(); + bcopy(&tf->regs, &pcb->pcb_regs, sizeof(struct trapframe)); } u_int32_t ==== //depot/projects/avr32/src/sys/avr32/avr32/pmap.c#4 (text+ko) ==== @@ -44,8 +44,6 @@ static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); static void free_pv_entry(pv_entry_t pv); static pv_entry_t get_pv_entry(void); -static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte); - static struct pmap kernel_pmap_store; @@ -62,7 +60,9 @@ static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; -pt_entry_t *pmap_pte(pmap_t pmap, vm_offset_t va) { +pt_entry_t +*pmap_pte(pmap_t pmap, vm_offset_t va) +{ pt_entry_t *pdaddr; pdaddr = (pt_entry_t *)pmap->pm_pd[pd_index_from_va(va)]; @@ -72,31 +72,33 @@ return NULL; } -void pmap_bootstrap(void) { +void +pmap_bootstrap(void) +{ pt_entry_t *pagetables; int i, j; - // phys_avail should be set in uboot_parse_targs + /* phys_avail should be set in uboot_parse_targs */ virtual_avail = VM_MIN_KERNEL_ADDRESS; virtual_end = VM_MAX_KERNEL_ADDRESS; - // Setup kernel pmap + /* Setup kernel pmap */ kernel_pmap = &kernel_pmap_store; PMAP_LOCK_INIT(kernel_pmap); kernel_pmap->pm_active = ~0; kernel_pmap->pm_asid = 0; kernel_pmap->pm_asid_generation = 0; - // Setup kernel page dir and table + /* Setup kernel page dir and table */ kernel_pmap->pm_pd = (pd_entry_t *)pmap_steal_memory(PAGE_SIZE); pagetables = (pt_entry_t *)pmap_steal_memory(PAGE_SIZE * NKPT); for (i = 0, j = (virtual_avail >> PD_SHIFT); i < NKPT; i++, j++) { kernel_pmap->pm_pd[j] = (pd_entry_t)(pagetables + (i * NPTEPG)); } - // Enable paging + /* Enable paging */ tlb_flush(); - sysreg_write(PTBR, (uint32_t)kernel_pmap); + sysreg_write(PTBR, (uint32_t)kernel_pmap->pm_pd); sysreg_write(MMUCR, bit_offset(SYS, MMUCR, S) | bit_offset(SYS, MMUCR, E) | @@ -104,7 +106,9 @@ nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); } -vm_offset_t pmap_steal_memory(vm_size_t size) { +vm_offset_t +pmap_steal_memory(vm_size_t size) +{ vm_size_t avail_size; vm_offset_t ret; @@ -121,7 +125,9 @@ return ret; } -void pmap_init(void) { +void +pmap_init(void) +{ pvzone = uma_zcreate("PV_ENTRY", sizeof(struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); pv_entry_max = PMAP_SHPGPERPROC * maxproc + cnt.v_page_count; @@ -133,7 +139,9 @@ * The pmap_pinit0() function initializes the physical map pm, associated * with process 0, the first process created in the system. */ -void pmap_pinit0(pmap_t pmap) { +void +pmap_pinit0(pmap_t pmap) +{ PMAP_LOCK_INIT(pmap); pmap->pm_pd = kernel_pmap->pm_pd; pmap->pm_active = 0; @@ -148,9 +156,10 @@ * The pmap_pinit() function initializes the preallocated and zeroed structure pmap, * such as one in a vmspace structure. */ -int pmap_pinit(pmap_t pmap) { +int +pmap_pinit(pmap_t pmap) +{ vm_page_t ptdpg; - PMAP_LOCK_INIT(pmap); /* allocate the page directory page */ @@ -158,12 +167,12 @@ VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_ZERO); - pmap->pm_pd = (pd_entry_t *)AVR32_PHYS_TO_P2(VM_PAGE_TO_PHYS(ptdpg)); - if ((ptdpg->flags & PG_ZERO) == 0) { - bzero(pmap->pm_pd, PAGE_SIZE); + pmap->pm_pd = (pd_entry_t *)AVR32_PHYS_TO_P1(VM_PAGE_TO_PHYS(ptdpg)); + if ((ptdpg->flags & PG_ZERO) == 0) { + bzero(pmap->pm_pd, PAGE_SIZE); } - pmap->pm_active = 0; + pmap->pm_active = 0; pmap->pm_asid = 0; pmap->pm_asid_generation = 0; TAILQ_INIT(&pmap->pm_pvlist); @@ -172,36 +181,57 @@ return(1); } -void pmap_activate(struct thread *td) { - avr32_impl(); +void +pmap_activate(struct thread *td) +{ + struct proc *p; + pmap_t pmap; + + p = td->td_proc; + pmap = vmspace_pmap(p->p_vmspace); + + pmap_asid_alloc(pmap); + PCPU_SET(curpmap, pmap); } -boolean_t pmap_is_modified(vm_page_t m) { +boolean_t +pmap_is_modified(vm_page_t m) +{ avr32_impl(); return (0); } -void pmap_clear_modify(vm_page_t m) { +void +pmap_clear_modify(vm_page_t m) +{ avr32_impl(); } -int pmap_ts_referenced(vm_page_t m) { +int +pmap_ts_referenced(vm_page_t m) +{ avr32_impl(); return (0); } -void pmap_clear_reference(vm_page_t m) { +void +pmap_clear_reference(vm_page_t m) +{ avr32_impl(); } -void pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { +void +pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) +{ avr32_impl(); } /* * Add page to kernel pmap */ -void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { +void +pmap_kenter(vm_offset_t va, vm_paddr_t pa) +{ pt_entry_t *ent; ent = pmap_pte(kernel_pmap, va); @@ -211,8 +241,6 @@ *ent = PTE_CACHEABLE | PTE_PERM_READ | PTE_PERM_WRITE; pfn_set(*ent, pa); - //printf("pmap_kenter: va: 0x%08X\tpa: 0x%08X\tent: 0x%08X\n", va, pa, *ent); - /* No need to do any tlb inserts, will just get a miss exception * when the page is needed */ } @@ -220,52 +248,70 @@ /* * Remove page from kernel pmap */ -void pmap_kremove(vm_offset_t va) { -/* pt_entry_t *ent; +void +pmap_kremove(vm_offset_t va) +{ + pt_entry_t *ent; ent = pmap_pte(kernel_pmap, va); *ent = 0; - cpu_tlb_flush();*/ + tlb_remove_entry(kernel_pmap, va); } /* * Extract the physical page address associated kernel virtual address. */ -vm_paddr_t pmap_kextract(vm_offset_t va) { +vm_paddr_t +pmap_kextract(vm_offset_t va) +{ return pmap_extract(kernel_pmap, va); } /* * Return whether or not the specified virtual address is elgible for prefault. */ -boolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) { +boolean_t +pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) +{ avr32_impl(); return (0); } -void pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, vm_offset_t src_addr) { +void +pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, vm_offset_t src_addr) +{ avr32_impl(); } -void pmap_copy_page(vm_page_t src, vm_page_t dst) { +void +pmap_copy_page(vm_page_t src, vm_page_t dst) +{ avr32_impl(); } -void pmap_zero_page(vm_page_t m) { +void +pmap_zero_page(vm_page_t m) +{ vm_paddr_t phys = VM_PAGE_TO_PHYS(m); bzero((caddr_t)AVR32_PHYS_TO_P2(phys), PAGE_SIZE); } -void pmap_zero_page_area(vm_page_t m, int off, int size) { +void +pmap_zero_page_area(vm_page_t m, int off, int size) +{ avr32_impl(); } -void pmap_zero_page_idle(vm_page_t m) { +void +pmap_zero_page_idle(vm_page_t m) +{ avr32_impl(); } -void pmap_qenter(vm_offset_t va, vm_page_t *m, int count) { +void +pmap_qenter(vm_offset_t va, vm_page_t *m, int count) +{ int i; for (i = 0; i < count; i++) { @@ -274,14 +320,18 @@ } } -void pmap_qremove(vm_offset_t va, int count) { +void +pmap_qremove(vm_offset_t va, int count) +{ while (count-- > 0) { pmap_kremove(va); va += PAGE_SIZE; } } -void pmap_page_init(vm_page_t m) { +void +pmap_page_init(vm_page_t m) +{ TAILQ_INIT(&m->md.pv_list); m->md.pv_list_count = 0; m->md.pv_flags = 0; @@ -290,7 +340,9 @@ /* * The pmap_growkernel() function grows the kernel virtual address space to the virtual address addr. */ -void pmap_growkernel(vm_offset_t addr) { +void +pmap_growkernel(vm_offset_t addr) +{ // Not really sure what to do here, need to look better into it, but the // kernel should have all the pages tables needed to grow within the P3 segment } @@ -299,11 +351,11 @@ * The pmap_map() function maps a range of physical addresses into kernel * virtual address (KVA) space, from start to end, with protection bits prot. */ -vm_offset_t pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { +vm_offset_t +pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) +{ vm_offset_t va, sva; - //printf("pmap_map: virt: 0x%08x\tstart: 0x%08x\tend: 0x%08x\n", *virt, start, end); - va = sva = *virt; while (start < end) { pmap_kenter(va, start); @@ -321,18 +373,19 @@ * If wired is TRUE, then increment the wired count for the page as soon as * the mapping is inserted into pmap. */ -void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { +void +pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, + vm_prot_t prot, boolean_t wired) +{ vm_offset_t pa, opa; pt_entry_t *pte; pt_entry_t origpte, newpte; vm_page_t mpte, om; - //printf("pmap_enter 0x%08X: va: 0x%08x\taccess: 0x%08x\tm: 0x%08x\tprot: 0x%08X\twired: %d\n", pmap, va, access, m, prot, wired); vm_page_lock_queues(); PMAP_LOCK(pmap); - mpte = NULL; if (va < VM_MAXUSER_ADDRESS) { mpte = pmap_allocpte(pmap, va, M_WAITOK); @@ -448,7 +501,7 @@ *pte = newpte; } } - pmap_update_page(pmap, va, newpte); + tlb_update_entry(pmap, va, newpte); vm_page_unlock_queues(); PMAP_UNLOCK(pmap); @@ -457,7 +510,9 @@ /* * Same as pmap_enter, but does not have to validate inputs. */ -void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { +void +pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) +{ avr32_impl(); } @@ -473,39 +528,56 @@ * is mapped; only those for which a resident page exists with the * corresponding offset from m_start are mapped. */ -void pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end, vm_page_t m_start, vm_prot_t prot) { +void +pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_offset_t end, + vm_page_t m_start, vm_prot_t prot) +{ avr32_impl(); } -void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { +void +pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +{ avr32_impl(); } -void pmap_remove_all(vm_page_t m) { +void +pmap_remove_all(vm_page_t m) +{ avr32_impl(); } -void pmap_remove_pages(pmap_t pmap) { +void +pmap_remove_pages(pmap_t pmap) +{ avr32_impl(); } -void pmap_remove_write(vm_page_t m) { +void +pmap_remove_write(vm_page_t m) +{ avr32_impl(); } -vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va) { +vm_paddr_t +pmap_extract(pmap_t pmap, vm_offset_t va) +{ pt_entry_t *ent; ent = pmap_pte(pmap, va); return pfn_get(*ent); } -vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { +vm_page_t +pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) +{ avr32_impl(); return (0); } -boolean_t pmap_page_exists_quick(pmap_t pmap, vm_page_t m) { +boolean_t +pmap_page_exists_quick(pmap_t pmap, vm_page_t m) +{ avr32_impl(); return (0); } @@ -513,7 +585,9 @@ /* * Set the physical protection on the specified range of this map as requested. */ -void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t pr) { +void +pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t pr) +{ avr32_impl(); } @@ -521,7 +595,10 @@ * Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. */ -void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { +void +pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, + vm_offset_t *addr, vm_size_t size) +{ // Not sure what to do here, unimplemented in ARM avr32_debug("pmap_align_superpage: Needs implementing?\n"); } @@ -529,7 +606,9 @@ /* * Return the number of managed mappings to the given physical page that are wired */ -int pmap_page_wired_mappings(vm_page_t m) { +int +pmap_page_wired_mappings(vm_page_t m) +{ avr32_impl(); return (0); } @@ -539,7 +618,9 @@ * addr in the physical map pmap is resident in physical memory. It is the * machine-dependent interface used by the mincore(2) system call. */ -int pmap_mincore(pmap_t pmap, vm_offset_t addr) { +int +pmap_mincore(pmap_t pmap, vm_offset_t addr) +{ avr32_impl(); return (0); } @@ -549,11 +630,16 @@ * processor address space. Note that some shortcuts * are taken, but the code works. */ -void pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_pindex_t pindex, vm_size_t size) { +void +pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, + vm_pindex_t pindex, vm_size_t size) +{ avr32_impl(); } -static vm_page_t _pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags) { +static vm_page_t +_pmap_allocpte(pmap_t pmap, unsigned ptepindex, int flags) +{ vm_offset_t ptepa; vm_page_t m; int req; @@ -592,13 +678,16 @@ * isn't already there. */ pmap->pm_stats.resident_count++; - ptepa = VM_PAGE_TO_PHYS(m); + ptepa = VM_PAGE_TO_PHYS(m); + printf("****: page: %x\n", ptepa); pmap->pm_pd[ptepindex] = (pd_entry_t)ptepa; - + avr32_impl(); return m; } -static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) { +static vm_page_t +pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags) +{ unsigned int pdindex; pd_entry_t pd; vm_page_t page; @@ -620,7 +709,9 @@ return page; } -static int page_is_managed(vm_offset_t pa) { +static int +page_is_managed(vm_offset_t pa) +{ vm_page_t m; m = PHYS_TO_VM_PAGE(pa); @@ -630,7 +721,10 @@ return 0; } -static void pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t mpte, vm_page_t m, boolean_t wired) { +static void +pmap_insert_entry(pmap_t pmap, vm_offset_t va, vm_page_t mpte, vm_page_t m, + boolean_t wired) +{ pv_entry_t pv; pv = get_pv_entry(); @@ -649,7 +743,9 @@ m->md.pv_list_count++; } -static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va) { +static void +pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va) +{ pv_entry_t pv; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -679,7 +775,9 @@ /* * free the pv_entry back to the free list */ -static void free_pv_entry(pv_entry_t pv) { +static void +free_pv_entry(pv_entry_t pv) +{ pv_entry_count--; uma_zfree(pvzone, pv); } @@ -690,7 +788,9 @@ * the memory allocation is performed bypassing the malloc code * because of the possibility of allocations at interrupt time. */ -static pv_entry_t get_pv_entry(void) { +static pv_entry_t +get_pv_entry(void) +{ pv_entry_count++; if (pv_entry_count > pv_entry_high_water) { wakeup(&vm_pages_needed); @@ -698,41 +798,37 @@ return uma_zalloc(pvzone, M_NOWAIT); } -static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) { - uint32_t tlbehi, mmucr; - - if (pmap->pm_asid_generation != PCPU_GET(asid_generation)) { - return; - } - - // Search tlb and update entry if found - tlbehi = va | pmap->pm_asid; - sysreg_write(TLBEHI, tlbehi); - - __builtin_tlbs(); - mmucr = sysreg_read(MMUCR); - - if (!(mmucr & bit_offset(SYS, MMUCR, N))) { - sysreg_write(TLBELO, (pte & bit_mask(SYS, TLBELO, SZ)) | PTE_DIRTY | PTE_SIZE_4K); - __builtin_tlbw(); - cpu_sync_pipeline(); +void +pmap_asid_alloc(pmap_t pmap) +{ + if (pmap->pm_asid_generation < PCPU_GET(asid_generation)) { + if (PCPU_GET(asid_next) == ASID_MAX) { + PCPU_INC(asid_generation); + PCPU_SET(asid_next, 0); + } + pmap->pm_asid = PCPU_GET(asid_next); + pmap->pm_asid_generation = PCPU_GET(asid_generation); + PCPU_INC(asid_next); } } - - /** * Called when we need to update the TLB */ -static int tlb_at; +static int tlb_at = KSTACK_PAGES; void pmap_tlb_miss(uint32_t ecr, uint32_t tlbear, uint32_t tlbehi) { - pmap_t pmap = (pmap_t)sysreg_read(PTBR); + pd_entry_t* pd = (pd_entry_t *)sysreg_read(PTBR); pt_entry_t *ent; + register_t mmucr; + + ent = (pt_entry_t *)pd[pd_index_from_va(tlbear)]; + if (ent) { + ent += pt_index_from_va(tlbear); + } - ent = pmap_pte(pmap, tlbear); if (!ent || !*ent) { printf("\nTLB miss: %x\n", ecr); - printf("pmap: %x\n", sysreg_read(PTBR)); + printf("pd: %x\n", sysreg_read(PTBR)); printf("TLBEAR: %x\n", tlbear); printf("TLBEHI: %x\n", tlbehi); printf("PC: %x\n", sysreg_read(RAR_EX)); @@ -741,33 +837,26 @@ panic("pmap_tlb_miss: address not in pmap\n"); } - // Generate ASID? - if (pmap->pm_asid_generation < PCPU_GET(asid_generation)) { - if (PCPU_GET(asid_next) == ASID_MAX) { - PCPU_INC(asid_generation); - PCPU_SET(asid_next, 0); - } - pmap->pm_asid = PCPU_GET(asid_next); - pmap->pm_asid_generation = PCPU_GET(asid_generation); - PCPU_INC(asid_next); - } + mmucr = sysreg_read(MMUCR); + mmucr &= ~bit_mask(SYS, MMUCR, DRP); + mmucr |= tlb_at << bit_shift(SYS, MMUCR, DRP); - // Insert into TLB - sysreg_write(TLBEHI, (tlbehi & bit_mask(SYS, TLBEHI, VPN)) | - bit_offset(SYS, TLBEHI, V) | - pmap->pm_asid); - sysreg_write(TLBELO, (*ent & ~bit_mask(SYS, TLBELO, SZ)) | PTE_DIRTY | PTE_SIZE_4K); - sysreg_write(MMUCR, bit_offset(SYS, MMUCR, S) | - bit_offset(SYS, MMUCR, E) | - bit_offset(SYS, MMUCR, I) | - (tlb_at << bit_shift(SYS, MMUCR, DRP))); + /* Insert into TLB */ + sysreg_write(TLBEHI, (tlbear & bit_mask(SYS, TLBEHI, VPN)) | + bit_offset(SYS, TLBEHI, V) | + (bit_mask(SYS, TLBEHI, ASID) & tlbehi)); + sysreg_write(TLBELO, (*ent & ~bit_mask(SYS, TLBELO, SZ)) | PTE_DIRTY | + PTE_SIZE_4K); + sysreg_write(MMUCR, mmucr); + nop(); - // Sync everything + /* Write and sync pipeline */ __builtin_tlbw(); cpu_sync_pipeline(); tlb_at++; if (tlb_at == TLB_SIZE) { - tlb_at = 0; + tlb_at = KSTACK_PAGES; } } + ==== //depot/projects/avr32/src/sys/avr32/avr32/support.S#4 (text+ko) ==== @@ -69,12 +69,14 @@ * r10: len */ ENTRY(bcopy) - mov r9, r10 - sub r9, 1 + cp r10, 0 + breq 2f + sub r10, 1 1: ld.ub r8, r12++ st.b r11++, r8 - sub r9, 1 + sub r10, 1 brge 1b +2: retal r12 /** @@ -83,11 +85,11 @@ * r11: len */ ENTRY(bzero) - mov r9, r12 - mov r8, 0 - sub r11, 1 >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Thu Feb 19 17:10:33 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 045A51065670; Thu, 19 Feb 2009 17:10:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5574106566B for ; Thu, 19 Feb 2009 17:10:32 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A36538FC0C for ; Thu, 19 Feb 2009 17:10:32 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JHAUIn092142 for ; Thu, 19 Feb 2009 17:10:30 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JHAT4W092138 for perforce@freebsd.org; Thu, 19 Feb 2009 17:10:29 GMT (envelope-from julian@freebsd.org) Date: Thu, 19 Feb 2009 17:10:29 GMT Message-Id: <200902191710.n1JHAT4W092138@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 157941 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:10:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=157941 Change 157941 by julian@julian_trafmon1 on 2009/02/19 17:09:57 Implement BZ's fix for altq to compile Affected files ... .. //depot/projects/vimage/src/sys/net/if_epair.c#5 edit Differences ... ==== //depot/projects/vimage/src/sys/net/if_epair.c#5 (text+ko) ==== @@ -323,12 +323,12 @@ #ifdef ALTQ /* Support ALTQ via the clasic if_start() path. */ - IF_LOCK(&epairinq); + IF_LOCK(&ifp->if_snd); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); if (error) ifp->if_snd.ifq_drops++; - IF_UNLOCK(&epairinq); + IF_UNLOCK(&ifp->if_snd); if (!error) { ifp->if_obytes += len; if (mflags & (M_BCAST|M_MCAST)) @@ -341,7 +341,7 @@ } return (error); } - IF_UNLOCK(&epairinq); + IF_UNLOCK(&ifp->if_snd); #endif if ((epair_drv_flags & IFF_DRV_OACTIVE) != 0) { From owner-p4-projects@FreeBSD.ORG Thu Feb 19 17:37:34 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78F0D1065674; Thu, 19 Feb 2009 17:37:34 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D081065678; Thu, 19 Feb 2009 17:37:34 +0000 (UTC) (envelope-from zec@icir.org) Received: from labs4.cc.fer.hr (labs4.cc.fer.hr [161.53.72.24]) by mx1.freebsd.org (Postfix) with ESMTP id A971D8FC15; Thu, 19 Feb 2009 17:37:32 +0000 (UTC) (envelope-from zec@icir.org) Received: from sluga.fer.hr (sluga.cc.fer.hr [161.53.72.14]) by labs4.cc.fer.hr (8.14.2/8.14.2) with ESMTP id n1JHP4On020228; Thu, 19 Feb 2009 18:25:05 +0100 (CET) Received: from [192.168.200.100] ([161.53.19.79]) by sluga.fer.hr with Microsoft SMTPSVC(6.0.3790.3959); Thu, 19 Feb 2009 18:24:37 +0100 From: Marko Zec To: Julian Elischer Date: Thu, 19 Feb 2009 18:24:29 +0100 User-Agent: KMail/1.9.10 References: <200902191710.n1JHAT4W092138@repoman.freebsd.org> In-Reply-To: <200902191710.n1JHAT4W092138@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902191824.30353.zec@icir.org> X-OriginalArrivalTime: 19 Feb 2009 17:24:37.0582 (UTC) FILETIME=[F0A506E0:01C992B6] X-Scanned-By: MIMEDefang 2.64 on 161.53.72.24 Cc: Perforce Change Reviews Subject: Re: PERFORCE change 157941 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:37:35 -0000 On Thursday 19 February 2009 18:10:29 Julian Elischer wrote: > http://perforce.freebsd.org/chv.cgi?CH=157941 > > Change 157941 by julian@julian_trafmon1 on 2009/02/19 17:09:57 > > Implement BZ's fix for altq to compile Thanks! Amazingly epair now really works with vimages! Though, all cloned instances always have the same unit number (0)... > Affected files ... > > .. //depot/projects/vimage/src/sys/net/if_epair.c#5 edit > > Differences ... > > ==== //depot/projects/vimage/src/sys/net/if_epair.c#5 (text+ko) ==== > > @@ -323,12 +323,12 @@ > > #ifdef ALTQ > /* Support ALTQ via the clasic if_start() path. */ > - IF_LOCK(&epairinq); > + IF_LOCK(&ifp->if_snd); > if (ALTQ_IS_ENABLED(&ifp->if_snd)) { > ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); > if (error) > ifp->if_snd.ifq_drops++; > - IF_UNLOCK(&epairinq); > + IF_UNLOCK(&ifp->if_snd); > if (!error) { > ifp->if_obytes += len; > if (mflags & (M_BCAST|M_MCAST)) > @@ -341,7 +341,7 @@ > } > return (error); > } > - IF_UNLOCK(&epairinq); > + IF_UNLOCK(&ifp->if_snd); > #endif > > if ((epair_drv_flags & IFF_DRV_OACTIVE) != 0) { From owner-p4-projects@FreeBSD.ORG Thu Feb 19 17:40:03 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31D5C106567A; Thu, 19 Feb 2009 17:40:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4FB91065678 for ; Thu, 19 Feb 2009 17:40:02 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D36BA8FC15 for ; Thu, 19 Feb 2009 17:40:02 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JHe292094425 for ; Thu, 19 Feb 2009 17:40:02 GMT (envelope-from sson@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JHe2SS094423 for perforce@freebsd.org; Thu, 19 Feb 2009 17:40:02 GMT (envelope-from sson@FreeBSD.org) Date: Thu, 19 Feb 2009 17:40:02 GMT Message-Id: <200902191740.n1JHe2SS094423@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sson@FreeBSD.org using -f From: Stacey Son To: Perforce Change Reviews Cc: Subject: PERFORCE change 157942 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 17:40:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=157942 Change 157942 by sson@sson_amd64 on 2009/02/19 17:39:56 Missing 'sizeof(u_char)' so the AUT_IPC_PERM audit record is one byte too small. Obtained from: todd_heberlein (at) mac com Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#90 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#90 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#89 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#90 $ */ #include @@ -487,7 +487,8 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); + GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 12 * sizeof(u_int16_t) + + sizeof(u_int32_t)); if (t == NULL) return (NULL); From owner-p4-projects@FreeBSD.ORG Thu Feb 19 18:01:32 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 53215106567E; Thu, 19 Feb 2009 18:01:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DCB4106567C for ; Thu, 19 Feb 2009 18:01:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id B85AA8FC27 for ; Thu, 19 Feb 2009 18:01:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id CF90741C69F; Thu, 19 Feb 2009 18:45:08 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id VFPk2rziu-sa; Thu, 19 Feb 2009 18:45:08 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 783FF41C6BB; Thu, 19 Feb 2009 18:45:08 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 68112444936; Thu, 19 Feb 2009 17:45:04 +0000 (UTC) Date: Thu, 19 Feb 2009 17:45:04 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Marko Zec In-Reply-To: <200902191824.30353.zec@icir.org> Message-ID: <20090219174342.S53478@maildrop.int.zabbadoz.net> References: <200902191710.n1JHAT4W092138@repoman.freebsd.org> <200902191824.30353.zec@icir.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Perforce Change Reviews , Julian Elischer Subject: Re: PERFORCE change 157941 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 18:01:33 -0000 On Thu, 19 Feb 2009, Marko Zec wrote: > On Thursday 19 February 2009 18:10:29 Julian Elischer wrote: >> http://perforce.freebsd.org/chv.cgi?CH=157941 >> >> Change 157941 by julian@julian_trafmon1 on 2009/02/19 17:09:57 >> >> Implement BZ's fix for altq to compile > > Thanks! > > Amazingly epair now really works with vimages! Though, all cloned > instances always have the same unit number (0)... *huh* are you sure? I'll get my test setup back online so ... and btw. it has worked with vimage before but the ointegrated head had paniced in new-arp somewhere;) Things will be improved along the path I guess, netisr2 from rwatson, proper testing ... >> Affected files ... >> >> .. //depot/projects/vimage/src/sys/net/if_epair.c#5 edit >> >> Differences ... >> >> ==== //depot/projects/vimage/src/sys/net/if_epair.c#5 (text+ko) ==== >> >> @@ -323,12 +323,12 @@ >> >> #ifdef ALTQ >> /* Support ALTQ via the clasic if_start() path. */ >> - IF_LOCK(&epairinq); >> + IF_LOCK(&ifp->if_snd); >> if (ALTQ_IS_ENABLED(&ifp->if_snd)) { >> ALTQ_ENQUEUE(&ifp->if_snd, m, NULL, error); >> if (error) >> ifp->if_snd.ifq_drops++; >> - IF_UNLOCK(&epairinq); >> + IF_UNLOCK(&ifp->if_snd); >> if (!error) { >> ifp->if_obytes += len; >> if (mflags & (M_BCAST|M_MCAST)) >> @@ -341,7 +341,7 @@ >> } >> return (error); >> } >> - IF_UNLOCK(&epairinq); >> + IF_UNLOCK(&ifp->if_snd); >> #endif >> >> if ((epair_drv_flags & IFF_DRV_OACTIVE) != 0) { > > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-p4-projects@FreeBSD.ORG Thu Feb 19 20:56:24 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 61D441065670; Thu, 19 Feb 2009 20:56:24 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21F4A106564A for ; Thu, 19 Feb 2009 20:56:24 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EA7AB8FC23 for ; Thu, 19 Feb 2009 20:56:23 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JKuN0r024169 for ; Thu, 19 Feb 2009 20:56:23 GMT (envelope-from bz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JKuNJA024167 for perforce@freebsd.org; Thu, 19 Feb 2009 20:56:23 GMT (envelope-from bz@freebsd.org) Date: Thu, 19 Feb 2009 20:56:23 GMT Message-Id: <200902192056.n1JKuNJA024167@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bz@freebsd.org using -f From: "Bjoern A. Zeeb" To: Perforce Change Reviews Cc: Subject: PERFORCE change 157950 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 20:56:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=157950 Change 157950 by bz@bz_dumpster on 2009/02/19 20:55:44 make xform_tcp compile with LINT + VIMAGE. Submitted by: julian Affected files ... .. //depot/projects/vimage/src/sys/netipsec/xform_tcp.c#5 edit Differences ... ==== //depot/projects/vimage/src/sys/netipsec/xform_tcp.c#5 (text+ko) ==== @@ -82,6 +82,7 @@ static int tcpsignature_init(struct secasvar *sav, struct xformsw *xsp) { + INIT_VNET_IPSEC(curvnet); int keylen; if (sav->spi != htonl(TCP_SIG_SPI)) { From owner-p4-projects@FreeBSD.ORG Thu Feb 19 22:20:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DBA0B1065670; Thu, 19 Feb 2009 22:20:54 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 907CF106564A for ; Thu, 19 Feb 2009 22:20:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7B37B8FC1A for ; Thu, 19 Feb 2009 22:20:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JMKseS039073 for ; Thu, 19 Feb 2009 22:20:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JMKsrq039071 for perforce@freebsd.org; Thu, 19 Feb 2009 22:20:54 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 19 Feb 2009 22:20:54 GMT Message-Id: <200902192220.n1JMKsrq039071@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157958 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:20:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=157958 Change 157958 by hselasky@hselasky_laptop001 on 2009/02/19 22:20:09 USB CORE: - We don't need to exit the Giant mutex when sleeping. This is done automatically. Replace Giant by NULL mutex for all control requests in the enumeration path. - Optimise away duplicate alternate interface selection requests in USB Host mode. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#54 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_generic.c#44 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_handle_request.c#16 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#39 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.c#54 (text+ko) ==== @@ -551,12 +551,12 @@ * device. "usb2_free_iface_data()" will also reset * the current config number and index. */ - err = usb2_req_set_config(udev, &Giant, USB_UNCONFIG_NO); + err = usb2_req_set_config(udev, NULL, USB_UNCONFIG_NO); goto done; } /* get the full config descriptor */ err = usb2_req_get_config_desc_full(udev, - &Giant, &cdp, M_USB, index); + NULL, &cdp, M_USB, index); if (err) { goto done; } @@ -583,7 +583,7 @@ * determined by the HUB characteristics. */ err = usb2_req_get_hub_descriptor - (udev, &Giant, &hd, 1); + (udev, NULL, &hd, 1); if (err) { DPRINTFN(0, "could not read " "HUB descriptor: %s\n", @@ -597,7 +597,7 @@ UGETW(hd.wHubCharacteristics)); } else { err = usb2_req_get_device_status - (udev, &Giant, &ds); + (udev, NULL, &ds); if (err) { DPRINTFN(0, "could not read " "device status: %s\n", @@ -640,7 +640,7 @@ udev->curr_config_index = index; /* Set the actual configuration value. */ - err = usb2_req_set_config(udev, &Giant, cdp->bConfigurationValue); + err = usb2_req_set_config(udev, NULL, cdp->bConfigurationValue); if (err) { goto done; } @@ -669,8 +669,10 @@ * * This function will select an alternate interface index for the * given interface index. The interface should not be in use when this - * function is called. That means there should be no open USB - * transfers. Else an error is returned. + * function is called. That means there should not be any open USB + * transfers. Else an error is returned. If the alternate setting is + * already set this function will simply return success. This function + * is called in Host mode and Device mode! * * Returns: * 0: Success @@ -697,6 +699,15 @@ } if (udev->flags.usb2_mode == USB_MODE_DEVICE) { usb2_detach_device(udev, iface_index, 1); + } else { + if (iface->alt_index == alt_index) { + /* + * Optimise away duplicate setting of + * alternate setting in USB Host Mode! + */ + err = 0; + goto done; + } } /* * Free all generic FIFOs for this interface, except control @@ -708,8 +719,7 @@ if (err) { goto done; } - err = usb2_req_set_alt_interface_no - (udev, &Giant, iface_index, + err = usb2_req_set_alt_interface_no(udev, NULL, iface_index, iface->idesc->bAlternateSetting); done: @@ -1415,7 +1425,7 @@ if (udev->flags.usb2_mode == USB_MODE_HOST) { - err = usb2_req_set_address(udev, &Giant, device_index); + err = usb2_req_set_address(udev, NULL, device_index); /* This is the new USB device address from now on */ @@ -1435,7 +1445,7 @@ "(ignored)\n", udev->address); } /* allow device time to set new address */ - usb2_pause_mtx(&Giant, + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); } else { /* We are not self powered */ @@ -1464,13 +1474,13 @@ * 0. If this value is different from "USB_MAX_IPACKET" a new * USB control request will be setup! */ - err = usb2_req_get_desc(udev, &Giant, NULL, &udev->ddesc, + err = usb2_req_get_desc(udev, NULL, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); if (err) { DPRINTFN(0, "getting device descriptor " "at addr %d failed!\n", udev->address); /* XXX try to re-enumerate the device */ - err = usb2_req_re_enumerate(udev, &Giant); + err = usb2_req_re_enumerate(udev, NULL); if (err) { goto done; } @@ -1486,7 +1496,7 @@ udev->speed); /* get the full device descriptor */ - err = usb2_req_get_device_desc(udev, &Giant, &udev->ddesc); + err = usb2_req_get_device_desc(udev, NULL, &udev->ddesc); if (err) { DPRINTF("addr=%d, getting full desc failed\n", udev->address); @@ -1525,7 +1535,7 @@ udev->ddesc.iProduct || udev->ddesc.iSerialNumber) { /* read out the language ID string */ - err = usb2_req_get_string_desc(udev, &Giant, + err = usb2_req_get_string_desc(udev, NULL, (char *)scratch_ptr, 4, scratch_size, USB_LANGUAGE_TABLE); } else { @@ -1544,21 +1554,21 @@ /* get serial number string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iSerialNumber); strlcpy(udev->serial, (char *)scratch_ptr, sizeof(udev->serial)); /* get manufacturer string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iManufacturer); strlcpy(udev->manufacturer, (char *)scratch_ptr, sizeof(udev->manufacturer)); /* get product string */ err = usb2_req_get_string_any - (udev, &Giant, (char *)scratch_ptr, + (udev, NULL, (char *)scratch_ptr, scratch_size, udev->ddesc.iProduct); strlcpy(udev->product, (char *)scratch_ptr, sizeof(udev->product)); @@ -1609,7 +1619,7 @@ set_config_failed = 1; /* XXX try to re-enumerate the device */ err = usb2_req_re_enumerate( - udev, &Giant); + udev, NULL); if (err == 0) goto repeat_set_config; } ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_generic.c#44 (text+ko) ==== @@ -664,7 +664,7 @@ } else { if (usb2_req_get_config_desc_full(udev, - &Giant, &cdesc, M_USBDEV, + NULL, &cdesc, M_USBDEV, ugd->ugd_config_index)) { return (ENXIO); } @@ -695,7 +695,7 @@ uint16_t size = sizeof(f->udev->bus->scratch[0].data); int error; - if (usb2_req_get_string_desc(f->udev, &Giant, ptr, + if (usb2_req_get_string_desc(f->udev, NULL, ptr, size, ugd->ugd_lang_id, ugd->ugd_string_index)) { error = EINVAL; } else { ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_handle_request.c#16 (text+ko) ==== @@ -277,6 +277,10 @@ } break; } + /* + * Doing the alternate setting will detach the + * interface aswell: + */ error = usb2_set_alt_interface_index(udev, iface_index, req.wValue[0]); if (error) { ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_hub.c#39 (text+ko) ==== @@ -244,7 +244,7 @@ usb2_error_t err; err = usb2_req_get_port_status( - sc->sc_udev, &Giant, &ps, portno); + sc->sc_udev, NULL, &ps, portno); /* update status regardless of error */ @@ -289,7 +289,7 @@ /* first clear the port connection change bit */ - err = usb2_req_clear_port_feature(udev, &Giant, + err = usb2_req_clear_port_feature(udev, NULL, portno, UHF_C_PORT_CONNECTION); if (err) { @@ -329,18 +329,18 @@ DPRINTF("Port %d was still " "suspended, clearing.\n", portno); err = usb2_req_clear_port_feature(sc->sc_udev, - &Giant, portno, UHF_PORT_SUSPEND); + NULL, portno, UHF_PORT_SUSPEND); } /* USB Host Mode */ /* wait for maximum device power up time */ - usb2_pause_mtx(&Giant, + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); /* reset port, which implies enabling it */ - err = usb2_req_reset_port(udev, &Giant, portno); + err = usb2_req_reset_port(udev, NULL, portno); if (err) { DPRINTFN(0, "port %d reset " @@ -425,7 +425,7 @@ if (err == 0) { if (sc->sc_st.port_status & UPS_PORT_ENABLED) { err = usb2_req_clear_port_feature( - sc->sc_udev, &Giant, + sc->sc_udev, NULL, portno, UHF_PORT_ENABLE); } } @@ -459,7 +459,7 @@ /* first clear the port suspend change bit */ - err = usb2_req_clear_port_feature(udev, &Giant, + err = usb2_req_clear_port_feature(udev, NULL, portno, UHF_C_PORT_SUSPEND); if (err) { DPRINTF("clearing suspend failed.\n"); @@ -542,7 +542,7 @@ if (sc->sc_st.port_change & UPS_C_OVERCURRENT_INDICATOR) { DPRINTF("Overcurrent on port %u.\n", portno); err = usb2_req_clear_port_feature( - udev, &Giant, portno, UHF_C_PORT_OVER_CURRENT); + udev, NULL, portno, UHF_C_PORT_OVER_CURRENT); if (err) { /* most likely the HUB is gone */ break; @@ -558,7 +558,7 @@ } if (sc->sc_st.port_change & UPS_C_PORT_ENABLED) { err = usb2_req_clear_port_feature( - udev, &Giant, portno, UHF_C_PORT_ENABLE); + udev, NULL, portno, UHF_C_PORT_ENABLE); if (err) { /* most likely the HUB is gone */ break; @@ -682,13 +682,13 @@ DPRINTFN(2, "getting HUB descriptor\n"); /* assuming that there is one port */ - err = usb2_req_get_hub_descriptor(udev, &Giant, &hubdesc, 1); + err = usb2_req_get_hub_descriptor(udev, NULL, &hubdesc, 1); nports = hubdesc.bNbrPorts; if (!err && (nports >= 8)) { /* get complete HUB descriptor */ - err = usb2_req_get_hub_descriptor(udev, &Giant, &hubdesc, nports); + err = usb2_req_get_hub_descriptor(udev, NULL, &hubdesc, nports); } if (err) { DPRINTFN(0, "getting hub descriptor failed," @@ -737,7 +737,7 @@ goto error; } /* wait with power off for a while */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_POWER_DOWN_TIME)); /* * To have the best chance of success we do things in the exact same @@ -784,7 +784,7 @@ } if (!err) { /* turn the power on */ - err = usb2_req_set_port_feature(udev, &Giant, + err = usb2_req_set_port_feature(udev, NULL, portno, UHF_PORT_POWER); } if (err) { @@ -795,7 +795,7 @@ portno); /* wait for stable power */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(pwrdly)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(pwrdly)); } device_printf(dev, "%d port%s with %d " @@ -1661,13 +1661,13 @@ /* resume current port (Valid in Host and Device Mode) */ err = usb2_req_clear_port_feature(udev->parent_hub, - &Giant, udev->port_no, UHF_PORT_SUSPEND); + NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { DPRINTFN(0, "Resuming port failed!\n"); return; } /* resume settle time */ - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -1703,7 +1703,7 @@ if (usb2_peer_can_wakeup(udev)) { /* clear remote wakeup */ err = usb2_req_clear_device_feature(udev, - &Giant, UF_DEVICE_REMOTE_WAKEUP); + NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Clearing device " "remote wakeup failed: %s!\n", @@ -1782,7 +1782,7 @@ if (usb2_peer_can_wakeup(udev)) { /* allow device to do remote wakeup */ err = usb2_req_set_device_feature(udev, - &Giant, UF_DEVICE_REMOTE_WAKEUP); + NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Setting device " "remote wakeup failed!\n"); @@ -1803,12 +1803,12 @@ /* do DMA delay */ temp = usb2_get_dma_delay(udev->bus); - usb2_pause_mtx(&Giant, USB_MS_TO_TICKS(temp)); + usb2_pause_mtx(NULL, USB_MS_TO_TICKS(temp)); } /* suspend current port */ err = usb2_req_set_port_feature(udev->parent_hub, - &Giant, udev->port_no, UHF_PORT_SUSPEND); + NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { DPRINTFN(0, "Suspending port failed\n"); return; From owner-p4-projects@FreeBSD.ORG Thu Feb 19 22:21:56 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F7A3106567A; Thu, 19 Feb 2009 22:21:56 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18D91065674 for ; Thu, 19 Feb 2009 22:21:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BD83C8FC0C for ; Thu, 19 Feb 2009 22:21:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1JMLtJ2039168 for ; Thu, 19 Feb 2009 22:21:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1JMLt3V039166 for perforce@freebsd.org; Thu, 19 Feb 2009 22:21:55 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 19 Feb 2009 22:21:55 GMT Message-Id: <200902192221.n1JMLt3V039166@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157961 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2009 22:21:57 -0000 http://perforce.freebsd.org/chv.cgi?CH=157961 Change 157961 by hselasky@hselasky_laptop001 on 2009/02/19 22:21:40 USB NDIS support: - Upgrade old USB NDIS driver to support USB2. - The code needs testing! Affected files ... .. //depot/projects/usb/src/sys/compat/ndis/kern_ndis.c#8 edit .. //depot/projects/usb/src/sys/compat/ndis/kern_windrv.c#4 edit .. //depot/projects/usb/src/sys/compat/ndis/ntoskrnl_var.h#7 edit .. //depot/projects/usb/src/sys/compat/ndis/subr_ndis.c#11 edit .. //depot/projects/usb/src/sys/compat/ndis/subr_usbd.c#3 edit .. //depot/projects/usb/src/sys/compat/ndis/usbd_var.h#3 edit .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis.c#16 edit .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis_pccard.c#4 edit .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis_pci.c#4 edit .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndis_usb.c#10 edit .. //depot/projects/usb/src/sys/dev/if_ndis/if_ndisvar.h#8 edit .. //depot/projects/usb/src/sys/modules/if_ndis/Makefile#4 edit .. //depot/projects/usb/src/sys/modules/ndis/Makefile#5 edit Differences ... ==== //depot/projects/usb/src/sys/compat/ndis/kern_ndis.c#8 (text+ko) ==== @@ -65,9 +65,6 @@ #include #include -#include -#include - #include #include #include ==== //depot/projects/usb/src/sys/compat/ndis/kern_windrv.c#4 (text+ko) ==== @@ -56,9 +56,6 @@ #include #endif -#include -#include - #include #include #include ==== //depot/projects/usb/src/sys/compat/ndis/ntoskrnl_var.h#7 (text+ko) ==== @@ -1009,7 +1009,7 @@ #define irp_pkttype s2.u2.irp_pkttype #define IRP_NDIS_DEV(irp) (irp)->irp_tail.irp_misc.irp_usb.irp_dev -#define IRP_NDISUSB_XFER(irp) (irp)->irp_tail.irp_misc.irp_usb.irp_xfer +#define IRP_NDISUSB_EP(irp) (irp)->irp_tail.irp_misc.irp_usb.irp_xfer typedef struct irp irp; ==== //depot/projects/usb/src/sys/compat/ndis/subr_ndis.c#11 (text+ko) ==== @@ -95,8 +95,6 @@ #include #include -#include -#include #include #include ==== //depot/projects/usb/src/sys/compat/ndis/subr_usbd.c#3 (text+ko) ==== @@ -56,12 +56,16 @@ #include #include -#include -#include -#include -#include -#include -#include "usbdevs.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include #include #include @@ -73,55 +77,45 @@ #include static driver_object usbd_driver; +static usb2_callback_t ndis_non_isoc_callback; -static int32_t usbd_func_bulkintr(irp *); -static int32_t usbd_func_vendorclass(irp *); -static int32_t usbd_func_selconf(irp *); -static int32_t usbd_func_getdesc(irp *); -static usbd_status usbd_get_desc_ndis(usbd_device_handle, int, int, int, - void *, int *); -static union usbd_urb *usbd_geturb(irp *); -static usbd_status usbd_init_ndispipe(irp *, usb_endpoint_descriptor_t *); -static usbd_xfer_handle usbd_init_ndisxfer(irp *, usb_endpoint_descriptor_t *, - void *, uint32_t); -static int32_t usbd_iodispatch(device_object *, irp *); -static int32_t usbd_ioinvalid(device_object *, irp *); -static int32_t usbd_pnp(device_object *, irp *); -static int32_t usbd_power(device_object *, irp *); -static void usbd_irpcancel(device_object *, irp *); -static void usbd_irpcancel_cb(void *); -static int32_t usbd_submit_urb(irp *); -static int32_t usbd_urb2nt(int32_t); -static void usbd_xfereof(usbd_xfer_handle, usbd_private_handle, - usbd_status); -static void usbd_xferadd(usbd_xfer_handle, usbd_private_handle, - usbd_status); -static void usbd_xfertask(device_object *, void *); -static void dummy(void); +/* prototypes */ -static union usbd_urb *USBD_CreateConfigurationRequestEx( - usb_config_descriptor_t *, - struct usbd_interface_list_entry *); -static union usbd_urb *USBD_CreateConfigurationRequest( - usb_config_descriptor_t *, - uint16_t *); -static void USBD_GetUSBDIVersion(usbd_version_info *); -static usb_interface_descriptor_t *USBD_ParseConfigurationDescriptorEx( - usb_config_descriptor_t *, void *, int32_t, int32_t, - int32_t, int32_t, int32_t); -static usb_interface_descriptor_t *USBD_ParseConfigurationDescriptor( - usb_config_descriptor_t *, uint8_t, uint8_t); +static void usbd_enqueue_ubi(struct ndisusb_ep *nuep, struct usbd_urb_bulk_or_intr_transfer *ubi); +static struct usbd_urb_bulk_or_intr_transfer * usbd_first_ubi(struct ndisusb_ep *nuep); +static void usbd_remove_ubi(struct ndisusb_ep *nuep, struct usbd_urb_bulk_or_intr_transfer *ubi); +static struct ndisusb_ep *usbd_get_ndisusb_ep(struct ndis_softc *sc, uint8_t ep_addr); +static int32_t usbd_iodispatch(device_object *dobj, irp *ip); +static int32_t usbd_ioinvalid(device_object *dobj, irp *ip); +static int32_t usbd_pnp(device_object *dobj, irp *ip); +static int32_t usbd_power(device_object *dobj, irp *ip); +static int32_t usbd_urb2nt(int32_t status); +static int32_t usbd_usb2urb(int32_t status); +static union usbd_urb *usbd_geturb(irp *ip); +static int32_t usbd_submit_urb(irp *ip); +static int32_t usbd_func_getdesc(irp *ip); +static usb2_error_t usbd_get_desc_ndis(struct usb2_device *udev, struct mtx *mtx, uint16_t id, uint16_t maxlen, uint8_t type, uint8_t index, uint8_t retries, void *desc, uint16_t *actlen); +static int32_t usbd_func_selconf(irp *ip); +static int32_t usbd_func_vendorclass(irp *ip); +static void usbd_irpcancel(device_object *dobj, irp *ip); +static int32_t ndis_setup_endpoint(struct ndis_softc *sc, uint8_t iface_index, struct usb2_endpoint_descriptor *edesc, uint32_t bufsize); +static void ndis_xfer_complete(struct ndisusb_ep *nuep, int32_t status); +static int32_t usbd_func_bulkintr(irp *ip); +static union usbd_urb *USBD_CreateConfigurationRequest(struct usb2_config_descriptor *conf, uint16_t *len); +static union usbd_urb *USBD_CreateConfigurationRequestEx(struct usb2_config_descriptor *conf, struct usbd_interface_list_entry *list); +static void USBD_GetUSBDIVersion(usbd_version_info *ui); +static struct usb2_interface_descriptor *USBD_ParseConfigurationDescriptorEx(struct usb2_config_descriptor *conf, void *start, int32_t intfnum, int32_t altset, int32_t intfclass, int32_t intfsubclass, int32_t intfproto); +static void dummy(void); /* - * We need to wrap these functions because these need `context switch' from - * Windows to UNIX before it's called. + * We need to wrap these functions because these need `context switch' + * from Windows to UNIX before it's called. */ static funcptr usbd_iodispatch_wrap; static funcptr usbd_ioinvalid_wrap; static funcptr usbd_pnp_wrap; static funcptr usbd_power_wrap; static funcptr usbd_irpcancel_wrap; -static funcptr usbd_xfertask_wrap; int usbd_libinit(void) @@ -147,8 +141,6 @@ (funcptr *)&usbd_power_wrap, 2, WINDRV_WRAP_STDCALL); windrv_wrap((funcptr)usbd_irpcancel, (funcptr *)&usbd_irpcancel_wrap, 2, WINDRV_WRAP_STDCALL); - windrv_wrap((funcptr)usbd_xfertask, - (funcptr *)&usbd_xfertask_wrap, 2, WINDRV_WRAP_STDCALL); /* Create a fake USB driver instance. */ @@ -156,7 +148,7 @@ /* Set up our dipatch routine. */ for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) - usbd_driver.dro_dispatch[i] = + usbd_driver.dro_dispatch[i] = (driver_dispatch)usbd_ioinvalid_wrap; usbd_driver.dro_dispatch[IRP_MJ_INTERNAL_DEVICE_CONTROL] = @@ -187,17 +179,62 @@ windrv_unwrap(usbd_pnp_wrap); windrv_unwrap(usbd_power_wrap); windrv_unwrap(usbd_irpcancel_wrap); - windrv_unwrap(usbd_xfertask_wrap); free(usbd_driver.dro_drivername.us_buf, M_DEVBUF); return(0); } +static void +usbd_enqueue_ubi(struct ndisusb_ep *nuep, + struct usbd_urb_bulk_or_intr_transfer *ubi) +{ + /* code taken from TAILQ_ENQUEUE_TAIL() macro */ + ubi->ubi_hca.reserved8[0] = NULL; + ubi->ubi_hca.reserved8[1] = nuep->ubi_last; + *nuep->ubi_last = ubi; + nuep->ubi_last = (struct usbd_urb_bulk_or_intr_transfer **) + &ubi->ubi_hca.reserved8[0]; +} + +static struct usbd_urb_bulk_or_intr_transfer * +usbd_first_ubi(struct ndisusb_ep *nuep) +{ + return (nuep->ubi_first); +} + +static void +usbd_remove_ubi(struct ndisusb_ep *nuep, + struct usbd_urb_bulk_or_intr_transfer *ubi) +{ + /* code taken from TAILQ_REMOVE() macro */ + + if (ubi->ubi_hca.reserved8[0] != NULL) + ((struct usbd_urb_bulk_or_intr_transfer *) + ubi->ubi_hca.reserved8[0])->ubi_hca.reserved8[1] = + ubi->ubi_hca.reserved8[1]; + else + nuep->ubi_last = ubi->ubi_hca.reserved8[1]; + *((void **)ubi->ubi_hca.reserved8[1]) = ubi->ubi_hca.reserved8[0]; +} + +static struct ndisusb_ep * +usbd_get_ndisusb_ep(struct ndis_softc *sc, uint8_t ep_addr) +{ + struct ndisusb_ep *nuep; + + nuep = &sc->ndisusb_ep[((ep_addr & 0x80) >> 7) | + ((ep_addr & 0x0F) << 1)]; + + /* check if endpoint is not properly setup */ + if (nuep->urb_xfer[0] == NULL) + return (NULL); + + return (nuep); +} + static int32_t -usbd_iodispatch(dobj, ip) - device_object *dobj; - irp *ip; +usbd_iodispatch(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; int32_t status; @@ -227,9 +264,7 @@ } static int32_t -usbd_ioinvalid(dobj, ip) - device_object *dobj; - irp *ip; +usbd_ioinvalid(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -247,9 +282,7 @@ } static int32_t -usbd_pnp(dobj, ip) - device_object *dobj; - irp *ip; +usbd_pnp(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -267,9 +300,7 @@ } static int32_t -usbd_power(dobj, ip) - device_object *dobj; - irp *ip; +usbd_power(device_object *dobj, irp *ip) { device_t dev = dobj->do_devext; struct io_stack_location *irp_sl; @@ -288,8 +319,7 @@ /* Convert USBD_STATUS to NTSTATUS */ static int32_t -usbd_urb2nt(status) - int32_t status; +usbd_urb2nt(int32_t status) { switch (status) { @@ -314,42 +344,35 @@ return (STATUS_FAILURE); } -/* Convert FreeBSD's usbd_status to USBD_STATUS */ +/* Convert FreeBSD's USB_ERR_XXX to USBD_STATUS_XXX */ static int32_t -usbd_usb2urb(int status) +usbd_usb2urb(int32_t status) { switch (status) { - case USBD_NORMAL_COMPLETION: + case USB_ERR_NORMAL_COMPLETION: return (USBD_STATUS_SUCCESS); - case USBD_IN_PROGRESS: - return (USBD_STATUS_PENDING); - case USBD_TIMEOUT: + case USB_ERR_TIMEOUT: return (USBD_STATUS_TIMEOUT); - case USBD_SHORT_XFER: + case USB_ERR_SHORT_XFER: return (USBD_STATUS_ERROR_SHORT_TRANSFER); - case USBD_IOERROR: + case USB_ERR_IOERROR: return (USBD_STATUS_XACT_ERROR); - case USBD_NOMEM: + case USB_ERR_NOMEM: return (USBD_STATUS_NO_MEMORY); - case USBD_INVAL: + case USB_ERR_STALLED: + return (USBD_STATUS_STALL_PID); + case USB_ERR_INVAL: return (USBD_STATUS_REQUEST_FAILED); - case USBD_NOT_STARTED: - case USBD_TOO_DEEP: - case USBD_NO_POWER: - return (USBD_STATUS_DEVICE_GONE); - case USBD_CANCELLED: + case USB_ERR_CANCELLED: return (USBD_STATUS_CANCELED); default: - break; + return (USBD_STATUS_NOT_SUPPORTED); } - - return (USBD_STATUS_NOT_SUPPORTED); } static union usbd_urb * -usbd_geturb(ip) - irp *ip; +usbd_geturb(irp *ip) { struct io_stack_location *irp_sl; @@ -359,8 +382,7 @@ } static int32_t -usbd_submit_urb(ip) - irp *ip; +usbd_submit_urb(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); int32_t status; @@ -369,14 +391,13 @@ urb = usbd_geturb(ip); /* * In a case of URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER, - * USBD_URB_STATUS(urb) would be set at callback functions like - * usbd_intr() or usbd_xfereof(). + * USBD_URB_STATUS(urb) would be set at the transfer + * completion callback functions. */ switch (urb->uu_hdr.uuh_func) { case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: status = usbd_func_bulkintr(ip); - if (status != USBD_STATUS_SUCCESS && - status != USBD_STATUS_PENDING) + if (status != USBD_STATUS_PENDING) USBD_URB_STATUS(urb) = status; break; case URB_FUNCTION_VENDOR_DEVICE: @@ -409,181 +430,151 @@ } static int32_t -usbd_func_getdesc(ip) - irp *ip; +usbd_func_getdesc(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); - int actlen, i; - struct usb_attach_arg *uaa = device_get_ivars(dev); + struct ndis_softc *sc; + union usbd_urb *urb; struct usbd_urb_control_descriptor_request *ctldesc; - uint32_t len; - union usbd_urb *urb; - usb_config_descriptor_t cd, *cdp; - usbd_status status; + struct usb2_config_descriptor *cd; + uint16_t actlen; + uint16_t len; + usb2_error_t status; - mtx_lock(&Giant); - + sc = device_get_softc(dev); urb = usbd_geturb(ip); ctldesc = &urb->uu_ctldesc; if (ctldesc->ucd_desctype == UDESC_CONFIG) { - /* Get the short config descriptor. */ - status = usbd_get_config_desc(uaa->device, ctldesc->ucd_idx, - &cd); - if (status != USBD_NORMAL_COMPLETION) { + /* + * The NDIS driver is not allowed to change the + * config! There is only one choice! + */ + cd = usb2_get_config_descriptor(sc->ndisusb_dev); + if (cd == NULL) { ctldesc->ucd_trans_buflen = 0; - mtx_unlock(&Giant); - return usbd_usb2urb(status); + return (USBD_STATUS_REQUEST_FAILED); } - /* Get the full descriptor. Try a few times for slow devices. */ - len = MIN(ctldesc->ucd_trans_buflen, UGETW(cd.wTotalLength)); - for (i = 0; i < 3; i++) { - status = usbd_get_desc_ndis(uaa->device, - ctldesc->ucd_desctype, ctldesc->ucd_idx, - len, ctldesc->ucd_trans_buf, &actlen); - if (status == USBD_NORMAL_COMPLETION) - break; - usbd_delay_ms(uaa->device, 200); - } - if (status != USBD_NORMAL_COMPLETION) { - ctldesc->ucd_trans_buflen = 0; - mtx_unlock(&Giant); - return usbd_usb2urb(status); - } + + /* Get minimum length */ + len = UGETW(cd->wTotalLength); + if (len > ctldesc->ucd_trans_buflen) + len = ctldesc->ucd_trans_buflen; + + /* Copy out config descriptor */ + memcpy(ctldesc->ucd_trans_buf, cd, len); + + /* Set actual length */ + actlen = len; - cdp = (usb_config_descriptor_t *)ctldesc->ucd_trans_buf; - if (cdp->bDescriptorType != UDESC_CONFIG) { - device_printf(dev, "bad desc %d\n", - cdp->bDescriptorType); - status = USBD_INVAL; - } - } else if (ctldesc->ucd_desctype == UDESC_STRING) { - /* Try a few times for slow devices. */ - for (i = 0; i < 3; i++) { - status = usbd_get_string_desc(uaa->device, - (UDESC_STRING << 8) + ctldesc->ucd_idx, - ctldesc->ucd_langid, ctldesc->ucd_trans_buf, - &actlen); - if (actlen > ctldesc->ucd_trans_buflen) - panic("small string buffer for UDESC_STRING"); - if (status == USBD_NORMAL_COMPLETION) - break; - usbd_delay_ms(uaa->device, 200); - } - } else - status = usbd_get_desc_ndis(uaa->device, ctldesc->ucd_desctype, - ctldesc->ucd_idx, ctldesc->ucd_trans_buflen, + /* Success */ + status = USB_ERR_NORMAL_COMPLETION; + } else { + status = usbd_get_desc_ndis(sc->ndisusb_dev, &sc->ndis_mtx, + ctldesc->ucd_langid, ctldesc->ucd_trans_buflen, + ctldesc->ucd_desctype, ctldesc->ucd_idx, 3, ctldesc->ucd_trans_buf, &actlen); + } - if (status != USBD_NORMAL_COMPLETION) { + if (status != USB_ERR_NORMAL_COMPLETION) { ctldesc->ucd_trans_buflen = 0; - mtx_unlock(&Giant); return usbd_usb2urb(status); } ctldesc->ucd_trans_buflen = actlen; ip->irp_iostat.isb_info = actlen; - mtx_unlock(&Giant); - return (USBD_STATUS_SUCCESS); } -/* - * FIXME: at USB1, not USB2, framework, there's no a interface to get `actlen'. - * However, we need it!!! - */ -static usbd_status -usbd_get_desc_ndis(usbd_device_handle dev, int type, int index, int len, - void *desc, int *actlen) +static usb2_error_t +usbd_get_desc_ndis(struct usb2_device *udev, struct mtx *mtx, + uint16_t id, uint16_t maxlen, uint8_t type, uint8_t index, + uint8_t retries, void *desc, uint16_t *actlen) { - usb_device_request_t req; + usb2_error_t err; + + err = usb2_req_get_desc(udev, mtx, + actlen, desc, 2, maxlen, id, + type, index, retries); - req.bmRequestType = UT_READ_DEVICE; - req.bRequest = UR_GET_DESCRIPTOR; - USETW2(req.wValue, type, index); - USETW(req.wIndex, 0); - USETW(req.wLength, len); - return usbd_do_request_flags_pipe(dev, dev->default_pipe, &req, desc, - 0, actlen, USBD_DEFAULT_TIMEOUT); + return (err); } static int32_t -usbd_func_selconf(ip) - irp *ip; +usbd_func_selconf(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); - int i, j; - struct usb_attach_arg *uaa = device_get_ivars(dev); + struct ndis_softc *sc; struct usbd_interface_information *intf; struct usbd_pipe_information *pipe; struct usbd_urb_select_configuration *selconf; + struct usb2_config_descriptor *conf; + struct usb2_endpoint_descriptor *edesc; + struct usb2_pipe *p2; union usbd_urb *urb; - usb_config_descriptor_t *conf; - usb_endpoint_descriptor_t *edesc; - usbd_device_handle udev = uaa->device; - usbd_interface_handle iface; - usbd_status ret; + unsigned int i; + unsigned int j; + int32_t err; + sc = device_get_softc(dev); urb = usbd_geturb(ip); selconf = &urb->uu_selconf; conf = selconf->usc_conf; if (conf == NULL) { device_printf(dev, "select configuration is NULL\n"); - return usbd_usb2urb(USBD_NORMAL_COMPLETION); + return usbd_usb2urb(USB_ERR_NORMAL_COMPLETION); } - if (conf->bConfigurationValue > NDISUSB_CONFIG_NO) - device_printf(dev, "warning: config_no is larger than default"); + /* free any previous endpoints */ + ndis_unsetup_endpoint(sc); intf = &selconf->usc_intf; for (i = 0; i < conf->bNumInterface && intf->uii_len > 0; i++) { - ret = usbd_device2interface_handle(uaa->device, - intf->uii_intfnum, &iface); - if (ret != USBD_NORMAL_COMPLETION) { - device_printf(dev, - "getting interface handle failed: %s\n", - usbd_errstr(ret)); - return usbd_usb2urb(ret); - } - - ret = usbd_set_interface(iface, intf->uii_altset); - if (ret != USBD_NORMAL_COMPLETION && ret != USBD_IN_USE) { + + mtx_unlock(&sc->ndis_mtx); + + err = usb2_set_alt_interface_index(sc->ndisusb_dev, + intf->uii_intfnum, intf->uii_altset); + + mtx_lock(&sc->ndis_mtx); + + if (err != USB_ERR_NORMAL_COMPLETION) { device_printf(dev, "setting alternate interface failed: %s\n", - usbd_errstr(ret)); - return usbd_usb2urb(ret); + usb2_errstr(err)); + return usbd_usb2urb(err); } - - for (j = 0; j < iface->idesc->bNumEndpoints; j++) { + + /* fill in the endpoints */ + p2 = NULL; + j = 0; + while ((p2 = usb2_pipe_foreach(sc->ndisusb_dev, p2))) { if (j >= intf->uii_numeps) { device_printf(dev, "endpoint %d and above are ignored", intf->uii_numeps); break; } - edesc = iface->endpoints[j].edesc; + edesc = p2->edesc; + pipe = &intf->uii_pipes[j]; pipe->upi_handle = edesc; pipe->upi_epaddr = edesc->bEndpointAddress; pipe->upi_maxpktsize = UGETW(edesc->wMaxPacketSize); pipe->upi_type = UE_GET_XFERTYPE(edesc->bmAttributes); - if (pipe->upi_type != UE_INTERRUPT) - continue; + + /* XXX what about ISOCHRONOUS --hps */ + if (pipe->upi_type == UE_INTERRUPT) + pipe->upi_interval = 1; /* dummy value - not used ? */ + + err = ndis_setup_endpoint(sc, intf->uii_intfnum, edesc, + (pipe->upi_type == UE_INTERRUPT) ? 1024 : 16*1024); + + if (err) + return (err); - /* XXX we're following linux USB's interval policy. */ - if (udev->speed == USB_SPEED_LOW) - pipe->upi_interval = edesc->bInterval + 5; - else if (udev->speed == USB_SPEED_FULL) - pipe->upi_interval = edesc->bInterval; - else { - int k0 = 0, k1 = 1; - do { - k1 = k1 * 2; - k0 = k0 + 1; - } while (k1 < edesc->bInterval); - pipe->upi_interval = k0; - } + j++; } intf = (struct usbd_interface_information *)(((char *)intf) + @@ -594,16 +585,15 @@ } static int32_t -usbd_func_vendorclass(ip) - irp *ip; +usbd_func_vendorclass(irp *ip) { device_t dev = IRP_NDIS_DEV(ip); - struct usb_attach_arg *uaa = device_get_ivars(dev); + struct ndis_softc *sc = device_get_softc(dev); struct usbd_urb_vendor_or_class_request *vcreq; + union usbd_urb *urb; + struct usb2_device_request req; uint8_t type = 0; - union usbd_urb *urb; - usb_device_request_t req; - usbd_status status; + usb2_error_t err; urb = usbd_geturb(ip); vcreq = &urb->uu_vcreq; @@ -634,7 +624,7 @@ type = UT_VENDOR | UT_ENDPOINT; break; default: - /* never reach. */ + /* never reached */ break; } @@ -648,437 +638,333 @@ USETW(req.wValue, vcreq->uvc_value); USETW(req.wLength, vcreq->uvc_trans_buflen); - if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) { - mtx_lock(&Giant); - status = usbd_do_request(uaa->device, &req, - vcreq->uvc_trans_buf); - mtx_unlock(&Giant); - } else - status = usbd_do_request_async(uaa->device, &req, - vcreq->uvc_trans_buf); + err = usb2_do_request(sc->ndisusb_dev, + &sc->ndis_mtx, &req, vcreq->uvc_trans_buf); - return usbd_usb2urb(status); + return usbd_usb2urb(err); } -static usbd_status -usbd_init_ndispipe(ip, ep) - irp *ip; - usb_endpoint_descriptor_t *ep; +static void +usbd_irpcancel(device_object *dobj, irp *ip) { - device_t dev = IRP_NDIS_DEV(ip); - struct ndis_softc *sc = device_get_softc(dev); - struct usb_attach_arg *uaa = device_get_ivars(dev); - usbd_interface_handle iface; - usbd_status status; + struct ndisusb_ep *nuep; + union usbd_urb *urb; + struct usbd_urb_bulk_or_intr_transfer *ubi; - status = usbd_device2interface_handle(uaa->device, NDISUSB_IFACE_INDEX, - &iface); - if (status != USBD_NORMAL_COMPLETION) { - device_printf(dev, "could not get interface handle\n"); - return (status); + if (IRP_NDISUSB_EP(ip) == NULL) { + ip->irp_cancel = TRUE; + IoReleaseCancelSpinLock(ip->irp_cancelirql); + return; } - switch (UE_GET_XFERTYPE(ep->bmAttributes)) { - case UE_BULK: - if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_IN) { - /* RX (bulk IN) */ - if (sc->ndisusb_ep[NDISUSB_ENDPT_BIN] != NULL) - return (USBD_NORMAL_COMPLETION); + nuep = IRP_NDISUSB_EP(ip); + IRP_NDISUSB_EP(ip) = NULL; - status = usbd_open_pipe(iface, ep->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->ndisusb_ep[NDISUSB_ENDPT_BIN]); - break; - } + urb = usbd_geturb(ip); + ubi = &urb->uu_bulkintr; - /* TX (bulk OUT) */ - if (sc->ndisusb_ep[NDISUSB_ENDPT_BOUT] != NULL) - return (USBD_NORMAL_COMPLETION); + /* remove UBI from queue */ + usbd_remove_ubi(nuep, ubi); - status = usbd_open_pipe(iface, ep->bEndpointAddress, - USBD_EXCLUSIVE_USE, &sc->ndisusb_ep[NDISUSB_ENDPT_BOUT]); - break; - case UE_INTERRUPT: - if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_IN) { - /* Interrupt IN. */ - if (sc->ndisusb_ep[NDISUSB_ENDPT_IIN] != NULL) - return (USBD_NORMAL_COMPLETION); + /* check if the currently executing transfer is being cancelled */ + if (nuep->irp_curr == ip) { + nuep->irp_curr = NULL; - status = usbd_open_pipe(iface, ep->bEndpointAddress, - USBD_EXCLUSIVE_USE, - &sc->ndisusb_ep[NDISUSB_ENDPT_IIN]); - break; - } + /* + * Make sure that the current USB transfer proxy is + * cancelled and then restarted. + */ + usb2_transfer_stop(nuep->urb_xfer[0]); + usb2_transfer_start(nuep->urb_xfer[0]); + } - /* Interrupt OUT. */ - if (sc->ndisusb_ep[NDISUSB_ENDPT_IOUT] != NULL) - return (USBD_NORMAL_COMPLETION); + ip->irp_cancel = TRUE; + IoReleaseCancelSpinLock(ip->irp_cancelirql); +} - status = usbd_open_pipe(iface, ep->bEndpointAddress, - USBD_EXCLUSIVE_USE, &sc->ndisusb_ep[NDISUSB_ENDPT_IOUT]); - break; - default: - device_printf(dev, "can't handle xfertype 0x%x\n", - UE_GET_XFERTYPE(ep->bmAttributes)); - return (USBD_INVAL); - } +static int32_t +ndis_setup_endpoint(struct ndis_softc *sc, uint8_t iface_index, + struct usb2_endpoint_descriptor *edesc, uint32_t bufsize) +{ + struct usb2_config cfg[1]; + struct ndisusb_ep *nuep; + struct usb2_xfer *xfer; + uint8_t ep_type = edesc->bmAttributes & UE_XFERTYPE; + uint8_t ep_addr = edesc->bEndpointAddress; + usb2_error_t err; - if (status != USBD_NORMAL_COMPLETION) - device_printf(dev, "open pipe failed: (0x%x) %s\n", - ep->bEndpointAddress, usbd_errstr(status)); + /* check for non-supported transfer types */ + if ((ep_type == UE_CONTROL) || (ep_type == UE_ISOCHRONOUS)) + return (USBD_STATUS_SUCCESS); - return (status); -} + nuep = &sc->ndisusb_ep[((ep_addr & 0x80) >> 7) | + ((ep_addr & 0x0F) << 1)]; -static void -usbd_irpcancel_cb(priv) - void *priv; -{ - struct ndisusb_cancel *nc = priv; - struct ndis_softc *sc = device_get_softc(nc->dev); - usbd_status status; - usbd_xfer_handle xfer = nc->xfer; + /* check if the endpoint is already setup */ + if (nuep->urb_xfer[0]) + return (USBD_STATUS_SUCCESS); - if (sc->ndisusb_status & NDISUSB_STATUS_DETACH) - goto exit; + memset(nuep, 0, sizeof(*nuep)); - status = usbd_abort_pipe(xfer->pipe); - if (status != USBD_NORMAL_COMPLETION) - device_printf(nc->dev, "can't be canceld"); -exit: - free(nc, M_USBDEV); -} + memset(cfg, 0, sizeof(cfg)); -static void -usbd_irpcancel(dobj, ip) - device_object *dobj; - irp *ip; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct ndisusb_cancel *nc; - struct usb_attach_arg *uaa = device_get_ivars(dev); + /* Allocate and setup one generic FreeBSD USB transfer */ - if (IRP_NDISUSB_XFER(ip) == NULL) { - ip->irp_cancel = TRUE; - IoReleaseCancelSpinLock(ip->irp_cancelirql); - return; - } + cfg[0].type = ep_type; + cfg[0].endpoint = ep_addr & UE_ADDR; + cfg[0].direction = ep_addr & (UE_DIR_OUT | UE_DIR_IN); + cfg[0].mh.callback = &ndis_non_isoc_callback; + cfg[0].mh.bufsize = bufsize; + cfg[0].mh.flags.proxy_buffer = 1; + cfg[0].mh.flags.short_xfer_ok = 1; - /* - * XXX Since we're under DISPATCH_LEVEL during calling usbd_irpcancel(), - * we can't sleep at all. However, currently FreeBSD's USB stack - * requires a sleep to abort a transfer. It's inevitable! so it causes - * serveral fatal problems (e.g. kernel hangups or crashes). I think - * that there are no ways to make this reliable. In this implementation, - * I used usb_add_task() but it's not a perfect method to solve this - * because of as follows: NDIS drivers would expect that IRP's - * completely canceld when usbd_irpcancel() is returned but we need - * a sleep to do it. During canceling XFERs, usbd_intr() would be - * called with a status, USBD_CANCELLED. - */ - nc = malloc(sizeof(struct ndisusb_cancel), M_USBDEV, M_NOWAIT | M_ZERO); - if (nc == NULL) { - ip->irp_cancel = FALSE; - IoReleaseCancelSpinLock(ip->irp_cancelirql); - return; - } + mtx_unlock(&sc->ndis_mtx); - nc->dev = dev; - nc->xfer = IRP_NDISUSB_XFER(ip); - usb_init_task(&nc->task, usbd_irpcancel_cb, nc); + err = usb2_transfer_setup(sc->ndisusb_dev, &iface_index, + nuep->urb_xfer, cfg, 1, sc, &sc->ndis_mtx); - IRP_NDISUSB_XFER(ip) = NULL; - usb_add_task(uaa->device, &nc->task, USB_TASKQ_DRIVER); + mtx_lock(&sc->ndis_mtx); - ip->irp_cancel = TRUE; - IoReleaseCancelSpinLock(ip->irp_cancelirql); -} + if (err) + return (usbd_usb2urb(err)); -static usbd_xfer_handle -usbd_init_ndisxfer(ip, ep, buf, buflen) - irp *ip; - usb_endpoint_descriptor_t *ep; - void *buf; - uint32_t buflen; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct usb_attach_arg *uaa = device_get_ivars(dev); - usbd_xfer_handle xfer; - - xfer = usbd_alloc_xfer(uaa->device); - if (xfer == NULL) - return (NULL); + xfer = nuep->urb_xfer[0]; - if (buf != NULL && MmIsAddressValid(buf) == FALSE && buflen > 0) { - xfer->buffer = usbd_alloc_buffer(xfer, buflen); - if (xfer->buffer == NULL) - return (NULL); + xfer->priv_fifo = nuep; - if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_OUT) - memcpy(xfer->buffer, buf, buflen); - } else - xfer->buffer = buf; + /* initialise queue head */ + nuep->ubi_first = NULL; + nuep->ubi_last = &nuep->ubi_first; - xfer->length = buflen; + /* get RX or TX direction bit */ + nuep->urb_rx_data = (ep_addr & 0x80) >> 7; - IoAcquireCancelSpinLock(&ip->irp_cancelirql); - IRP_NDISUSB_XFER(ip) = xfer; - ip->irp_cancelfunc = (cancel_func)usbd_irpcancel_wrap; - IoReleaseCancelSpinLock(ip->irp_cancelirql); + if (nuep->urb_rx_data != 0) + xfer->timeout = 0; + else + xfer->timeout = 5000; /* 5seconds, default USB timeout */ - return (xfer); + return (USBD_STATUS_SUCCESS); } -static void -usbd_xferadd(xfer, priv, status) - usbd_xfer_handle xfer; - usbd_private_handle priv; - usbd_status status; +void +ndis_unsetup_endpoint(struct ndis_softc *sc) { - irp *ip = priv; - device_t dev = IRP_NDIS_DEV(ip); - struct ndis_softc *sc = device_get_softc(dev); - struct ndisusb_xfer *nx; - uint8_t irql; + struct ndisusb_ep *nuep; + uint8_t n; - nx = malloc(sizeof(struct ndisusb_xfer), M_USBDEV, M_NOWAIT | M_ZERO); - if (nx == NULL) { - device_printf(dev, "out of memory"); - return; + for (n = 0; n != NDISUSB_ENDPT_MAX; n++) { + nuep = &sc->ndisusb_ep[n]; + usb2_transfer_unsetup(nuep->urb_xfer, 1); } - nx->nx_xfer = xfer; - nx->nx_priv = priv; - nx->nx_status = status; - - KeAcquireSpinLock(&sc->ndisusb_xferlock, &irql); - InsertTailList((&sc->ndisusb_xferlist), (&nx->nx_xferlist)); - KeReleaseSpinLock(&sc->ndisusb_xferlock, irql); - - IoQueueWorkItem(sc->ndisusb_xferitem, - (io_workitem_func)usbd_xfertask_wrap, WORKQUEUE_CRITICAL, sc); } static void -usbd_xfereof(xfer, priv, status) - usbd_xfer_handle xfer; - usbd_private_handle priv; - usbd_status status; +ndis_xfer_complete(struct ndisusb_ep *nuep, int32_t status) >>> TRUNCATED FOR MAIL (1000 lines) <<< From owner-p4-projects@FreeBSD.ORG Fri Feb 20 11:20:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A63D10656D1; Fri, 20 Feb 2009 11:20:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F01BA10656CC for ; Fri, 20 Feb 2009 11:20:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DC3298FC14 for ; Fri, 20 Feb 2009 11:20:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1KBKsSQ042515 for ; Fri, 20 Feb 2009 11:20:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1KBKsp3042513 for perforce@freebsd.org; Fri, 20 Feb 2009 11:20:54 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 20 Feb 2009 11:20:54 GMT Message-Id: <200902201120.n1KBKsp3042513@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 157974 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2009 11:20:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=157974 Change 157974 by hselasky@hselasky_laptop001 on 2009/02/20 11:20:39 USB TEMPLATE: Add support for setting and getting the USB template value through libusb20 and usbconfig. Affected files ... .. //depot/projects/usb/src/lib/libusb20/libusb20.3#7 edit .. //depot/projects/usb/src/lib/libusb20/libusb20.c#15 edit .. //depot/projects/usb/src/lib/libusb20/libusb20_int.h#8 edit .. //depot/projects/usb/src/lib/libusb20/libusb20_ugen20.c#14 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#46 edit .. //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.h#14 edit .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#31 edit .. //depot/projects/usb/src/usr.sbin/usbconfig/usbconfig.c#13 edit Differences ... ==== //depot/projects/usb/src/lib/libusb20/libusb20.3#7 (text+ko) ==== @@ -698,6 +698,30 @@ . .Sh USB BACKEND OPERATIONS . +.Fn libusb20_be_get_template pbackend ptemp +This function will return the currently selected global USB device +side mode template into the integer pointer +.Fa ptemp . +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. +.Fn libusb20_be_set_template pbackend temp +This function will set the global USB device side mode template to +.Fa temp . +The new template is not activated until after the next USB +enumeration. +The template number decides how the USB device will present itself to +the USB Host, like Mass Storage Device, USB Ethernet Device. Also see +the +.Xr usb2_template 4 +module. +This function returns zero on success else a LIBUSB20_ERROR value is +returned. +. +.Pp +. .Fn libusb20_be_get_dev_quirk pbackend index pquirk This function will return the device quirk according to .Fa index ==== //depot/projects/usb/src/lib/libusb20/libusb20.c#15 (text+ko) ==== @@ -1165,6 +1165,23 @@ return (pbe->methods->root_get_perm(pbe, mode)); } +int +libusb20_be_set_template(struct libusb20_backend *pbe, int temp) +{ + return (pbe->methods->root_set_template(pbe, temp)); +} + +int +libusb20_be_get_template(struct libusb20_backend *pbe, int *ptemp) +{ + int temp; + + if (ptemp == NULL) + ptemp = &temp; + + return (pbe->methods->root_get_template(pbe, ptemp)); +} + struct libusb20_device * libusb20_be_device_foreach(struct libusb20_backend *pbe, struct libusb20_device *pdev) { ==== //depot/projects/usb/src/lib/libusb20/libusb20_int.h#8 (text+ko) ==== @@ -70,6 +70,8 @@ typedef int (libusb20_root_set_owner_t)(struct libusb20_backend *pbe, uid_t user, gid_t group); typedef int (libusb20_root_set_perm_t)(struct libusb20_backend *pbe, mode_t mode); typedef void (libusb20_exit_backend_t)(struct libusb20_backend *pbe); +typedef int (libusb20_root_set_template_t)(struct libusb20_backend *pbe, int temp); +typedef int (libusb20_root_get_template_t)(struct libusb20_backend *pbe, int *ptemp); #define LIBUSB20_DEFINE(n,field) \ libusb20_##field##_t *field; @@ -105,6 +107,8 @@ m(n, root_get_owner) \ m(n, root_set_perm) \ m(n, root_get_perm) \ + m(n, root_set_template) \ + m(n, root_get_template) \ /* mandatory device methods */ \ m(n, open_device) \ m(n, close_device) \ ==== //depot/projects/usb/src/lib/libusb20/libusb20_ugen20.c#14 (text+ko) ==== @@ -72,6 +72,8 @@ static libusb20_root_get_owner_t ugen20_root_get_owner; static libusb20_root_set_perm_t ugen20_root_set_perm; static libusb20_root_get_perm_t ugen20_root_get_perm; +static libusb20_root_set_template_t ugen20_root_set_template; +static libusb20_root_get_template_t ugen20_root_get_template; const struct libusb20_backend_methods libusb20_ugen20_backend = { LIBUSB20_BACKEND(LIBUSB20_DECLARE, ugen20) @@ -1179,3 +1181,15 @@ return (ugen20_be_do_perm(USB_GET_ROOT_PERM, 0, 0, 0, 0, NULL, NULL, mode)); } + +static int +ugen20_root_set_template(struct libusb20_backend *pbe, int temp) +{ + return (ugen20_be_ioctl(USB_SET_TEMPLATE, &temp)); +} + +static int +ugen20_root_get_template(struct libusb20_backend *pbe, int *ptemp) +{ + return (ugen20_be_ioctl(USB_GET_TEMPLATE, ptemp)); +} ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_dev.c#46 (text+ko) ==== @@ -1377,6 +1377,15 @@ case USB_DEV_QUIRK_REMOVE: err = usb2_quirk_ioctl_p(cmd, data, fflag, td); break; + case USB_GET_TEMPLATE: + *(int *)data = usb2_template; + break; + case USB_SET_TEMPLATE: + err = priv_check(curthread, PRIV_ROOT); + if (err) + break; + usb2_template = *(int *)data; + break; default: err = ENOTTY; break; ==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_device.h#14 (text+ko) ==== @@ -155,6 +155,10 @@ char product[64]; /* product string */ }; +/* globals */ + +extern int usb2_template; + /* function prototypes */ struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus, ==== //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#31 (text+ko) ==== @@ -267,6 +267,8 @@ #define USB_SET_PORT_DISABLE _IOW ('U', 144, int) #define USB_SET_POWER_MODE _IOW ('U', 145, int) #define USB_GET_POWER_MODE _IOR ('U', 146, int) +#define USB_SET_TEMPLATE _IOW ('U', 147, int) +#define USB_GET_TEMPLATE _IOR ('U', 148, int) /* Modem device */ #define USB_GET_CM_OVER_DATA _IOR ('U', 180, int) ==== //depot/projects/usb/src/usr.sbin/usbconfig/usbconfig.c#13 (text+ko) ==== @@ -42,6 +42,7 @@ struct options { const char *quirkname; void *buffer; + int template; gid_t gid; uid_t uid; mode_t mode; @@ -65,6 +66,8 @@ uint8_t got_set_alt:1; uint8_t got_set_owner:1; uint8_t got_set_perm:1; + uint8_t got_set_template:1; + uint8_t got_get_template:1; uint8_t got_suspend:1; uint8_t got_resume:1; uint8_t got_reset:1; @@ -99,6 +102,8 @@ T_SET_ALT, T_SET_OWNER, T_SET_PERM, + T_SET_TEMPLATE, + T_GET_TEMPLATE, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, T_SHOW_IFACE_DRIVER, @@ -130,6 +135,8 @@ {"set_alt", T_SET_ALT, 1}, {"set_owner", T_SET_OWNER, 1}, {"set_perm", T_SET_PERM, 1}, + {"set_template", T_SET_TEMPLATE, 1}, + {"get_template", T_GET_TEMPLATE, 0}, {"add_dev_quirk_vplh", T_ADD_DEVICE_QUIRK, 5}, {"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, @@ -283,6 +290,8 @@ " set_alt " "\n" " set_owner " "\n" " set_perm " "\n" + " set_template