Date: Fri, 27 Jun 2003 13:37:00 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Thomas Moestl <t.moestl@tu-bs.de> Cc: freebsd-hackers@freebsd.org Subject: RE: PLEASE REVIEW: Adding a pci_if method to facilitate specialized PCI bus drivers Message-ID: <XFMail.20030627133700.jhb@FreeBSD.org> In-Reply-To: <20030613233104.GC670@crow.dom2ip.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030627133700.jhb>