summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/messageq_ioctl.h
blob: cbb0087fc0b0277d0a71809a0bc9a0f2b05a8036 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
/*
 *  messageq_ioctl.h
 *
 *  Definitions of messageq driver types and structures.
 *
 *  Copyright (C) 2008-2009 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#ifndef _MESSAGEQ_IOCTL_H_
#define _MESSAGEQ_IOCTL_H_

/* Standard headers */
#include <linux/types.h>

/* Syslink headers */
#include <ipc_ioctl.h>
#include <messageq.h>
#include <heap.h>
#include <sharedregion.h>

/* =============================================================================
 *  Macros and types
 * =============================================================================
 */
#define MESSAGEQ_IOC_MAGIC		IPC_IOC_MAGIC
enum messageq_drv_cmd {
	MESSAGEQ_GETCONFIG = MESSAGEQ_BASE_CMD,
	MESSAGEQ_SETUP,
	MESSAGEQ_DESTROY,
	MESSAGEQ_PARAMS_INIT,
	MESSAGEQ_CREATE,
	MESSAGEQ_DELETE,
	MESSAGEQ_OPEN,
	MESSAGEQ_CLOSE,
	MESSAGEQ_COUNT,
	MESSAGEQ_ALLOC,
	MESSAGEQ_FREE,
	MESSAGEQ_PUT,
	MESSAGEQ_REGISTERHEAP,
	MESSAGEQ_UNREGISTERHEAP,
	MESSAGEQ_ATTACH,
	MESSAGEQ_DETACH,
	MESSAGEQ_GET,
	MESSAGEQ_SHAREDMEMREQ,
	MESSAGEQ_UNBLOCK
};

/*  ----------------------------------------------------------------------------
 *  IOCTL command IDs for messageq
 *  ----------------------------------------------------------------------------
 */
/* Base command ID for messageq */
#define MESSAGEQ_BASE_CMD			0x0

/* Command for messageq_get_config */
#define CMD_MESSAGEQ_GETCONFIG \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_GETCONFIG, \
			struct messageq_cmd_args)

/* Command for messageq_setup */
#define CMD_MESSAGEQ_SETUP \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_SETUP, \
			struct messageq_cmd_args)

/* Command for messageq_destroy */
#define CMD_MESSAGEQ_DESTROY \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_DESTROY, \
			struct messageq_cmd_args)

/* Command for messageq_params_init */
#define CMD_MESSAGEQ_PARAMS_INIT \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_PARAMS_INIT, \
			struct messageq_cmd_args)

/* Command for messageq_create */
#define CMD_MESSAGEQ_CREATE \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_CREATE, \
			struct messageq_cmd_args)

/* Command for messageq_delete */
#define CMD_MESSAGEQ_DELETE \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_DELETE, \
			struct messageq_cmd_args)

/* Command for messageq_open */
#define CMD_MESSAGEQ_OPEN \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_OPEN, \
			struct messageq_cmd_args)

/* Command for messageq_close */
#define CMD_MESSAGEQ_CLOSE \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_CLOSE, \
			struct messageq_cmd_args)

/* Command for messageq_count */
#define CMD_MESSAGEQ_COUNT \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_COUNT, \
			struct messageq_cmd_args)

/* Command for messageq_alloc */
#define CMD_MESSAGEQ_ALLOC \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_ALLOC, \
			struct messageq_cmd_args)

/* Command for messageq_free */
#define CMD_MESSAGEQ_FREE \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_FREE, \
			struct messageq_cmd_args)

/* Command for messageq_put */
#define CMD_MESSAGEQ_PUT \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_PUT, \
			struct messageq_cmd_args)

/* Command for messageq_unblock */
#define CMD_MESSAGEQ_UNBLOCK \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_UNBLOCK, \
			struct messageq_cmd_args)

/* Command for messageq_register_heap */
#define CMD_MESSAGEQ_REGISTERHEAP \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_REGISTERHEAP, \
			struct messageq_cmd_args)

/* Command for messageq_unregister_heap */
#define CMD_MESSAGEQ_UNREGISTERHEAP \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_UNREGISTERHEAP, \
			struct messageq_cmd_args)


/* Command for messageq_attach */
#define CMD_MESSAGEQ_ATTACH \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_ATTACH, \
			struct messageq_cmd_args)

/* Command for messageq_detach */
#define CMD_MESSAGEQ_DETACH \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_DETACH, \
			struct messageq_cmd_args)

/* Command for messageq_get */
#define CMD_MESSAGEQ_GET \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_GET, \
			struct messageq_cmd_args)

/* Command for messageq_sharedmem_req */
#define CMD_MESSAGEQ_SHAREDMEMREQ \
			_IOWR(MESSAGEQ_IOC_MAGIC, MESSAGEQ_SHAREDMEMREQ, \
			struct messageq_cmd_args)

/* Command arguments for messageq */
struct messageq_cmd_args {
	union {
		struct {
			void *messageq_handle;
			struct messageq_params *params;
		} params_init;

		struct {
			struct messageq_config *config;
		} get_config;

		struct {
			struct messageq_config *config;
		} setup;

		struct {
			void *messageq_handle;
			char *name;
			struct messageq_params *params;
			u32 name_len;
			u32 queue_id;
		} create;

		struct {
			void *messageq_handle;
		} delete_messageq;

		struct {
			char *name;
			u32 queue_id;
			u32 name_len;
		} open;

		struct {
			u32 queue_id;
		} close;

		struct {
			void *messageq_handle;
			u32 timeout;
			u32 *msg_srptr;
		} get;

		struct {
			void *messageq_handle;
			int count;
		} count;

		struct {
			u16 heap_id;
			u32 size;
			u32 *msg_srptr;
		} alloc;

		struct {
			u32 *msg_srptr;
		} free;

		struct {
			u32 queue_id;
			u32 *msg_srptr;
		} put;

		struct {
			void *heap_handle;
			u16 heap_id;
		} register_heap;

		struct {
			u16 heap_id;
		} unregister_heap;

		struct {
			u32 *shared_addr_srptr;
			uint mem_req;
		} shared_mem_req;

		struct {
			u16 remote_proc_id;
			u32 *shared_addr_srptr;
		} attach;

		struct {
			u16 remote_proc_id;
		} detach;

		struct {
			void *messageq_handle;
		} unblock;

	} args;

	int api_status;
};

/*  ----------------------------------------------------------------------------
 *  IOCTL functions for messageq module
 *  ----------------------------------------------------------------------------
 */
/*
 *  ioctl interface function for messageq
 */
int messageq_ioctl(struct inode *inode, struct file *filp,
			unsigned int cmd, unsigned long args, bool user);

#endif /* _MESSAGEQ_IOCTL_H_ */