From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 27 10:36:51 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 D937437B401 for ; Fri, 27 Jun 2003 10:36:51 -0700 (PDT) Received: from mail.speakeasy.net (mail8.speakeasy.net [216.254.0.208]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41FCA43FBF for ; Fri, 27 Jun 2003 10:36:51 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 9413 invoked from network); 27 Jun 2003 17:36:50 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 27 Jun 2003 17:36:50 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h5RHamGI062487; Fri, 27 Jun 2003 13:36:48 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030613233104.GC670@crow.dom2ip.de> Date: Fri, 27 Jun 2003 13:37:00 -0400 (EDT) From: John Baldwin To: 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:36:52 -0000 On 13-Jun-2003 Thomas Moestl wrote: > Hi, > > I've attached a patch that adds a new pci_if method, > assign_interrupt, and makes the PCI code implement and use > it. This is private to the PCI bus and is only used internally (to > find an interrupt of a child device); it is a method so that derived > PCI bus drivers can override it. > > This is very useful for the sparc64 OFW PCI bus driver which I will > commit soon, hopefully. On sparc64, there are some on-board devices > which have special interrupt lines. To route their interrupts, we need > not only know the device to route for, but also an interrupt index > which is stored in the firmware for this device, and which is used to > route on bridges instead of the intpin (in other cases, there's even > the complete interrupt number stored there; for devices in PCI slots, > we (usually) can use the intpin). > > 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. */ -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/