Re: PLEASE REVIEW: Adding a pci_if method to facilitate specialized PCI bus drivers

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 06/27/03

  • Next message: Joshua Oreman: "Re: setting up max ptys under 5.x"
    Date: Fri, 27 Jun 2003 14:01:45 -0400 (EDT)
    To: Thomas Moestl <t.moestl@tu-bs.de>
    
    

    On 27-Jun-2003 Thomas Moestl wrote:
    > 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.

    Doh, yes. :( Hmm, can you try something like this maybe:

            if (pci_get_class(dev) == PCIC_BRIDGE &&
                pci_get_subclass(dev) == PCIS_BRIDGE_PCI)
                    /* Routing across a child bridge. */
            else
                    /* Routing a direct child that is not a bridge. */

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Joshua Oreman: "Re: setting up max ptys under 5.x"

    Relevant Pages