summaryrefslogtreecommitdiffstats
path: root/drivers/lguest/lguest_device.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-09 01:59:05 +0200
committerDavid S. Miller <davem@davemloft.net>2008-09-09 01:59:05 +0200
commit17dce5dfe38ae2fb359b61e855f5d8a3a8b7892b (patch)
tree88bb1fcf84f9ebfa4299c9a8dcd9e6330b358446 /drivers/lguest/lguest_device.c
parentnetns bridge: cleanup bridges during netns stop (diff)
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinn... (diff)
downloadlinux-17dce5dfe38ae2fb359b61e855f5d8a3a8b7892b.tar.xz
linux-17dce5dfe38ae2fb359b61e855f5d8a3a8b7892b.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: net/mac80211/mlme.c
Diffstat (limited to 'drivers/lguest/lguest_device.c')
-rw-r--r--drivers/lguest/lguest_device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c
index 37344aaee22f..a661bbdae3d6 100644
--- a/drivers/lguest/lguest_device.c
+++ b/drivers/lguest/lguest_device.c
@@ -98,6 +98,10 @@ static u32 lg_get_features(struct virtio_device *vdev)
return features;
}
+/* The virtio core takes the features the Host offers, and copies the
+ * ones supported by the driver into the vdev->features array. Once
+ * that's all sorted out, this routine is called so we can tell the
+ * Host which features we understand and accept. */
static void lg_finalize_features(struct virtio_device *vdev)
{
unsigned int i, bits;
@@ -108,6 +112,10 @@ static void lg_finalize_features(struct virtio_device *vdev)
/* Give virtio_ring a chance to accept features. */
vring_transport_features(vdev);
+ /* The vdev->feature array is a Linux bitmask: this isn't the
+ * same as a the simple array of bits used by lguest devices
+ * for features. So we do this slow, manual conversion which is
+ * completely general. */
memset(out_features, 0, desc->feature_len);
bits = min_t(unsigned, desc->feature_len, sizeof(vdev->features)) * 8;
for (i = 0; i < bits; i++) {