diff options
-rw-r--r-- | sys/kern/subr_bus.c | 30 | ||||
-rw-r--r-- | sys/sys/bus.h | 4 |
2 files changed, 31 insertions, 3 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 4ccb30c..6390028 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1785,9 +1785,35 @@ bus_delete_resource(device_t dev, int type, int rid) } int -bus_child_present(device_t dev) +bus_child_present(device_t child) { - return (BUS_CHILD_PRESENT(device_get_parent(dev), dev)); + return (BUS_CHILD_PRESENT(device_get_parent(child), child)); +} + +int +bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen) +{ + device_t parent; + + parent = device_get_parent(child); + if (parent == NULL) { + *buf = '\0'; + return (0); + } + return (BUS_CHILD_PNPINFO_STR(parent, child, buf, buflen)); +} + +int +bus_child_location_str(device_t child, char *buf, size_t buflen) +{ + device_t parent; + + parent = device_get_parent(child); + if (parent == NULL) { + *buf = '\0'; + return (0); + } + return (BUS_CHILD_LOCATION_STR(parent, child, buf, buflen)); } static int diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 8c6b1bd..da2ca4d 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -279,7 +279,9 @@ int bus_get_resource(device_t dev, int type, int rid, u_long bus_get_resource_start(device_t dev, int type, int rid); u_long bus_get_resource_count(device_t dev, int type, int rid); void bus_delete_resource(device_t dev, int type, int rid); -int bus_child_present(device_t dev); +int bus_child_present(device_t child); +int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen); +int bus_child_location_str(device_t child, char *buf, size_t buflen); /* * Access functions for device. |