Add VirtIO bus config_generation method
VirtIO buses (PCI, MMIO) can provide a generation field so a driver can ensure either a 64-bit or array read was stable. MFC after: 2 weeks
This commit is contained in:
parent
9cca77fa4f
commit
263105576c
@ -240,6 +240,13 @@ virtio_reinit_complete(device_t dev)
|
||||
VIRTIO_BUS_REINIT_COMPLETE(device_get_parent(dev));
|
||||
}
|
||||
|
||||
int
|
||||
virtio_config_generation(device_t dev)
|
||||
{
|
||||
|
||||
return (VIRTIO_BUS_CONFIG_GENERATION(device_get_parent(dev)));
|
||||
}
|
||||
|
||||
void
|
||||
virtio_read_device_config(device_t dev, bus_size_t offset, void *dst, int len)
|
||||
{
|
||||
|
@ -78,6 +78,7 @@ int virtio_alloc_virtqueues(device_t dev, int flags, int nvqs,
|
||||
int virtio_setup_intr(device_t dev, enum intr_type type);
|
||||
int virtio_with_feature(device_t dev, uint64_t feature);
|
||||
void virtio_stop(device_t dev);
|
||||
int virtio_config_generation(device_t dev);
|
||||
int virtio_reinit(device_t dev, uint64_t features);
|
||||
void virtio_reinit_complete(device_t dev);
|
||||
|
||||
|
@ -34,6 +34,14 @@ HEADER {
|
||||
struct vq_alloc_info;
|
||||
};
|
||||
|
||||
CODE {
|
||||
static int
|
||||
virtio_bus_default_config_generation(device_t dev)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
};
|
||||
|
||||
METHOD uint64_t negotiate_features {
|
||||
device_t dev;
|
||||
uint64_t child_features;
|
||||
@ -74,6 +82,10 @@ METHOD void notify_vq {
|
||||
uint16_t queue;
|
||||
};
|
||||
|
||||
METHOD int config_generation {
|
||||
device_t dev;
|
||||
} DEFAULT virtio_bus_default_config_generation;
|
||||
|
||||
METHOD void read_device_config {
|
||||
device_t dev;
|
||||
bus_size_t offset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user