virtio: Formally reserve bits 24-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>
---
 drivers/virtio/virtio.c       |    5 +++++
 include/linux/virtio_config.h |    7 +++++++
 2 files changed, 12 insertions(+)

diff -r 8b365338fbbf drivers/virtio/virtio.c
--- a/drivers/virtio/virtio.c	Tue Apr 22 13:21:34 2008 +1000
+++ b/drivers/virtio/virtio.c	Tue Apr 22 13:48:58 2008 +1000
@@ -117,6 +117,11 @@ static int virtio_dev_probe(struct devic
 			set_bit(f, dev->features);
 	}
 
+	/* Transport features are always preserved to pass to set_features. */
+	for (i = VIRTIO_TRANSPORT_F_START; i < VIRTIO_TRANSPORT_F_END; i++)
+		if (device_features & (1 << i))
+			set_bit(i, dev->features);
+
 	err = drv->probe(dev);
 	if (err)
 		add_status(dev, VIRTIO_CONFIG_S_FAILED);
diff -r 8b365338fbbf include/linux/virtio_config.h
--- a/include/linux/virtio_config.h	Tue Apr 22 13:21:34 2008 +1000
+++ b/include/linux/virtio_config.h	Tue Apr 22 13:48:58 2008 +1000
@@ -14,6 +14,13 @@
 #define VIRTIO_CONFIG_S_DRIVER_OK	4
 /* We've given up on this device. */
 #define VIRTIO_CONFIG_S_FAILED		0x80
+
+/* Some virtio feature bits (currently bits 24 through 31) are reserved for the
+ * transport being used (eg. virtio_ring), the rest are per-device feature
+ * bits. */
+#define VIRTIO_TRANSPORT_F_START	24
+#define VIRTIO_TRANSPORT_F_END		32
+#define VIRTIO_TRANSPORT_F_MASK		0xFF000000
 
 #ifdef __KERNEL__
 #include <linux/virtio.h>
