Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bhnd/cores/usb/bhnd_usb.c
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| static int bhnd_usb_print_all_resources(device_t dev); | static int bhnd_usb_print_all_resources(device_t dev); | ||||
| static int bhnd_usb_print_child(device_t bus, device_t child); | static int bhnd_usb_print_child(device_t bus, device_t child); | ||||
| static struct resource * bhnd_usb_alloc_resource(device_t bus, | static struct resource * bhnd_usb_alloc_resource(device_t bus, | ||||
| device_t child, int type, int *rid, | device_t child, int type, int *rid, | ||||
| rman_res_t start, rman_res_t end, | rman_res_t start, rman_res_t end, | ||||
| rman_res_t count, u_int flags); | rman_res_t count, u_int flags); | ||||
| static int bhnd_usb_release_resource(device_t dev, | static int bhnd_usb_release_resource(device_t dev, | ||||
| device_t child, int type, int rid, | device_t child, struct resource *r); | ||||
| struct resource *r); | |||||
| static struct resource_list * bhnd_usb_get_reslist(device_t dev, | static struct resource_list * bhnd_usb_get_reslist(device_t dev, | ||||
| device_t child); | device_t child); | ||||
| static int | static int | ||||
| bhnd_usb_probe(device_t dev) | bhnd_usb_probe(device_t dev) | ||||
| { | { | ||||
| const struct bhnd_device *id; | const struct bhnd_device *id; | ||||
| ▲ Show 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | bhnd_usb_get_reslist(device_t dev, device_t child) | ||||
| struct bhnd_usb_devinfo *sdi; | struct bhnd_usb_devinfo *sdi; | ||||
| sdi = device_get_ivars(child); | sdi = device_get_ivars(child); | ||||
| return (&sdi->sdi_rl); | return (&sdi->sdi_rl); | ||||
| } | } | ||||
| static int | static int | ||||
| bhnd_usb_release_resource(device_t dev, device_t child, int type, | bhnd_usb_release_resource(device_t dev, device_t child, | ||||
| int rid, struct resource *r) | struct resource *r) | ||||
| { | { | ||||
| struct bhnd_usb_softc *sc; | struct bhnd_usb_softc *sc; | ||||
| struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
| bool passthrough; | bool passthrough; | ||||
| int error; | int error; | ||||
| sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
| passthrough = (device_get_parent(child) != dev); | passthrough = (device_get_parent(child) != dev); | ||||
| /* Delegate to our parent device's bus if the requested resource type | /* Delegate to our parent device's bus if the requested resource type | ||||
| * isn't handled locally. */ | * isn't handled locally. */ | ||||
| if (type != SYS_RES_MEMORY) { | if (type != SYS_RES_MEMORY) { | ||||
| return (bus_generic_rl_release_resource(dev, child, type, rid, | return (bus_generic_rl_release_resource(dev, child, r)); | ||||
| r)); | |||||
| } | } | ||||
| error = bus_generic_rman_release_resource(dev, child, type, rid, r); | error = bus_generic_rman_release_resource(dev, child, r); | ||||
| if (error != 0) | if (error != 0) | ||||
| return (error); | return (error); | ||||
| if (!passthrough) { | if (!passthrough) { | ||||
| /* Clean resource list entry */ | /* Clean resource list entry */ | ||||
| rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), | rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), | ||||
| type, rid); | rman_get_type(r), rman_get_rid(r)); | ||||
| if (rle != NULL) | if (rle != NULL) | ||||
| rle->res = NULL; | rle->res = NULL; | ||||
| } | } | ||||
| return (0); | return (0); | ||||
| } | } | ||||
| static int | static int | ||||
| ▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines | |||||