summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/listmp_ioctl.h
blob: e4fba2409bc3f267d5bfa34385e404487e66bd8b (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
267
268
/*
 *  listmp_ioctl.h
 *
 *  Definitions of listmp 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 _LISTMP_IOCTL_H_
#define _LISTMP_IOCTL_H_

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

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

/* =============================================================================
 *  Macros and types
 * =============================================================================
 */
/* Base command ID for listmp */
#define LISTMP_IOC_MAGIC		IPC_IOC_MAGIC
enum listmp_drv_cmd {
	LISTMP_GETCONFIG = LISTMP_BASE_CMD,
	LISTMP_SETUP,
	LISTMP_DESTROY,
	LISTMP_PARAMS_INIT,
	LISTMP_CREATE,
	LISTMP_DELETE,
	LISTMP_OPEN,
	LISTMP_CLOSE,
	LISTMP_ISEMPTY,
	LISTMP_GETHEAD,
	LISTMP_GETTAIL,
	LISTMP_PUTHEAD,
	LISTMP_PUTTAIL,
	LISTMP_INSERT,
	LISTMP_REMOVE,
	LISTMP_NEXT,
	LISTMP_PREV,
	LISTMP_SHAREDMEMREQ,
	LISTMP_OPENBYADDR
};

/*  ----------------------------------------------------------------------------
 *  IOCTL command IDs for listmp
 *  ----------------------------------------------------------------------------
 */
/* Command for listmp_get_config */
#define CMD_LISTMP_GETCONFIG		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_GETCONFIG,		\
					struct listmp_cmd_args)

/* Command for listmp_setup */
#define CMD_LISTMP_SETUP		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_SETUP,			\
					struct listmp_cmd_args)

/* Command for listmp_destroy */
#define CMD_LISTMP_DESTROY		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_DESTROY,			\
					struct listmp_cmd_args)

/* Command for listmp_params_init */
#define CMD_LISTMP_PARAMS_INIT		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_PARAMS_INIT,		\
					struct listmp_cmd_args)

/* Command for listmp_create */
#define CMD_LISTMP_CREATE		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_CREATE,			\
					struct listmp_cmd_args)

/* Command for listmp_delete */
#define CMD_LISTMP_DELETE		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_DELETE,			\
					struct listmp_cmd_args)

/* Command for listmp_open */
#define CMD_LISTMP_OPEN			_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_OPEN,			\
					struct listmp_cmd_args)

/* Command for listmp_close */
#define CMD_LISTMP_CLOSE		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_CLOSE,			\
					struct listmp_cmd_args)

/* Command for listmp_is_empty */
#define CMD_LISTMP_ISEMPTY		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_ISEMPTY,			\
					struct listmp_cmd_args)

/* Command for listmp_get_head */
#define CMD_LISTMP_GETHEAD		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_GETHEAD,			\
					struct listmp_cmd_args)

/* Command for listmp_get_tail */
#define CMD_LISTMP_GETTAIL		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_GETTAIL,			\
					struct listmp_cmd_args)

/* Command for listmp_put_head */
#define CMD_LISTMP_PUTHEAD		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_PUTHEAD,			\
					struct listmp_cmd_args)

/* Command for listmp_put_tail */
#define CMD_LISTMP_PUTTAIL		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_PUTTAIL,			\
					struct listmp_cmd_args)

/* Command for listmp_insert */
#define CMD_LISTMP_INSERT		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_INSERT,			\
					struct listmp_cmd_args)

/* Command for listmp_remove */
#define CMD_LISTMP_REMOVE		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_REMOVE,			\
					struct listmp_cmd_args)

/* Command for listmp_next */
#define CMD_LISTMP_NEXT			_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_NEXT,			\
					struct listmp_cmd_args)

/* Command for listmp_prev */
#define CMD_LISTMP_PREV			_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_PREV,			\
					struct listmp_cmd_args)

/* Command for listmp_shared_mem_req */
#define CMD_LISTMP_SHAREDMEMREQ		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_SHAREDMEMREQ,		\
					struct listmp_cmd_args)

/* Command for listmp_open_by_addr */
#define CMD_LISTMP_OPENBYADDR		_IOWR(LISTMP_IOC_MAGIC,		\
					LISTMP_OPENBYADDR,		\
					struct listmp_cmd_args)

/* Command arguments for listmp */
struct listmp_cmd_args {
	union {
		struct {
			struct listmp_params *params;
		} params_init;

		struct {
			struct listmp_config *config;
		} get_config;

		struct {
			struct listmp_config *config;
		} setup;

		struct {
			void *listmp_handle;
			struct listmp_params *params;
			u32 name_len;
			u32 shared_addr_srptr;
			void *knl_gate;
		} create;

		struct {
			void *listmp_handle;
		} delete_instance;

		struct {
			void *listmp_handle;
			u32 name_len;
			char *name;
		} open;

		struct {
			void *listmp_handle;
			u32 shared_addr_srptr;
		} open_by_addr;


		struct {
			void *listmp_handle;
		} close;

		struct {
			void *listmp_handle;
			bool is_empty;
		} is_empty;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
		} get_head;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
		} get_tail;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
		} put_head;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
		} put_tail;

		struct {
			void *listmp_handle;
			u32 *new_elem_srptr;
			u32 *cur_elem_srptr;
		} insert;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
		} remove;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
			u32 *next_elem_srptr;
		} next;

		struct {
			void *listmp_handle;
			u32 *elem_srptr;
			u32 *prev_elem_srptr;
		} prev;

		struct {
			struct listmp_params *params;
			u32 bytes;
			void *knl_gate;
			u32 *shared_addr_srptr;
			u32 name_len;
			void *listmp_handle;
		} shared_mem_req;
	} args;

	int api_status;
};

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

#endif /* _LISTMP_IOCTL_H_ */