diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 71924cc7fe6b..9c07bf1fac3a 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1777,6 +1777,14 @@ device_probe_child(device_t dev, device_t child) * of pri for the first match. */ if (best == NULL || result > pri) { + /* + * Probes that return BUS_PROBE_NOWILDCARD + * or lower only match when they are set + * in stone by the parent bus. + */ + if (result <= BUS_PROBE_NOWILDCARD && + child->flags & DF_WILDCARD) + continue; best = dl; pri = result; continue; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 14634371b260..6e57c3d6ba78 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -494,7 +494,10 @@ void bus_data_generation_update(void); * is for drivers that wish to have a generic form and a specialized form, * like is done with the pci bus and the acpi pci bus. BUS_PROBE_HOOVER is * for those busses that implement a generic device place-holder for devices on - * the bus that have no more specific driver for them (aka ugen). + * the bus that have no more specific river for them (aka ugen). + * BUS_PROBE_NOWILDCARD or lower means that the device isn't really bidding + * for a device node, but accepts only devices that its parent has told it + * use this driver. */ #define BUS_PROBE_SPECIFIC 0 /* Only I can use this device */ #define BUS_PROBE_VENDOR (-10) /* Vendor supplied driver */ @@ -502,6 +505,7 @@ void bus_data_generation_update(void); #define BUS_PROBE_LOW_PRIORITY (-40) /* Older, less desirable drivers */ #define BUS_PROBE_GENERIC (-100) /* generic driver for dev */ #define BUS_PROBE_HOOVER (-500) /* Generic dev for all devs on bus */ +#define BUS_PROBE_NOWILDCARD (-2000000000) /* No wildcard device matches */ /** * Shorthand for constructing method tables.