lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 08/13] [Suspend2] Userspace is ready!
Date
Routine called when we are waiting for a userspace helper to start, and
receive a netlink message from it, saying it's ready to go. We check the
version for compatability, and if all looks good, call the completion
handler on the waiting code. If not, we complain bitterly and try to
continue without it.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/netlink.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/power/netlink.c b/kernel/power/netlink.c
index 7f06f7c..9094c92 100644
--- a/kernel/power/netlink.c
+++ b/kernel/power/netlink.c
@@ -152,3 +152,22 @@ static int nl_set_nofreeze(struct user_h
return 0;
}

+/*
+ * Called when the userspace process has informed us that it's ready to roll.
+ */
+static int nl_ready(struct user_helper_data *uhd, int version)
+{
+ if (version != uhd->interface_version) {
+ printk("%s userspace process using invalid interface version."
+ " Trying to continue without it.\n",
+ uhd->name);
+ if (uhd->not_ready)
+ uhd->not_ready();
+ return 1;
+ }
+
+ complete(&uhd->wait_for_process);
+
+ return 0;
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 06:59    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site