1 /* arch/arm/mach-msm/rpc_server_time_remote.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 /* time_remote_mtoa server definitions. */
23 #define TIME_REMOTE_MTOA_PROG 0x3000005d
24 #if CONFIG_MSM_AMSS_VERSION==6210
25 #define TIME_REMOTE_MTOA_VERS 0
26 #elif (CONFIG_MSM_AMSS_VERSION==6220) || (CONFIG_MSM_AMSS_VERSION==6225)
27 #define TIME_REMOTE_MTOA_VERS 0x9202a8e4
28 #elif CONFIG_MSM_AMSS_VERSION==6350
29 #define TIME_REMOTE_MTOA_VERS 0x00010000
31 #error "Unknown AMSS version"
33 #define RPC_TIME_REMOTE_MTOA_NULL 0
34 #define RPC_TIME_TOD_SET_APPS_BASES 2
36 struct rpc_time_tod_set_apps_bases_args {
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_TIME_REMOTE_MTOA_NULL:
48 case RPC_TIME_TOD_SET_APPS_BASES: {
49 struct rpc_time_tod_set_apps_bases_args *args;
50 args = (struct rpc_time_tod_set_apps_bases_args *)(req + 1);
51 args->tick = be32_to_cpu(args->tick);
52 args->stamp = be64_to_cpu(args->stamp);
53 printk(KERN_INFO "RPC_TIME_TOD_SET_APPS_BASES:\n"
56 args->tick, args->stamp);
64 static struct msm_rpc_server rpc_server = {
65 .prog = TIME_REMOTE_MTOA_PROG,
66 .vers = TIME_REMOTE_MTOA_VERS,
67 .rpc_call = handle_rpc_call,
70 static int __init rpc_server_init(void)
72 /* Dual server registration to support backwards compatibility vers */
73 return msm_rpc_create_server(&rpc_server);
77 module_init(rpc_server_init);