aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_pci.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-07-25 13:06:07 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-07-24 22:06:12 -0400
commitc624896e488ba2bff5ae497782cfb265c8b00646 (patch)
tree714145903ff8c889e9544e8366b2ee2a62234c0c /drivers/virtio/virtio_pci.c
parentdd7c7bc46211785a1aa7d70feb15830f62682b3c (diff)
virtio: Rename set_features to finalize_features
Rather than explicitly handing the features to the lower-level, we just hand the virtio_device and have it set the features. This make it clear that it has the chance to manipulate the features of the device at this point (and that all feature negotiation is already done). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_pci.c')
-rw-r--r--drivers/virtio/virtio_pci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index eae7236310e4..9855975a72a3 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -94,12 +94,14 @@ static u32 vp_get_features(struct virtio_device *vdev)
94 return ioread32(vp_dev->ioaddr + VIRTIO_PCI_HOST_FEATURES); 94 return ioread32(vp_dev->ioaddr + VIRTIO_PCI_HOST_FEATURES);
95} 95}
96 96
97/* virtio config->set_features() implementation */ 97/* virtio config->finalize_features() implementation */
98static void vp_set_features(struct virtio_device *vdev, u32 features) 98static void vp_finalize_features(struct virtio_device *vdev)
99{ 99{
100 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 100 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
101 101
102 iowrite32(features, vp_dev->ioaddr + VIRTIO_PCI_GUEST_FEATURES); 102 /* We only support 32 feature bits. */
103 BUILD_BUG_ON(ARRAY_SIZE(vdev->features) != 1);
104 iowrite32(vdev->features[0], vp_dev->ioaddr+VIRTIO_PCI_GUEST_FEATURES);
103} 105}
104 106
105/* virtio config->get() implementation */ 107/* virtio config->get() implementation */
@@ -297,7 +299,7 @@ static struct virtio_config_ops virtio_pci_config_ops = {
297 .find_vq = vp_find_vq, 299 .find_vq = vp_find_vq,
298 .del_vq = vp_del_vq, 300 .del_vq = vp_del_vq,
299 .get_features = vp_get_features, 301 .get_features = vp_get_features,
300 .set_features = vp_set_features, 302 .finalize_features = vp_finalize_features,
301}; 303};
302 304
303/* the PCI probing function */ 305/* the PCI probing function */