Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_bus.c
Show First 20 Lines • Show All 4,051 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
/* Propagate up the bus hierarchy until someone handles it. */ | /* Propagate up the bus hierarchy until someone handles it. */ | ||||
if (dev->parent) | if (dev->parent) | ||||
return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie)); | return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie)); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
/** | /** | ||||
* @brief Helper function for implementing BUS_SUSPEND_INTR(). | |||||
* | |||||
* This simple implementation of BUS_SUSPEND_INTR() simply calls the | |||||
* BUS_SUSPEND_INTR() method of the parent of @p dev. | |||||
*/ | |||||
int | |||||
bus_generic_suspend_intr(device_t dev, device_t child, struct resource *irq) | |||||
{ | |||||
/* Propagate up the bus hierarchy until someone handles it. */ | |||||
if (dev->parent) | |||||
return (BUS_SUSPEND_INTR(dev->parent, child, irq)); | |||||
return (EINVAL); | |||||
} | |||||
/** | |||||
* @brief Helper function for implementing BUS_RESUME_INTR(). | |||||
* | |||||
* This simple implementation of BUS_RESUME_INTR() simply calls the | |||||
* BUS_RESUME_INTR() method of the parent of @p dev. | |||||
*/ | |||||
int | |||||
bus_generic_resume_intr(device_t dev, device_t child, struct resource *irq) | |||||
{ | |||||
/* Propagate up the bus hierarchy until someone handles it. */ | |||||
if (dev->parent) | |||||
return (BUS_RESUME_INTR(dev->parent, child, irq)); | |||||
return (EINVAL); | |||||
} | |||||
/** | |||||
* @brief Helper function for implementing BUS_ADJUST_RESOURCE(). | * @brief Helper function for implementing BUS_ADJUST_RESOURCE(). | ||||
* | * | ||||
* This simple implementation of BUS_ADJUST_RESOURCE() simply calls the | * This simple implementation of BUS_ADJUST_RESOURCE() simply calls the | ||||
* BUS_ADJUST_RESOURCE() method of the parent of @p dev. | * BUS_ADJUST_RESOURCE() method of the parent of @p dev. | ||||
*/ | */ | ||||
int | int | ||||
bus_generic_adjust_resource(device_t dev, device_t child, int type, | bus_generic_adjust_resource(device_t dev, device_t child, int type, | ||||
struct resource *r, rman_res_t start, rman_res_t end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
▲ Show 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | |||||
* parent of @p dev. | * parent of @p dev. | ||||
*/ | */ | ||||
int | int | ||||
bus_teardown_intr(device_t dev, struct resource *r, void *cookie) | bus_teardown_intr(device_t dev, struct resource *r, void *cookie) | ||||
{ | { | ||||
if (dev->parent == NULL) | if (dev->parent == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie)); | return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie)); | ||||
} | |||||
/** | |||||
* @brief Wrapper function for BUS_SUSPEND_INTR(). | |||||
* | |||||
* This function simply calls the BUS_SUSPEND_INTR() method of the | |||||
* parent of @p dev. | |||||
*/ | |||||
int | |||||
bus_suspend_intr(device_t dev, struct resource *r) | |||||
{ | |||||
if (dev->parent == NULL) | |||||
return (EINVAL); | |||||
return (BUS_SUSPEND_INTR(dev->parent, dev, r)); | |||||
} | |||||
/** | |||||
* @brief Wrapper function for BUS_RESUME_INTR(). | |||||
* | |||||
* This function simply calls the BUS_RESUME_INTR() method of the | |||||
* parent of @p dev. | |||||
*/ | |||||
int | |||||
bus_resume_intr(device_t dev, struct resource *r) | |||||
{ | |||||
if (dev->parent == NULL) | |||||
return (EINVAL); | |||||
return (BUS_RESUME_INTR(dev->parent, dev, r)); | |||||
} | } | ||||
/** | /** | ||||
* @brief Wrapper function for BUS_BIND_INTR(). | * @brief Wrapper function for BUS_BIND_INTR(). | ||||
* | * | ||||
* This function simply calls the BUS_BIND_INTR() method of the | * This function simply calls the BUS_BIND_INTR() method of the | ||||
* parent of @p dev. | * parent of @p dev. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,187 Lines • Show Last 20 Lines |