Date: Fri, 19 Apr 2019 13:09:16 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346383 - in stable/11/sys: kern sys Message-ID: <201904191309.x3JD9GsC089407@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Apr 19 13:09:16 2019 New Revision: 346383 URL: https://svnweb.freebsd.org/changeset/base/346383 Log: MFC r345965: Add DEV_RESET /dev/devctl2 ioctl. Modified: stable/11/sys/kern/subr_bus.c stable/11/sys/sys/bus.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_bus.c ============================================================================== --- stable/11/sys/kern/subr_bus.c Fri Apr 19 13:04:48 2019 (r346382) +++ stable/11/sys/kern/subr_bus.c Fri Apr 19 13:09:16 2019 (r346383) @@ -5476,6 +5476,7 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t d case DEV_CLEAR_DRIVER: case DEV_RESCAN: case DEV_DELETE: + case DEV_RESET: error = priv_check(td, PRIV_DRIVER); if (error == 0) error = find_device(req, &dev); @@ -5683,6 +5684,14 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t d error = device_delete_child(parent, dev); break; } + case DEV_RESET: + if ((req->dr_flags & ~(DEVF_RESET_DETACH)) != 0) { + error = EINVAL; + break; + } + error = BUS_RESET_CHILD(device_get_parent(dev), dev, + req->dr_flags); + break; } mtx_unlock(&Giant); return (error); Modified: stable/11/sys/sys/bus.h ============================================================================== --- stable/11/sys/sys/bus.h Fri Apr 19 13:04:48 2019 (r346382) +++ stable/11/sys/sys/bus.h Fri Apr 19 13:09:16 2019 (r346383) @@ -120,6 +120,7 @@ struct devreq { #define DEV_CLEAR_DRIVER _IOW('D', 8, struct devreq) #define DEV_RESCAN _IOW('D', 9, struct devreq) #define DEV_DELETE _IOW('D', 10, struct devreq) +#define DEV_RESET _IOW('D', 13, struct devreq) /* Flags for DEV_DETACH and DEV_DISABLE. */ #define DEVF_FORCE_DETACH 0x0000001
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904191309.x3JD9GsC089407>