How to hotplug pci/e devices in freeBSD? (Or How to remove and rescan/re-enumerate pci device?)

Eran Harpaz eharpaz at
Thu Apr 2 07:17:55 UTC 2015

I'm looking for a way to refresh/re-enumerate the pci device list.

In Linux, you can remove a particular pci device, and then after preforming
a "rescan" the device will appear again. In Linux it is done by:

echo 1 > /sys/bus/pci/devices/.../remove
echo 1 > /sys/bus/pci/rescan

I'm looking for a similar functionality in freeBSD.

*What do I want to achieve?*

I'm using freeBSD and my pcie device can be reset from the host. But when
it boots again, it's uncommunicative, so I want to rescan the pci devices
in order to initiate a new connection between the host and the device.

Any idea would be appreciated, even if it takes some coding effort.


More information about the freebsd-current mailing list