Messages in this thread Patch in this message |  | | | From | Nigel Cunningham <> | | Subject | [Suspend2][ 08/13] [Suspend2] Userspace is ready! | | Date | Tue, 27 Jun 2006 14:39:50 +1000 |
| |
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/
|  |