freebsd_network: Add device_register hook as a recognized hook.
iflib-based drivers use it.
This commit is contained in:
@@ -294,7 +294,9 @@ device_set_driver(device_t dev, driver_t *driver)
|
|||||||
for (i = 0; driver->methods[i].name != NULL; i++) {
|
for (i = 0; driver->methods[i].name != NULL; i++) {
|
||||||
device_method_t *mth = &driver->methods[i];
|
device_method_t *mth = &driver->methods[i];
|
||||||
|
|
||||||
if (strcmp(mth->name, "device_probe") == 0)
|
if (strcmp(mth->name, "device_register") == 0)
|
||||||
|
dev->methods.device_register = (void *)mth->method;
|
||||||
|
else if (strcmp(mth->name, "device_probe") == 0)
|
||||||
dev->methods.probe = (void *)mth->method;
|
dev->methods.probe = (void *)mth->method;
|
||||||
else if (strcmp(mth->name, "device_attach") == 0)
|
else if (strcmp(mth->name, "device_attach") == 0)
|
||||||
dev->methods.attach = (void *)mth->method;
|
dev->methods.attach = (void *)mth->method;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ struct device {
|
|||||||
void *ivars;
|
void *ivars;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
void* (*device_register)(device_t dev);
|
||||||
int (*probe)(device_t dev);
|
int (*probe)(device_t dev);
|
||||||
int (*attach)(device_t dev);
|
int (*attach)(device_t dev);
|
||||||
int (*detach)(device_t dev);
|
int (*detach)(device_t dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user