From owner-freebsd-current@FreeBSD.ORG Tue Sep 5 18:31:37 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00A9E16A4E8; Tue, 5 Sep 2006 18:31:37 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 096C543D46; Tue, 5 Sep 2006 18:31:35 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [10.10.3.185] ([165.236.175.187]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id k85IVRgf089221; Tue, 5 Sep 2006 12:31:33 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <44FDC278.3050902@samsco.org> Date: Tue, 05 Sep 2006 12:31:20 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Poul-Henning Kamp References: <14026.1157478288@critter.freebsd.dk> In-Reply-To: <14026.1157478288@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.5 required=3.8 tests=SPF_SOFTFAIL autolearn=no version=3.1.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: John-Mark Gurney , freebsd-current@freebsd.org, freebsd-drivers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: bus_get_dma_tag now necessary for drivers using bus_dma X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2006 18:31:37 -0000 Poul-Henning Kamp wrote: > In message <20060905173334.GH9421@funkthat.com>, John-Mark Gurney writes: > > >>This means that for each call to bus_dma_tag_create, instead of passing >>a NULL pointer, you should call bus_get_dma_tag(yourdev) and use that >>as the parent tag. I committed some example code to various drivers, >>such as ahc, ata, em, and ohci. > > > If there are never any exeptions to this requirement, why not > pass "yourdev" and have the magic hidden, rather than add 17 > ritual characters to the API ? > Drivers can have their own multi-level tag heirarchy. You'd have to create a new bus_dma_tag_create() variant that expected a device_t instead of a bus_dma_tag_t. This might be a good idea. Scott