Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Jan 2015 22:17:50 +0400
From:      Slawa Olhovchenkov <slw@zxy.spb.ru>
To:        John Baldwin <jhb@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: devctl(8): A device control utility
Message-ID:  <20150107181750.GB5588@zxy.spb.ru>
In-Reply-To: <3200196.9ZgXApgRdA@ralph.baldwin.cx>
References:  <3200196.9ZgXApgRdA@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 05, 2015 at 03:01:00PM -0500, John Baldwin wrote:

> For a long time I've wanted a way to administratively manipulate the state of 
> new-bus devices from userland.  I think the first use case I wanted was a way 
> to power off the sound controller (and anything else I wasn't using) on my 
> first laptop (a Dell Inspiron 5000e I got back in 2000).  Similarly, it would 
> be nice to have a way to handle "ejectable" devices (ACPI has a provision for 
> this, and said laptop had _EJx methods to allow one to swap a CD drive out for 
> a battery in a bay while the laptop was in S3).  There are some other use 
> cases that would also be nice such as detaching a driver from a PCI device to 
> decide at runtime that it should be passed through to a bhyve guest (and 
> possibly undoing that to allow a host driver to take it back over).  Forcing a 
> rescan of a PCI device can be useful if you are using an FPGA and would like 
> to alter BAR layout/sizes without having to reboot the OS.  A way to force 
> resets at runtime might also be useful (e.g. a FLR for a PCI device).  A few 
> weeks ago I finally sat down and started on an implementation.  It can be 
> found here:
> 
>    https://github.com/bsdjhb/freebsd/compare/devctl
> 
> Sample commands look like:
> 
>  % devctl disable virtio_pci2
> 
>  # detaches the driver, but leaves the device's name intact similar to
>  # specifying hint.virtio_pci.2.disabled=1 at boot
> 
>  % devctl enable virtio_pci2
> 
>  # enables a disabled device, including attaching it
> 
>  % devctl detach uart1
> 
>  # does a full detach, which means the device is now unnamed

Can be now this device used for VirtualBox USB passthrough?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150107181750.GB5588>