blob: 24b3b33f26dcdbc77d115120cbdec1af0e95d4c2 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* arch/arm/mach-msm/rpc_server_dog_keepalive.c
2 *
3 * Copyright (C) 2007 Google, Inc.
Duy Truong790f06d2013-02-13 16:38:12 -08004 * Copyright (c) 2009, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07005 * Author: Iliyan Malchev <ibm@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/module.h>
19#include <linux/kernel.h>
20#include <mach/msm_rpcrouter.h>
21
22/* dog_keepalive server definitions */
23
24#define DOG_KEEPALIVE_PROG 0x30000015
25#if CONFIG_MSM_AMSS_VERSION==6210
26#define DOG_KEEPALIVE_VERS 0
27#define RPC_DOG_KEEPALIVE_BEACON 1
28#elif (CONFIG_MSM_AMSS_VERSION==6220) || (CONFIG_MSM_AMSS_VERSION==6225)
29#define DOG_KEEPALIVE_VERS 0x731fa727
30#define RPC_DOG_KEEPALIVE_BEACON 2
31#else
32#error "Unsupported AMSS version"
33#endif
34#define DOG_KEEPALIVE_VERS_COMP 0x00010001
35#define RPC_DOG_KEEPALIVE_NULL 0
36
37
38/* TODO: Remove server registration with _VERS when modem is upated with _COMP*/
39
40static int handle_rpc_call(struct msm_rpc_server *server,
41 struct rpc_request_hdr *req, unsigned len)
42{
43 switch (req->procedure) {
44 case RPC_DOG_KEEPALIVE_NULL:
45 return 0;
46 case RPC_DOG_KEEPALIVE_BEACON:
47 return 0;
48 default:
49 return -ENODEV;
50 }
51}
52
53static struct msm_rpc_server rpc_server[] = {
54 {
55 .prog = DOG_KEEPALIVE_PROG,
56 .vers = DOG_KEEPALIVE_VERS,
57 .rpc_call = handle_rpc_call,
58 },
59 {
60 .prog = DOG_KEEPALIVE_PROG,
61 .vers = DOG_KEEPALIVE_VERS_COMP,
62 .rpc_call = handle_rpc_call,
63 },
64};
65
66static int __init rpc_server_init(void)
67{
68 /* Dual server registration to support backwards compatibility vers */
69 int ret;
70 ret = msm_rpc_create_server(&rpc_server[1]);
71 if (ret < 0)
72 return ret;
73 return msm_rpc_create_server(&rpc_server[0]);
74}
75
76
77module_init(rpc_server_init);