Add optional VirtIO device method for post-attach notifications

This is called after the parent device (ie virito_pci) has
completed the device attachment/initialization.
This commit is contained in:
bryanv 2013-09-01 04:20:23 +00:00
parent f175a1e7f9
commit a9e07a227e
2 changed files with 15 additions and 1 deletions

View File

@ -757,8 +757,10 @@ vtpci_probe_and_attach_child(struct vtpci_softc *sc)
vtpci_release_child_resources(sc);
/* Reset status for future attempt. */
vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_ACK);
} else
} else {
vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_DRIVER_OK);
VIRTIO_ATTACH_COMPLETED(child);
}
}
static int

View File

@ -29,6 +29,18 @@
INTERFACE virtio;
CODE {
static int
virtio_default_attach_completed(device_t dev)
{
return (0);
}
};
METHOD int attach_completed {
device_t dev;
} DEFAULT virtio_default_attach_completed;
CODE {
static int
virtio_default_config_change(device_t dev)