aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual/lguest/lguest.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/virtual/lguest/lguest.c')
-rw-r--r--Documentation/virtual/lguest/lguest.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/Documentation/virtual/lguest/lguest.c b/Documentation/virtual/lguest/lguest.c
index d9da7e14853..cd9d6af61d0 100644
--- a/Documentation/virtual/lguest/lguest.c
+++ b/Documentation/virtual/lguest/lguest.c
@@ -49,7 +49,7 @@
49#include <linux/virtio_rng.h> 49#include <linux/virtio_rng.h>
50#include <linux/virtio_ring.h> 50#include <linux/virtio_ring.h>
51#include <asm/bootparam.h> 51#include <asm/bootparam.h>
52#include "../../include/linux/lguest_launcher.h" 52#include "../../../include/linux/lguest_launcher.h"
53/*L:110 53/*L:110
54 * We can ignore the 42 include files we need for this program, but I do want 54 * We can ignore the 42 include files we need for this program, but I do want
55 * to draw attention to the use of kernel-style types. 55 * to draw attention to the use of kernel-style types.
@@ -135,9 +135,6 @@ struct device {
135 /* Is it operational */ 135 /* Is it operational */
136 bool running; 136 bool running;
137 137
138 /* Does Guest want an intrrupt on empty? */
139 bool irq_on_empty;
140
141 /* Device-specific data. */ 138 /* Device-specific data. */
142 void *priv; 139 void *priv;
143}; 140};
@@ -637,10 +634,7 @@ static void trigger_irq(struct virtqueue *vq)
637 634
638 /* If they don't want an interrupt, don't send one... */ 635 /* If they don't want an interrupt, don't send one... */
639 if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) { 636 if (vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) {
640 /* ... unless they've asked us to force one on empty. */ 637 return;
641 if (!vq->dev->irq_on_empty
642 || lg_last_avail(vq) != vq->vring.avail->idx)
643 return;
644 } 638 }
645 639
646 /* Send the Guest an interrupt tell them we used something up. */ 640 /* Send the Guest an interrupt tell them we used something up. */
@@ -1057,15 +1051,6 @@ static void create_thread(struct virtqueue *vq)
1057 close(vq->eventfd); 1051 close(vq->eventfd);
1058} 1052}
1059 1053
1060static bool accepted_feature(struct device *dev, unsigned int bit)
1061{
1062 const u8 *features = get_feature_bits(dev) + dev->feature_len;
1063
1064 if (dev->feature_len < bit / CHAR_BIT)
1065 return false;
1066 return features[bit / CHAR_BIT] & (1 << (bit % CHAR_BIT));
1067}
1068
1069static void start_device(struct device *dev) 1054static void start_device(struct device *dev)
1070{ 1055{
1071 unsigned int i; 1056 unsigned int i;
@@ -1079,8 +1064,6 @@ static void start_device(struct device *dev)
1079 verbose(" %02x", get_feature_bits(dev) 1064 verbose(" %02x", get_feature_bits(dev)
1080 [dev->feature_len+i]); 1065 [dev->feature_len+i]);
1081 1066
1082 dev->irq_on_empty = accepted_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
1083
1084 for (vq = dev->vq; vq; vq = vq->next) { 1067 for (vq = dev->vq; vq; vq = vq->next) {
1085 if (vq->service) 1068 if (vq->service)
1086 create_thread(vq); 1069 create_thread(vq);
@@ -1564,7 +1547,6 @@ static void setup_tun_net(char *arg)
1564 /* Set up the tun device. */ 1547 /* Set up the tun device. */
1565 configure_device(ipfd, tapif, ip); 1548 configure_device(ipfd, tapif, ip);
1566 1549
1567 add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
1568 /* Expect Guest to handle everything except UFO */ 1550 /* Expect Guest to handle everything except UFO */
1569 add_feature(dev, VIRTIO_NET_F_CSUM); 1551 add_feature(dev, VIRTIO_NET_F_CSUM);
1570 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); 1552 add_feature(dev, VIRTIO_NET_F_GUEST_CSUM);