freebsd_network: Add device_register hook as a recognized hook.

iflib-based drivers use it.
This commit is contained in:
Augustin Cavalier
2019-01-03 21:20:34 -05:00
parent da60a673b6
commit c25e20c5f9
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -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;
+1
View File
@@ -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);