aboutsummaryrefslogtreecommitdiff
path: root/lib/libdevctl/devctl.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2019-04-05 19:32:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2019-04-05 19:32:26 +0000
commit4fbf8e1c2efb16431c174d7a77c23e700af1160b (patch)
treeba86d2ae70d50d38cd895227ea65600ee173de6a /lib/libdevctl/devctl.c
parent1d1a5c2b02674c66cc305c465e3ae86dc1e526a1 (diff)
downloadsrc-4fbf8e1c2efb16431c174d7a77c23e700af1160b.tar.gz
src-4fbf8e1c2efb16431c174d7a77c23e700af1160b.zip
Implement devctl(8) command 'reset', using DEV_RESET /dev/devctl2 ioctl.
Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646
Notes
Notes: svn path=/head/; revision=345966
Diffstat (limited to 'lib/libdevctl/devctl.c')
-rw-r--r--lib/libdevctl/devctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libdevctl/devctl.c b/lib/libdevctl/devctl.c
index 34ced3c5da65..528e3a3c407a 100644
--- a/lib/libdevctl/devctl.c
+++ b/lib/libdevctl/devctl.c
@@ -158,3 +158,11 @@ devctl_thaw(void)
return (devctl_simple_request(DEV_THAW, "", 0));
}
+
+int
+devctl_reset(const char *device, bool detach)
+{
+
+ return (devctl_simple_request(DEV_RESET, device, detach ?
+ DEVF_RESET_DETACH : 0));
+}