summaryrefslogtreecommitdiff
path: root/lib/libdevctl
AgeCommit message (Collapse)Author
2024-10-15manuals: Fix some "missing section argument"Graham Percival
These were reported by `mandoc -T lint ...` as warnings. Signed-off-by: Graham Percival <gperciva@tarsnap.com> Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com> Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1467
2024-07-15Remove residual blank line at start of MakefileWarner Losh
This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
2023-11-26lib: Automated cleanup of cdefs and other formattingWarner Losh
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
2023-08-16Remove $FreeBSD$: two-line nroff patternWarner Losh
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2022-03-01libdevctl: Add devctl_getpathWarner Losh
Helper routine to call the kernel to get a path to the named device. Different path enumeration methods (called locators) can be used for different path types depending on what the kernel implements. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D32746
2019-12-11Update Makefile.depend filesSimon J. Gerraty
Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
2019-09-05pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot
The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
2019-04-05Implement devctl(8) command 'reset', using DEV_RESET /dev/devctl2 ioctl.Konstantin Belousov
Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646 Notes: svn path=/head/; revision=345966
2019-04-05Add __BEGIN_DECLS/__END_DECLS braces to libdevctl header.Konstantin Belousov
Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646 Notes: svn path=/head/; revision=345959
2019-03-06Drop "All rights reserved" from my copyright statements.John Baldwin
Reviewed by: rgrimes MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19485 Notes: svn path=/head/; revision=344855
2018-08-23Forgot to bump .Dd in r338233 like I promised in the review. Doh!Warner Losh
Notes: svn path=/head/; revision=338240
2018-08-23Create devctl freeze/thaw.Warner Losh
This adds it to devctl, libdevctl, defines the two IOCTLs and implements the kernel bits. causes any new drivers that are added via kldload to be deferred until a 'thaw' comes in. These do not stack: it is an error to freeze while frozen, or thaw while thawed. Differential Revision: https://reviews.freebsd.org/D16735 Notes: svn path=/head/; revision=338233
2017-10-31DIRDEPS_BUILD: Update dependencies.Bryan Drewery
Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
2016-08-29Implement 'devctl clear driver' to undo a previous 'devctl set driver'.John Baldwin
Add a new 'clear driver' command for devctl along with the accompanying ioctl and devctl_clear_driver() library routine to reset a device to use a wildcard devclass instead of a fixed devclass. This can be used to undo a previous 'set driver' command. After the device's name has been reset to permit wildcard names, it is reprobed so that it can attach to newly-available (to it) device drivers. MFC after: 1 month Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=305034
2016-04-27Add 'devctl delete' that calls device_delete_child().John Baldwin
'devctl delete' can be used to delete a device that is no longer present. As an anti-foot-shooting measure, 'delete' will not delete a device unless it's parent bus says it is no longer present. This can be overridden by passing the force ('-f') flag. Note that this command should be used with care. If a device is deleted that is actually present it can't be resurrected unless the parent bus device's driver supports rescans. Differential Revision: https://reviews.freebsd.org/D6019 Notes: svn path=/head/; revision=298709
2016-04-27Add a new rescan method to the bus interface.John Baldwin
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 Notes: svn path=/head/; revision=298707
2016-02-04First pass through library packaging.Glen Barber
Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
2016-02-02- Note that devctl(8) will appear in 10.3 first.John Baldwin
- Add missing devctl_set_driver entry to namelist in devlist(3). - Fix sorting of function prototypes in devlist(3). MFC after: 3 days Notes: svn path=/head/; revision=295174
2015-12-01META MODE: Update dependencies with 'the-lot' and add missing directories.Bryan Drewery
This is not properly respecting WITHOUT or ARCH dependencies in target/. Doing so requires a massive effort to rework targets/ to do so. A better approach will be to either include the SUBDIR Makefiles directly and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose the benefit of having a userland/lib, userland/libexec, etc, though and results in a massive package. The current implementation of targets/ is very unmaintainable. Currently rescue/rescue and sys/modules are still not connected. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291563
2015-02-06Add a new device control utility for new-bus devices called devctl. ThisJohn Baldwin
allows the user to request administrative changes to individual devices such as attach or detaching drivers or disabling and re-enabling devices. - Add a new /dev/devctl2 character device which uses ioctls for device requests. The ioctls use a common 'struct devreq' which is somewhat similar to 'struct ifreq'. - The ioctls identify the device to operate on via a string. This string can either by the device's name, or it can be a bus-specific address. (For unattached devices, a bus address is the only way to locate a device.) Bus drivers register an eventhandler to claim unrecognized device names that the driver recognizes as a valid address. Two buses currently support addresses: ACPI recognizes any device in the ACPI namespace via its full path starting with "\" and the PCI bus driver recognizes an address specification of 'pci[<domain>:]<bus>:<slot>:<func>' (identical to the PCI selector strings supported by pciconf). - To make it easier to cut and paste, change the PnP location string in the PCI bus driver to output a full PCI selector string rather than 'slot=<slot> function=<func>'. - Add a devctl(3) interface in libdevctl which provides a wrapper around the ioctls and is the preferred interface for other userland code. - Add a devctl(8) program which is a simple wrapper around the requests supported by devctl(3). - Add a device_is_suspended() function to check DF_SUSPENDED. - Add a resource_unset_value() function that can be used to remove a hint from the kernel environment. This is used to clear a hint.<driver>.<unit>.disabled hint when re-enabling a boot-time disabled device. Reviewed by: imp (parts) Requested by: imp (changing PCI location string) Relnotes: yes Notes: svn path=/head/; revision=278320