Bus_teardown_intr

I was trying to look at the bus_teardown_intr() method in file sys/kern/subr_bus.c. This method is accessing BUS_TEARDOWN_INTR. I am not able to find the code defining BUS_TEARDOWN_INTR. Can anyone please help me out with this.

Thank you.
 
/usr/src/sys/kern/subr_bus.c
Code:
/**
 * @brief Helper function for implementing BUS_TEARDOWN_INTR().
 *
 * This simple implementation of BUS_TEARDOWN_INTR() simply calls the
 * BUS_TEARDOWN_INTR() method of the parent of @p dev.
 */
int
bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq,
    void *cookie)
{
        /* Propagate up the bus hierarchy until someone handles it. */
        if (dev->parent)
                return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
        return (EINVAL);
}

See bus_setup_intr(9)() man page.
 
cpu82 said:
See bus_setup_intr(9)() man page.

/usr/src/sys/kern/subr_bus.c:3682:3696
Code:
/**
 * @brief Helper function for implementing BUS_TEARDOWN_INTR().
 *
 * This simple implementation of BUS_TEARDOWN_INTR() simply calls the
 * BUS_TEARDOWN_INTR() method of the parent of @p dev.
 */
int
bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq,
    void *cookie)
{
        /* Propagate up the bus hierarchy until someone handles it. */
        if (dev->parent)
                return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie));
        return (EINVAL);
}

Thank you for replying. Is the code for BUS_TEARDOWN_INTR available? I want to know how BUS_TEARDOWN_INTR has been implemented.

Thank you.
 
In /usr/include/sys/bus.h:398 is declared bus_teardown_intr() function to tear down an interrupt handler.
Code:
int     bus_teardown_intr(device_t dev, struct resource *r, void *cookie);

Also is declared for register:
Code:
int     bus_setup_intr(device_t dev, struct resource *r, int flags,
                       driver_filter_t filter, driver_intr_t handler, 
                       void *arg, void **cookiep);
 
Back
Top