summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/nv/include/mach/nvrpc.h
blob: 594e1f5d4e940e35f26c2710d4015b7b25ba204c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * arch/arm/mach-tegra/include/linux/nvrpc_ioctl.h
 *
 * structure declarations for nvrpc user-space ioctls
 *
 * Copyright (c) 2009-2010, NVIDIA Corporation.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <linux/ioctl.h>
#include <linux/types.h>

#if !defined(__KERNEL__)
#define __user
#endif

#ifndef _MACH_TEGRA_NVRPC_IOCTL_H_
#define _MACH_TEGRA_NVRPC_IOCTL_H_

struct nvrpc_handle_param {
	__u32 handle;
	__u32 param;
	__u32 ret_val;              /* operation status */
};

struct nvrpc_open_params {
	__u32 rm_handle;            /* rm device handle */
	__u32 port_name_size;       /* port name buffer size */
	__u32 sem;                  /* receive semaphore handle */
	__u32 transport_handle;     /* transport handle */
	__u32 ret_val;              /* operation status */
	unsigned long port_name;    /* port name */
};

struct nvrpc_set_queue_depth_params {
	__u32 transport_handle;     /* transport handle */
	__u32 max_queue_depth;      /* maximum number of message in Queue */
	__u32 max_message_size;     /* maximum size of the message in bytes */
	__u32 ret_val;              /* operation status */
};

struct nvrpc_msg_params {
	__u32 transport_handle;     /* transport handle */
	__u32 max_message_size;     /* maximum size of the message in bytes */
	__u32 params;               /* timeout in ms */
	__u32 ret_val;              /* operation status */
	unsigned long msg_buffer;
};

#define NVRPC_IOC_MAGIC 'N'

#define NVRPC_IOCTL_INIT                    \
	_IOWR(NVRPC_IOC_MAGIC, 0x30, struct nvrpc_handle_param)
#define NVRPC_IOCTL_OPEN                    \
	_IOWR(NVRPC_IOC_MAGIC, 0x31, struct nvrpc_open_params)
#define NVRPC_IOCTL_GET_PORTNAME            \
	_IOWR(NVRPC_IOC_MAGIC, 0x32, struct nvrpc_open_params)
#define NVRPC_IOCTL_CLOSE                   \
	_IOWR(NVRPC_IOC_MAGIC, 0x33, struct nvrpc_handle_param)
#define NVRPC_IOCTL_DEINIT                   \
	_IOWR(NVRPC_IOC_MAGIC, 0x34, struct nvrpc_handle_param)
#define NVRPC_IOCTL_WAIT_FOR_CONNECT        \
	_IOWR(NVRPC_IOC_MAGIC, 0x35, struct nvrpc_handle_param)
#define NVRPC_IOCTL_CONNECT                 \
	_IOWR(NVRPC_IOC_MAGIC, 0x36, struct nvrpc_handle_param)
#define NVRPC_IOCTL_SET_QUEUE_DEPTH         \
	_IOWR(NVRPC_IOC_MAGIC, 0x37, struct nvrpc_set_queue_depth_params)
#define NVRPC_IOCTL_SEND_MSG                \
	_IOWR(NVRPC_IOC_MAGIC, 0x38, struct nvrpc_msg_params)
#define NVRPC_IOCTL_SEND_MSG_LP0            \
	_IOWR(NVRPC_IOC_MAGIC, 0x39, struct nvrpc_msg_params)
#define NVRPC_IOCTL_RECV_MSG           \
	_IOWR(NVRPC_IOC_MAGIC, 0x3A, struct nvrpc_msg_params)
#define NVRPC_IOCTL_XPC_INIT                \
	_IOWR(NVRPC_IOC_MAGIC, 0x3B, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_ACQUIRE             \
	_IOWR(NVRPC_IOC_MAGIC, 0x3C, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_RELEASE             \
	_IOWR(NVRPC_IOC_MAGIC, 0x3D, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_GET_MSG             \
	_IOWR(NVRPC_IOC_MAGIC, 0x3E, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_SEND_MSG            \
	_IOWR(NVRPC_IOC_MAGIC, 0x3F, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_DESTROY             \
	_IOWR(NVRPC_IOC_MAGIC, 0x40, struct nvrpc_handle_param)
#define NVRPC_IOCTL_XPC_CREATE              \
	_IOWR(NVRPC_IOC_MAGIC, 0x41, struct nvrpc_handle_param)

#endif