virtio: add clear_feature hook.
Change-Id: I282ffc65a7bd692145626ab4272c5df4a792e9d4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2383 Reviewed-by: Adrien Destugues <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
58b3e18891
commit
d8e1fd6eda
@@ -101,6 +101,8 @@ typedef struct {
|
||||
status_t (*negotiate_features)(virtio_device cookie, uint32 supported,
|
||||
uint32* negotiated, const char* (*get_feature_name)(uint32));
|
||||
|
||||
status_t (*clear_feature)(virtio_device cookie, uint32 feature);
|
||||
|
||||
status_t (*read_device_config)(virtio_device cookie, uint8 offset,
|
||||
void* buffer, size_t bufferSize);
|
||||
status_t (*write_device_config)(virtio_device cookie, uint8 offset,
|
||||
|
||||
@@ -126,6 +126,14 @@ VirtioDevice::NegotiateFeatures(uint32 supported, uint32* negotiated,
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VirtioDevice::ClearFeature(uint32 feature)
|
||||
{
|
||||
fFeatures &= ~feature;
|
||||
return fController->write_guest_features(fCookie, fFeatures);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
VirtioDevice::ReadDeviceConfig(uint8 offset, void* buffer, size_t bufferSize)
|
||||
{
|
||||
|
||||
@@ -63,6 +63,16 @@ virtio_negotiate_features(void* _device, uint32 supported,
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
virtio_clear_feature(void* _device, uint32 feature)
|
||||
{
|
||||
CALLED();
|
||||
VirtioDevice *device = (VirtioDevice *)_device;
|
||||
|
||||
return device->ClearFeature(feature);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
virtio_read_device_config(void* _device, uint8 offset, void* buffer,
|
||||
size_t bufferSize)
|
||||
@@ -275,6 +285,7 @@ virtio_device_interface virtio_device_module = {
|
||||
},
|
||||
|
||||
virtio_negotiate_features,
|
||||
virtio_clear_feature,
|
||||
virtio_read_device_config,
|
||||
virtio_write_device_config,
|
||||
virtio_alloc_queues,
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
status_t NegotiateFeatures(uint32 supported,
|
||||
uint32* negotiated,
|
||||
const char* (*get_feature_name)(uint32));
|
||||
status_t ClearFeature(uint32 feature);
|
||||
|
||||
status_t ReadDeviceConfig(uint8 offset, void* buffer,
|
||||
size_t bufferSize);
|
||||
|
||||
Reference in New Issue
Block a user