diff options
author | jhb <jhb@FreeBSD.org> | 2016-04-27 16:29:03 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2016-04-27 16:29:03 +0000 |
commit | e05c6840a1464552cb7462d76fbae2a9e3bc86d0 (patch) | |
tree | 57198594e0baf051edc63655c2d1254c1a033442 /usr.sbin/devctl/devctl.c | |
parent | fe28ec8024a7da09961b3b7d4dc1e205b1b35bb1 (diff) | |
download | FreeBSD-src-e05c6840a1464552cb7462d76fbae2a9e3bc86d0.zip FreeBSD-src-e05c6840a1464552cb7462d76fbae2a9e3bc86d0.tar.gz |
Add a new rescan method to the bus interface.
The BUS_RESCAN() method rescans a single bus device checking for devices
that have been added or removed from the bus. A new 'rescan' command is
added to devctl(8) to trigger a rescan.
Differential Revision: https://reviews.freebsd.org/D6016
Diffstat (limited to 'usr.sbin/devctl/devctl.c')
-rw-r--r-- | usr.sbin/devctl/devctl.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/devctl/devctl.c b/usr.sbin/devctl/devctl.c index 076c650..545224b 100644 --- a/usr.sbin/devctl/devctl.c +++ b/usr.sbin/devctl/devctl.c @@ -259,6 +259,18 @@ set_driver(int ac, char **av) } DEVCTL_COMMAND(set, driver, set_driver); +static int +rescan(int ac, char **av) +{ + + if (ac != 2) + usage(); + if (devctl_rescan(av[1]) < 0) + err(1, "Failed to rescan %s", av[1]); + return (0); +} +DEVCTL_COMMAND(top, rescan, rescan); + int main(int ac, char *av[]) { |