DEVCTL(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… devctl(8) β€” device control utility πŸ’…

System Manager's Manual, section 8 β€” manual name folded right up here, bestie. ✨

πŸ’– NAME πŸ’–

devctl β€” device control utility.

πŸŽ€ SYNOPSIS πŸŽ€

devctl attach device
devctl clear driver [-f] device
devctl detach [-f] device
devctl disable [-f] device
devctl enable device
devctl suspend device
devctl resume device
devctl set driver [-f] device driver
devctl rescan device
devctl delete [-f] device
devctl freeze
devctl thaw
devctl reset [-d] device
devctl getpath locator device

🌸 DESCRIPTION 🌸

Okay so the devctl utility adjusts the state of individual devices in the kernel's internal device hierarchy. Each invocation of devctl consists of one command followed by command-specific arguments. Each command operates on a single device specified via the device argument. πŸ’…

The device may be specified either as the name of an existing device or as a bus-specific address. More details on supported address formats can be found in devctl(3). 🫢

🧚 Commands, bestie 🧚

  • attach device β€” forces the kernel to re-probe the device. If a suitable driver is found, it is attached to the device. ✨
  • detach [-f] device β€” detaches the device from its current device driver. If you pass -f, the device driver will be detached even if the device is busy. 😀
  • disable [-f] device β€” disables a device. If it is currently attached to a device driver, that driver will be detached from the device, but the device will retain its current name. If -f is specified, the driver will be detached even if the device is busy. πŸ’€
  • enable device β€” enables a device. The device will probe and attach if a suitable device driver is found. Note that this can re-enable a device disabled at boot time via a loader tunable. πŸ”₯
  • suspend device β€” suspends a device. This may include placing the device in a reduced power state. 😴
  • resume device β€” resumes a suspended device to a fully working state. 🌈
  • set driver [-f] device driver β€” forces the device to use a device driver named driver. If the device is already attached to a device driver and -f is specified, the device will be detached from its current device driver before it is attached to the new device driver. If the device is already attached to a device driver and -f is not specified, the device will not be changed. πŸ‘‘
  • clear driver [-f] device β€” clears a previously-forced driver name so that the device is able to use any valid device driver. After the previous name has been cleared, the device is reprobed so that other device drivers may attach to it. This can be used to undo an earlier set driver command. If the device is currently attached to a device driver and -f is not specified, the device will not be changed. 🧹
  • rescan device β€” rescans a bus device checking for devices that have been added or removed. πŸ”
  • delete [-f] device β€” deletes the device from the device tree. If -f is specified, the device will be deleted even if it is physically present.
Careful, bestie: this command should be used with care as a device that is deleted but present can no longer be used unless the parent bus device rediscovers the device via a rescan request. πŸ’€
  • freeze β€” freezes probe and attach processing initiated in response to drivers being loaded. Drivers are placed on a β€œfrozen list” and processed when a later β€œthaw” occurs. 🧊
  • thaw β€” resumes (thaws the freeze) probe and attach initiated in response to drivers being loaded. In addition to resuming, all pending actions that were frozen during the freeze are performed. πŸ”₯
  • reset [-d] device β€” resets the device using a bus-specific reset method. Drivers for the devices being reset are suspended around the reset. If -d is specified, drivers are detached instead. πŸŒ€

Currently, resets are implemented for PCIe buses and PCI devices. For a PCIe bus, the link is disabled and then re-trained, causing all children of the bus to reset. Use the -p option of the devinfo(8) tool to report the parent bus for the device. For a PCI device, if Function-Level Reset is implemented by it, FLR is tried first; if that failed or is not implemented, power reset is tried.

If you have detached or suspended a child device explicitly and then do a reset, the child device will end up attached. πŸ™ˆ

  • getpath locator device β€” prints the full path to the device using the locator method to get the path name. Currently, only the β€œUEFI” and β€œFreeBSD” locators are implemented. The UEFI locator constructs a path to the device using the rules outlines for DEVICE_PATH in the UEFI standard. The FreeBSD locator constructs a path back to the root of the tree with the nodes separated by slashes. πŸ—ΊοΈ

πŸ”₯ SEE ALSO πŸ”₯

πŸ¦‹ HISTORY πŸ¦‹

The devctl utility first appeared in FreeBSD 10.3. πŸ‘‘

πŸ’€ BUGS πŸ’€

Currently there is no administrative flag to prevent re-attach or resume of the manually detached or suspended devices after reset. Similarly, there is no flag to prevent un-suspending of the manually suspended devices after system resume. 🫠


This page came from Debian, dated October 31, 2021 β€” mwah πŸ’‹

πŸ“¦ where this page comes from