diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-07-25 13:06:07 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-07-24 22:06:07 -0400 |
commit | dd7c7bc46211785a1aa7d70feb15830f62682b3c (patch) | |
tree | 3c615eac390c11339c652947e744d12cb82b4d36 | |
parent | faeba830b086bc9e58748869054e994cb09693cd (diff) |
virtio: Formally reserve bits 28-31 to be 'transport' features.
We assign feature bits as required, but it makes sense to reserve some
for the particular transport, rather than the particular device.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | drivers/virtio/virtio.c | 5 | ||||
-rw-r--r-- | include/linux/virtio_config.h | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index fc85cba64578..baf103361e3a 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c | |||
@@ -113,6 +113,11 @@ static int virtio_dev_probe(struct device *_d) | |||
113 | set_bit(f, dev->features); | 113 | set_bit(f, dev->features); |
114 | } | 114 | } |
115 | 115 | ||
116 | /* Transport features are always preserved to pass to set_features. */ | ||
117 | for (i = VIRTIO_TRANSPORT_F_START; i < VIRTIO_TRANSPORT_F_END; i++) | ||
118 | if (device_features & (1 << i)) | ||
119 | set_bit(i, dev->features); | ||
120 | |||
116 | err = drv->probe(dev); | 121 | err = drv->probe(dev); |
117 | if (err) | 122 | if (err) |
118 | add_status(dev, VIRTIO_CONFIG_S_FAILED); | 123 | add_status(dev, VIRTIO_CONFIG_S_FAILED); |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7eb4b34d13bb..5a30cfb7934b 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -18,6 +18,12 @@ | |||
18 | /* We've given up on this device. */ | 18 | /* We've given up on this device. */ |
19 | #define VIRTIO_CONFIG_S_FAILED 0x80 | 19 | #define VIRTIO_CONFIG_S_FAILED 0x80 |
20 | 20 | ||
21 | /* Some virtio feature bits (currently bits 28 through 31) are reserved for the | ||
22 | * transport being used (eg. virtio_ring), the rest are per-device feature | ||
23 | * bits. */ | ||
24 | #define VIRTIO_TRANSPORT_F_START 28 | ||
25 | #define VIRTIO_TRANSPORT_F_END 32 | ||
26 | |||
21 | /* Do we get callbacks when the ring is completely used, even if we've | 27 | /* Do we get callbacks when the ring is completely used, even if we've |
22 | * suppressed them? */ | 28 | * suppressed them? */ |
23 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |