From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 27 10:52:18 2003 Return-Path: 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 EF84337B401 for ; Fri, 27 Jun 2003 10:52:18 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id A970443FCB for ; Fri, 27 Jun 2003 10:52:17 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 12192 invoked by uid 65534); 27 Jun 2003 17:52:16 -0000 Received: from p508E55CA.dip.t-dialin.net (EHLO galatea.local) (80.142.85.202) by mail.gmx.net (mp027) with SMTP; 27 Jun 2003 19:52:16 +0200 Received: from tmm by galatea.local with local (Exim 4.20 #1) id 19VxNT-0000P7-Tw; Fri, 27 Jun 2003 19:51:15 +0200 Date: Fri, 27 Jun 2003 19:51:15 +0200 From: Thomas Moestl To: John Baldwin Message-ID: <20030627175115.GA847@crow.dom2ip.de> Mail-Followup-To: John Baldwin , freebsd-hackers@freebsd.org References: <20030613233104.GC670@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: Thomas Moestl cc: freebsd-hackers@freebsd.org Subject: Re: PLEASE REVIEW: Adding a pci_if method to facilitate specialized PCI bus drivers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2003 17:52:19 -0000 On Fri, 2003/06/27 at 13:37:00 -0400, John Baldwin wrote: > On 13-Jun-2003 Thomas Moestl wrote: > > This requires us to get this firmware property in the OFW PCI bus > > driver before routing the interrupt; that can't be done in the pcib > > route_interrupt method, since we don't know whether we are routing for > > another bridge (where we use whichever index we get passed) or for a > > child device (in which case we would need to look at the firmware > > property). > > Actually, can't you tell this by doing: > > if (device_get_parent(device_get_parent(dev)) == pcib) > /* Routing direct child. */ > else > /* Routing descedent of a child bridge. */ No, pcib will always be a grandparent of dev. When routing a descendant child bridge, dev will itself be the device_t of a bridge, otherwise it is that of the device we are routing to. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C