BUS_RESCAN(9)

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

πŸ’… BUS_RESCAN(9) β€” rescan a bus checking for devices that have been added or removed πŸ’…

okay so bestie, this is from the Kernel Developer's Manual, and we're about to get into the whole "did the bus change while we weren't looking?" situation. No cap, it's niche but iconic. πŸŽ€


🌸 NAME 🌸

BUS_RESCAN β€” rescan a bus checking for devices that have been added or removed

✨ SYNOPSIS ✨

#include <sys/param.h>
#include <sys/bus.h>

void
BUS_RESCAN(device_t dev);

πŸ’… DESCRIPTION πŸ’…

The BUS_RESCAN() method is called to request a rescan of the child devices on a bus device. Like, it's the "hey bestie, can you look at your kids again?" method. 🫢

The method should add any devices that have been added since the previous scan and remove devices that have been removed. So yeah, it's giving cleanup era: new friends get added, gone friends get removed. πŸ’–

This method is not required to re-examine existing devices to determine if their properties have changed. It is also not required to propagate the rescan request to child devices. So it's lowkey not doing a full deep-dive on every already-present device, and it's not obligated to pass the rescan request down to its children either. Important boundary, periodt. ✨

bestie, do not assume BUS_RESCAN() does more than the manual says β€” it handles devices added or removed since the previous scan, and it is not required to check property changes on existing devices or to propagate the request to child devices. 🌈

πŸ¦‹ SEE ALSO πŸ¦‹


mwah, that's the whole page πŸ’‹ β€” this one is from Debian and dated April 27, 2016, so go forth and rescan responsibly, bestie πŸ’œπŸ¦‹

πŸ“¦ where this page comes from