diff options
| author | Warner Losh <imp@FreeBSD.org> | 2002-10-07 07:08:00 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2002-10-07 07:08:00 +0000 |
| commit | 0a1d3ef9b80e939e6d3daadd5a3e929587dca162 (patch) | |
| tree | 61141cd92df9628920fd948384f0ea9e798aff2a /sys | |
| parent | 689ab99fb371cce21df2f00b4440d21d564cbb01 (diff) | |
Notes
Diffstat (limited to 'sys')
| -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 4ccb30c1192f..63900284ce8b 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 8c6b1bde5f64..da2ca4dc4b02 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. |
