blob: 16e6367cf56992e08af8e37c2bc0c3b9e236fd68 [file] [log] [blame]
Dima Zavin9d020ec2010-11-04 15:57:07 -07001/*
2 * Copyright (C) 2010 Google, Inc.
3 *
4 * Author:
5 * Dima Zavin <dima@android.com>
6 *
7 * Based on original code from NVIDIA, and a partial rewrite by:
8 * Gary King <gking@nvidia.com>
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 */
20
21#ifndef __LINUX_TEGRA_RPC_H
22#define __LINUX_TEGRA_RPC_H
23
24#define TEGRA_RPC_MAX_MSG_LEN 256
25
26/* Note: the actual size of the name in the protocol message is 16 bytes,
27 * but that is because the name there is not NUL terminated, only NUL
28 * padded. */
29#define TEGRA_RPC_MAX_NAME_LEN 17
30
31struct tegra_rpc_port_desc {
32 char name[TEGRA_RPC_MAX_NAME_LEN];
33 int notify_fd; /* fd representing a trpc_sema to signal when a
34 * message has been received */
35};
36
37#define TEGRA_RPC_IOCTL_MAGIC 'r'
38
39#define TEGRA_RPC_IOCTL_PORT_CREATE _IOW(TEGRA_RPC_IOCTL_MAGIC, 0x20, struct tegra_rpc_port_desc)
40#define TEGRA_RPC_IOCTL_PORT_GET_NAME _IOR(TEGRA_RPC_IOCTL_MAGIC, 0x21, char *)
41#define TEGRA_RPC_IOCTL_PORT_CONNECT _IOR(TEGRA_RPC_IOCTL_MAGIC, 0x22, long)
42#define TEGRA_RPC_IOCTL_PORT_LISTEN _IOR(TEGRA_RPC_IOCTL_MAGIC, 0x23, long)
43
44#define TEGRA_RPC_IOCTL_MIN_NR _IOC_NR(TEGRA_RPC_IOCTL_PORT_CREATE)
45#define TEGRA_RPC_IOCTL_MAX_NR _IOC_NR(TEGRA_RPC_IOCTL_PORT_LISTEN)
46
47#endif