Added patch headers.
[linux-flexiantxendom0-3.2.10.git] / drivers / staging / dream / smd / rpc_server_dog_keepalive.c
1 /* arch/arm/mach-msm/rpc_server_dog_keepalive.c
2  *
3  * Copyright (C) 2007 Google, Inc.
4  * Author: Iliyan Malchev <ibm@android.com>
5  *
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.
9  *
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.
14  *
15  */
16
17 #include <linux/module.h>
18 #include <linux/kernel.h>
19 #include <mach/msm_rpcrouter.h>
20
21 /* dog_keepalive server definitions */
22
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
33 #else
34 #error "Unsupported AMSS version"
35 #endif
36 #define RPC_DOG_KEEPALIVE_NULL 0
37
38
39 /* TODO: Remove server registration with _VERS when modem is upated with _COMP*/
40
41 static int handle_rpc_call(struct msm_rpc_server *server,
42                            struct rpc_request_hdr *req, unsigned len)
43 {
44         switch (req->procedure) {
45         case RPC_DOG_KEEPALIVE_NULL:
46                 return 0;
47         case RPC_DOG_KEEPALIVE_BEACON:
48                 printk(KERN_INFO "DOG KEEPALIVE PING\n");
49                 return 0;
50         default:
51                 return -ENODEV;
52         }
53 }
54
55 static struct msm_rpc_server rpc_server = {
56         .prog = DOG_KEEPALIVE_PROG,
57         .vers = DOG_KEEPALIVE_VERS,
58         .rpc_call = handle_rpc_call,
59 };
60
61 static int __init rpc_server_init(void)
62 {
63         /* Dual server registration to support backwards compatibility vers */
64         return msm_rpc_create_server(&rpc_server);
65 }
66
67
68 module_init(rpc_server_init);