From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 2 12:33:28 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BE6E16A407 for ; Sun, 2 Jul 2006 12:33:28 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.swip.net [212.247.154.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B0ED43D45 for ; Sun, 2 Jul 2006 12:33:27 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== X-Cloudmark-Score: 0.000000 [] Received: from mp-216-120-91.daxnet.no ([193.216.120.91] verified) by mailfe05.swip.net (CommuniGate Pro SMTP 5.0.8) with ESMTP id 125631313; Sun, 02 Jul 2006 14:33:25 +0200 From: Hans Petter Selasky To: Ian Dowse Date: Sun, 2 Jul 2006 14:33:30 +0200 User-Agent: KMail/1.7 References: <200607021305.aa75873@nowhere.iedowse.com> In-Reply-To: <200607021305.aa75873@nowhere.iedowse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607021433.32278.hselasky@c2i.net> Cc: David Malone , freebsd-hackers@freebsd.org Subject: Re: contiguous memory allocation problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jul 2006 12:33:28 -0000 On Sunday 02 July 2006 14:05, Ian Dowse wrote: > In message <200607021138.11945.hselasky@c2i.net>, Hans Petter Selasky writes: > >But there is one problem, that has been overlooked, and that is High speed > >isochronous transfers, which are not supported by the existing USB system. > > I don't think that the EHCI specification was designed for scatter and > > gather, when you consider this: > > > >8 transfers of 0xC00 bytes has to fit on 7 pages. If this is going to > > work, and I am right, one page has to contain two transfers. (see page 43 > > of ehci-r10.pdf) > > I haven't looked into the details, but the text in section 3.3.3 > seems to suggest that EHCI is designed to not require physically > contiguous allocations here either, so the same approach of using > bus_dmamap_load() should work: > > This data structure requires the associated data buffer to be > contiguous (relative to virtual memory), but allows the physical > memory pages to be non-contiguous. Seven page pointers are provided > to support the expression of 8 isochronous transfers. The seven > pointers allow for 3 (transactions) * 1024 (maximum packet size) > * 8 (transaction records) (24576 bytes) to be moved with this > data structure, regardless of the alignment offset of the first > page. 3 * 1024 bytes = 0xC00 bytes 8 * 0xC00 = 0x6000 bytes maximum According to this you need "6" "EHCI pages", because "6 * 0x1000 = 0x6000". The seventh "EHCI page" is just there to allow one to start at any page offset. There is no eight "EHCI page". The only solution I see, is to have a double layer ITD. The first layer have the 4 first transfers activated, and the second layer have the 4 last transfers activated. A little more complicated, but not impossible. --HPS