Add two new macros DRIVER_MODULE_ORDERED() and EARLY_DRIVER_MODULE_ORDERED()
that allow a module to use an order other than the default of SI_ORDER_MIDDLE when registering a driver. This can be useful for drivers in a kld that contain multiple new-bus drivers as part of one logical device driver. A typical case would be to use SI_ORDER_LAST for the "main" driver to ensure that any other "helper" drivers are registered and available before the "main" driver attempts to attach. Tested by: kib, Jason Harmening jason harmening / gmail Approved by: re (kib) MFC after: 1 week
This commit is contained in:
parent
1d94389f8f
commit
9d10e169c9
@ -596,7 +596,8 @@ struct driver_module_data {
|
||||
int dmd_pass;
|
||||
};
|
||||
|
||||
#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \
|
||||
#define EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \
|
||||
evh, arg, order, pass) \
|
||||
\
|
||||
static struct driver_module_data name##_##busname##_driver_mod = { \
|
||||
evh, arg, \
|
||||
@ -612,7 +613,16 @@ static moduledata_t name##_##busname##_mod = { \
|
||||
&name##_##busname##_driver_mod \
|
||||
}; \
|
||||
DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \
|
||||
SI_SUB_DRIVERS, SI_ORDER_MIDDLE)
|
||||
SI_SUB_DRIVERS, order)
|
||||
|
||||
#define EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, pass) \
|
||||
EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \
|
||||
evh, arg, SI_ORDER_MIDDLE, pass)
|
||||
|
||||
#define DRIVER_MODULE_ORDERED(name, busname, driver, devclass, evh, arg,\
|
||||
order) \
|
||||
EARLY_DRIVER_MODULE_ORDERED(name, busname, driver, devclass, \
|
||||
evh, arg, order, BUS_PASS_DEFAULT)
|
||||
|
||||
#define DRIVER_MODULE(name, busname, driver, devclass, evh, arg) \
|
||||
EARLY_DRIVER_MODULE(name, busname, driver, devclass, evh, arg, \
|
||||
|
Loading…
x
Reference in New Issue
Block a user