From e05c6840a1464552cb7462d76fbae2a9e3bc86d0 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 27 Apr 2016 16:29:03 +0000 Subject: 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 --- usr.sbin/devctl/devctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'usr.sbin/devctl/devctl.c') 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[]) { -- cgit v1.1