1 /* arch/arm/mach-msm/rpc_server_dog_keepalive.c
3 * Copyright (C) 2007 Google, Inc.
4 * Author: Iliyan Malchev <ibm@android.com>
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #include <linux/module.h>
18 #include <linux/kernel.h>
19 #include <mach/msm_rpcrouter.h>
21 /* dog_keepalive server definitions */
23 #define DOG_KEEPALIVE_PROG 0x30000015
24 #if CONFIG_MSM_AMSS_VERSION==6210
25 #define DOG_KEEPALIVE_VERS 0
26 #define RPC_DOG_KEEPALIVE_BEACON 1
27 #elif (CONFIG_MSM_AMSS_VERSION==6220) || (CONFIG_MSM_AMSS_VERSION==6225)
28 #define DOG_KEEPALIVE_VERS 0x731fa727
29 #define RPC_DOG_KEEPALIVE_BEACON 2
30 #elif CONFIG_MSM_AMSS_VERSION==6350
31 #define DOG_KEEPALIVE_VERS 0x00010000
32 #define RPC_DOG_KEEPALIVE_BEACON 2
34 #error "Unsupported AMSS version"
36 #define RPC_DOG_KEEPALIVE_NULL 0
39 /* TODO: Remove server registration with _VERS when modem is upated with _COMP*/
41 static int handle_rpc_call(struct msm_rpc_server *server,
42 struct rpc_request_hdr *req, unsigned len)
44 switch (req->procedure) {
45 case RPC_DOG_KEEPALIVE_NULL:
47 case RPC_DOG_KEEPALIVE_BEACON:
48 printk(KERN_INFO "DOG KEEPALIVE PING\n");
55 static struct msm_rpc_server rpc_server = {
56 .prog = DOG_KEEPALIVE_PROG,
57 .vers = DOG_KEEPALIVE_VERS,
58 .rpc_call = handle_rpc_call,
61 static int __init rpc_server_init(void)
63 /* Dual server registration to support backwards compatibility vers */
64 return msm_rpc_create_server(&rpc_server);
68 module_init(rpc_server_init);