2 * Copyright (C) 2010 Google, Inc.
5 * Dima Zavin <dima@android.com>
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.
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.
18 #ifndef __ARM_MACH_TEGRA_RPC_H
19 #define __ARM_MACH_TEGRA_RPC_H
21 #include <linux/list.h>
22 #include <linux/seq_file.h>
23 #include <linux/tegra_rpc.h>
27 /* send is allowed to sleep */
28 int (*send)(struct trpc_endpoint *ep, void *buf, size_t len);
29 /* notify_recv is NOT allowed to sleep */
30 void (*notify_recv)(struct trpc_endpoint *ep);
31 /* close is allowed to sleep */
32 void (*close)(struct trpc_endpoint *ep);
33 /* not allowed to sleep, not allowed to call back into trpc */
34 void (*show)(struct seq_file *s, struct trpc_endpoint *ep);
43 struct list_head list;
48 int (*try_connect)(struct trpc_node *node,
49 struct trpc_node *src,
50 struct trpc_endpoint *from);
53 struct trpc_endpoint *trpc_peer(struct trpc_endpoint *ep);
54 void *trpc_priv(struct trpc_endpoint *ep);
55 const char *trpc_name(struct trpc_endpoint *ep);
57 void trpc_put(struct trpc_endpoint *ep);
58 void trpc_get(struct trpc_endpoint *ep);
60 int trpc_send_msg(struct trpc_node *src, struct trpc_endpoint *ep, void *buf,
61 size_t len, gfp_t gfp_flags);
62 int trpc_recv_msg(struct trpc_node *src, struct trpc_endpoint *ep,
63 void *buf, size_t len, long timeout);
64 struct trpc_endpoint *trpc_create(struct trpc_node *owner, const char *name,
65 struct trpc_ep_ops *ops, void *priv);
66 struct trpc_endpoint *trpc_create_connect(struct trpc_node *src, char *name,
67 struct trpc_ep_ops *ops, void *priv,
69 int trpc_connect(struct trpc_endpoint *from, long timeout);
70 struct trpc_endpoint *trpc_create_peer(struct trpc_node *owner,
71 struct trpc_endpoint *ep,
72 struct trpc_ep_ops *ops,
74 void trpc_close(struct trpc_endpoint *ep);
75 int trpc_wait_peer(struct trpc_endpoint *ep, long timeout);
77 int trpc_node_register(struct trpc_node *node);
78 void trpc_node_unregister(struct trpc_node *node);