WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] This patch implements select() functionality on /dev/vtp

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch implements select() functionality on /dev/vtpm and fixes some
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Oct 2005 08:46:11 +0000
Delivery-date: Wed, 12 Oct 2005 08:43:47 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 801ffcaa450b4c16a6ab8ddd5d49617fcaa93e7f
# Parent  1fd8bd3591183c55d234c2588679358aec0109ba
This patch implements select() functionality on /dev/vtpm and fixes some 
other problems.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

diff -r 1fd8bd359118 -r 801ffcaa450b 
linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c
--- a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c        Wed Oct 12 
08:31:53 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c        Wed Oct 12 
08:33:03 2005
@@ -17,6 +17,7 @@
 #include <linux/types.h>
 #include <linux/list.h>
 #include <linux/miscdevice.h>
+#include <linux/poll.h>
 #include <asm/uaccess.h>
 #include <asm-xen/xenbus.h>
 #include <asm-xen/xen-public/grant_table.h>
@@ -680,9 +681,14 @@
 }
 
 static unsigned int
-vtpm_op_poll(struct file *file, struct poll_table_struct *pst)
-{
-       return 0;
+vtpm_op_poll(struct file *file, struct poll_table_struct *pts)
+{
+       unsigned int flags = POLLOUT | POLLWRNORM;
+       poll_wait(file, &dataex.wait_queue, pts);
+       if (!list_empty(&dataex.pending_pak)) {
+               flags |= POLLIN | POLLRDNORM;
+       }
+       return flags;
 }
 
 static struct file_operations vtpm_ops = {
diff -r 1fd8bd359118 -r 801ffcaa450b 
linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c      Wed Oct 12 
08:31:53 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c      Wed Oct 12 
08:33:03 2005
@@ -39,6 +39,7 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/tpmfe.h>
+#include <linux/err.h>
 
 #include <asm/semaphore.h>
 #include <asm/io.h>
@@ -372,7 +373,7 @@
        info->watch.callback = watch_for_status;
        err = register_xenbus_watch(&info->watch);
        if (err) {
-               message = "registering watch on backend";
+               xenbus_dev_error(dev, err, "registering watch on backend");
                goto destroy_tpmring;
        }
 
@@ -398,6 +399,8 @@
        int err;
        struct tpmfront_info *info;
        int handle;
+       int len = max(XS_WATCH_PATH, XS_WATCH_TOKEN) + 1;
+       const char *vec[len];
 
        err = xenbus_scanf(NULL, dev->nodename,
                           "handle", "%i", &handle);
@@ -426,6 +429,10 @@
                dev->data = NULL;
                return err;
        }
+
+       vec[XS_WATCH_PATH]  = info->watch.node;
+       vec[XS_WATCH_TOKEN] = NULL;
+       watch_for_status(&info->watch, vec, len);
 
        return 0;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch implements select() functionality on /dev/vtpm and fixes some, Xen patchbot -unstable <=