MCPcopy Create free account
hub / github.com/F-Stack/f-stack / device_probe

Function device_probe

freebsd/kern/subr_bus.c:2861–2888  ·  view source on GitHub ↗

* @brief Probe a device, and return this status. * * This function is the core of the device autoconfiguration * system. Its purpose is to select a suitable driver for a device and * then call that driver to initialise the hardware appropriately. The * driver is selected by calling the DEVICE_PROBE() method of a set of * candidate drivers and then choosing the driver which returned the * be

Source from the content-addressed store, hash-verified

2859 * @retval -1 Device already attached
2860 */
2861int
2862device_probe(device_t dev)
2863{
2864 int error;
2865
2866 GIANT_REQUIRED;
2867
2868 if (dev->state >= DS_ALIVE && (dev->flags & DF_REBID) == 0)
2869 return (-1);
2870
2871 if (!(dev->flags & DF_ENABLED)) {
2872 if (bootverbose && device_get_name(dev) != NULL) {
2873 device_print_prettyname(dev);
2874 printf("not probed (disabled)\n");
2875 }
2876 return (-1);
2877 }
2878 if ((error = device_probe_child(dev->parent, dev)) != 0) {
2879 if (bus_current_pass == BUS_PASS_DEFAULT &&
2880 !(dev->flags & DF_DONENOMATCH)) {
2881 BUS_PROBE_NOMATCH(dev->parent, dev);
2882 devnomatch(dev);
2883 dev->flags |= DF_DONENOMATCH;
2884 }
2885 return (error);
2886 }
2887 return (0);
2888}
2889
2890/**
2891 * @brief Probe a device and attach a driver if possible

Callers 2

cvm_oct_init_moduleFunction · 0.85
device_probe_and_attachFunction · 0.85

Calls 5

device_get_nameFunction · 0.85
device_print_prettynameFunction · 0.85
device_probe_childFunction · 0.85
devnomatchFunction · 0.85
printfFunction · 0.70

Tested by

no test coverage detected