summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/listmp_sharedmemory_ioctl.h
blob: 42fc4d6edd2472a996415c5e9028295e9c67ffab (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
/*
 *  listmp_sharedmemory_ioctl.h
 *
 *  Definitions of listmp_sharedmemory 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_SHAREDMEMORY_IOCTL_H_
#define _LISTMP_SHAREDMEMORY_IOCTL_H_

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

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

/* =============================================================================
 *  Macros and types
 * =============================================================================
 */
/* Base command ID for listmp_sharedmemory */
#define LISTMP_SHAREDMEMORY_IOC_MAGIC		IPC_IOC_MAGIC
enum listmp_sharedmemory_drv_cmd {
	LISTMP_SHAREDMEMORY_GETCONFIG = LISTMP_SHAREDMEMORY_BASE_CMD,
	LISTMP_SHAREDMEMORY_SETUP,
	LISTMP_SHAREDMEMORY_DESTROY,
	LISTMP_SHAREDMEMORY_PARAMS_INIT,
	LISTMP_SHAREDMEMORY_CREATE,
	LISTMP_SHAREDMEMORY_DELETE,
	LISTMP_SHAREDMEMORY_OPEN,
	LISTMP_SHAREDMEMORY_CLOSE,
	LISTMP_SHAREDMEMORY_ISEMPTY,
	LISTMP_SHAREDMEMORY_GETHEAD,
	LISTMP_SHAREDMEMORY_GETTAIL,
	LISTMP_SHAREDMEMORY_PUTHEAD,
	LISTMP_SHAREDMEMORY_PUTTAIL,
	LISTMP_SHAREDMEMORY_INSERT,
	LISTMP_SHAREDMEMORY_REMOVE,
	LISTMP_SHAREDMEMORY_NEXT,
	LISTMP_SHAREDMEMORY_PREV,
	LISTMP_SHAREDMEMORY_SHAREDMEMREQ
};

/*  ----------------------------------------------------------------------------
 *  IOCTL command IDs for listmp_sharedmemory
 *  ----------------------------------------------------------------------------
 */
/* Command for listmp_sharedmemory_get_config */
#define CMD_LISTMP_SHAREDMEMORY_GETCONFIG \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_GETCONFIG, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_setup */
#define CMD_LISTMP_SHAREDMEMORY_SETUP \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_SETUP, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_destroy */
#define CMD_LISTMP_SHAREDMEMORY_DESTROY \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_DESTROY, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_params_init */
#define CMD_LISTMP_SHAREDMEMORY_PARAMS_INIT \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_PARAMS_INIT, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_create */
#define CMD_LISTMP_SHAREDMEMORY_CREATE \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_CREATE, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_delete */
#define CMD_LISTMP_SHAREDMEMORY_DELETE \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_DELETE, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_open */
#define CMD_LISTMP_SHAREDMEMORY_OPEN \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_OPEN, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_close */
#define CMD_LISTMP_SHAREDMEMORY_CLOSE \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_CLOSE, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_is_empty */
#define CMD_LISTMP_SHAREDMEMORY_ISEMPTY \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_ISEMPTY, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_get_head */
#define CMD_LISTMP_SHAREDMEMORY_GETHEAD \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_GETHEAD, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_get_tail */
#define CMD_LISTMP_SHAREDMEMORY_GETTAIL \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_GETTAIL, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_put_head */
#define CMD_LISTMP_SHAREDMEMORY_PUTHEAD \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_PUTHEAD, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_put_tail */
#define CMD_LISTMP_SHAREDMEMORY_PUTTAIL \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_PUTTAIL, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_insert */
#define CMD_LISTMP_SHAREDMEMORY_INSERT \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_INSERT, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_remove */
#define CMD_LISTMP_SHAREDMEMORY_REMOVE \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_REMOVE, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_next */
#define CMD_LISTMP_SHAREDMEMORY_NEXT \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_NEXT, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_prev */
#define CMD_LISTMP_SHAREDMEMORY_PREV \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_PREV, \
	struct listmp_sharedmemory_cmd_args)

/* Command for listmp_sharedmemory_shared_memreq */
#define CMD_LISTMP_SHAREDMEMORY_SHAREDMEMREQ \
	_IOWR(LISTMP_SHAREDMEMORY_IOC_MAGIC, LISTMP_SHAREDMEMORY_SHAREDMEMREQ, \
	struct listmp_sharedmemory_cmd_args)

/* Command arguments for listmp_sharedmemory */
struct listmp_sharedmemory_cmd_args {
	union {
		struct {
			void *listmp_handle;
			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_listmp;

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

		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 {
			void *listmp_handle;
			struct listmp_params *params;
			u32 bytes;
		} shared_memreq;
	} args;

	int api_status;
};

/*  ----------------------------------------------------------------------------
 *  IOCTL functions for listmp_sharedmemory module
 *  ----------------------------------------------------------------------------
 */
/*
 *  ioctl interface function for listmp_sharedmemory
 */
int listmp_sharedmemory_ioctl(struct inode *inode, struct file *filp,
				unsigned int cmd, unsigned long args);

#endif /* _LISTMP_SHAREDMEMORY_IOCTL_H_ */