Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dspapi-ioctl.h
Go to the documentation of this file.
1 /*
2  * dspapi-ioctl.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * Contains structures and commands that are used for interaction
7  * between the DDSP API and Bridge driver.
8  *
9  * Copyright (C) 2008 Texas Instruments, Inc.
10  *
11  * This package is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  *
15  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18  */
19 
20 #ifndef DSPAPIIOCTL_
21 #define DSPAPIIOCTL_
22 
23 #include <dspbridge/cmm.h>
24 #include <dspbridge/strmdefs.h>
25 #include <dspbridge/dbdcd.h>
26 
27 union trapped_args {
28 
29  /* MGR Module */
30  struct {
36 
37  struct {
43 
44  struct {
45  struct dsp_uuid *uuid_obj;
47  char *sz_path_name;
49 
50  struct {
51  struct dsp_uuid *uuid_obj;
54 
55  struct {
60  } args_mgr_wait;
61 
62  /* PROC Module */
63  struct {
68 
69  struct {
70  void *processor;
74 
75  struct {
76  void *processor;
78 
79  struct {
80  void *processor;
81  void *__user *node_tab;
86 
87  struct {
88  void *processor;
93 
94  struct {
95  void *processor;
99 
100  struct {
101  void *processor;
106 
107  struct {
108  void *processor;
112  } args_proc_load;
113 
114  struct {
115  void *processor;
120 
121  struct {
122  void *processor;
124  void *__user *rsv_addr;
126 
127  struct {
128  void *processor;
129  u32 size;
130  void *rsv_addr;
132 
133  struct {
134  void *processor;
135  void *mpu_addr;
136  u32 size;
137  void *req_addr;
138  void *__user *map_addr;
141 
142  struct {
143  void *processor;
144  u32 size;
145  void *map_addr;
147 
148  struct {
149  void *processor;
150  void *mpu_addr;
151  u32 size;
153  } args_proc_dma;
154 
155  struct {
156  void *processor;
157  void *mpu_addr;
158  u32 size;
161 
162  struct {
163  void *processor;
164  void *mpu_addr;
165  u32 size;
167 
168  /* NODE Module */
169  struct {
170  void *processor;
172  struct dsp_cbdata __user *args;
174  void *__user *node;
176 
177  struct {
178  void *node;
179  u32 size;
183 
184  struct {
185  void *node;
188 
189  struct {
190  void *node;
192  void *other_node;
197 
198  struct {
199  void *node;
201 
202  struct {
203  void *node;
205 
206  struct {
207  void *node;
208  struct dsp_bufferattr __user *attr;
211 
212  struct {
213  void *node;
217 
218  struct {
219  void *node;
221  u32 timeout;
223 
224  struct {
225  void *node;
226  } args_node_pause;
227 
228  struct {
229  void *node;
230  struct dsp_msg __user *message;
231  u32 timeout;
233 
234  struct {
235  void *node;
236  u32 event_mask;
240 
241  struct {
242  void *node;
243  } args_node_run;
244 
245  struct {
246  void *node;
249 
250  struct {
251  void *processor;
252  struct dsp_uuid __user *node_id_ptr;
253  struct dsp_ndbprops __user *node_props;
255 
256  /* STRM module */
257 
258  struct {
259  void *stream;
260  u32 size;
264 
265  struct {
266  void *stream;
267  } args_strm_close;
268 
269  struct {
270  void *stream;
271  u8 *__user *ap_buffer;
272  u32 num_bufs;
274 
275  struct {
276  void *stream;
277  void **event;
279 
280  struct {
281  void *stream;
285 
286  struct {
287  void *stream;
289  } args_strm_idle;
290 
291  struct {
292  void *stream;
293  u8 *buffer;
297  } args_strm_issue;
298 
299  struct {
300  void *node;
304  void *__user *stream;
305  } args_strm_open;
306 
307  struct {
308  void *stream;
314 
315  struct {
316  void *stream;
317  u32 event_mask;
319  struct dsp_notification __user *notification;
321 
322  struct {
326  u32 timeout;
328 
329  /* CMM Module */
330  struct {
332  u32 size;
333  struct cmm_attrs *attrs;
334  void **buf_va;
336 
337  struct {
338  struct cmm_object *cmm_mgr;
339  void *buf_pa;
342 
343  struct {
344  void *processor;
347 
348  struct {
349  struct cmm_object *cmm_mgr;
352 
353  /* UTIL module */
354  struct {
356  char **argv;
358 };
359 
360 /*
361  * Dspbridge Ioctl numbering scheme
362  *
363  * 7 0
364  * ---------------------------------
365  * | Module | Ioctl Number |
366  * ---------------------------------
367  * | x | x | x | 0 | 0 | 0 | 0 | 0 |
368  * ---------------------------------
369  */
370 
371 /* Ioctl driver identifier */
372 #define DB 0xDB
373 
374 /*
375  * Following are used to distinguish between module ioctls, this is needed
376  * in case new ioctls are introduced.
377  */
378 #define DB_MODULE_MASK 0xE0
379 #define DB_IOC_MASK 0x1F
380 
381 /* Ioctl module masks */
382 #define DB_MGR 0x0
383 #define DB_PROC 0x20
384 #define DB_NODE 0x40
385 #define DB_STRM 0x60
386 #define DB_CMM 0x80
387 
388 #define DB_MODULE_SHIFT 5
389 
390 /* Used to calculate the ioctl per dspbridge module */
391 #define DB_IOC(module, num) \
392  (((module) & DB_MODULE_MASK) | ((num) & DB_IOC_MASK))
393 /* Used to get dspbridge ioctl module */
394 #define DB_GET_MODULE(cmd) ((cmd) & DB_MODULE_MASK)
395 /* Used to get dspbridge ioctl number */
396 #define DB_GET_IOC(cmd) ((cmd) & DB_IOC_MASK)
397 
398 /* TODO: Remove deprecated and not implemented */
399 
400 /* MGR Module */
401 #define MGR_ENUMNODE_INFO _IOWR(DB, DB_IOC(DB_MGR, 0), unsigned long)
402 #define MGR_ENUMPROC_INFO _IOWR(DB, DB_IOC(DB_MGR, 1), unsigned long)
403 #define MGR_REGISTEROBJECT _IOWR(DB, DB_IOC(DB_MGR, 2), unsigned long)
404 #define MGR_UNREGISTEROBJECT _IOWR(DB, DB_IOC(DB_MGR, 3), unsigned long)
405 #define MGR_WAIT _IOWR(DB, DB_IOC(DB_MGR, 4), unsigned long)
406 /* MGR_GET_PROC_RES Deprecated */
407 #define MGR_GET_PROC_RES _IOR(DB, DB_IOC(DB_MGR, 5), unsigned long)
408 
409 /* PROC Module */
410 #define PROC_ATTACH _IOWR(DB, DB_IOC(DB_PROC, 0), unsigned long)
411 #define PROC_CTRL _IOR(DB, DB_IOC(DB_PROC, 1), unsigned long)
412 /* PROC_DETACH Deprecated */
413 #define PROC_DETACH _IOR(DB, DB_IOC(DB_PROC, 2), unsigned long)
414 #define PROC_ENUMNODE _IOWR(DB, DB_IOC(DB_PROC, 3), unsigned long)
415 #define PROC_ENUMRESOURCES _IOWR(DB, DB_IOC(DB_PROC, 4), unsigned long)
416 #define PROC_GET_STATE _IOWR(DB, DB_IOC(DB_PROC, 5), unsigned long)
417 #define PROC_GET_TRACE _IOWR(DB, DB_IOC(DB_PROC, 6), unsigned long)
418 #define PROC_LOAD _IOW(DB, DB_IOC(DB_PROC, 7), unsigned long)
419 #define PROC_REGISTERNOTIFY _IOWR(DB, DB_IOC(DB_PROC, 8), unsigned long)
420 #define PROC_START _IOW(DB, DB_IOC(DB_PROC, 9), unsigned long)
421 #define PROC_RSVMEM _IOWR(DB, DB_IOC(DB_PROC, 10), unsigned long)
422 #define PROC_UNRSVMEM _IOW(DB, DB_IOC(DB_PROC, 11), unsigned long)
423 #define PROC_MAPMEM _IOWR(DB, DB_IOC(DB_PROC, 12), unsigned long)
424 #define PROC_UNMAPMEM _IOR(DB, DB_IOC(DB_PROC, 13), unsigned long)
425 #define PROC_FLUSHMEMORY _IOW(DB, DB_IOC(DB_PROC, 14), unsigned long)
426 #define PROC_STOP _IOWR(DB, DB_IOC(DB_PROC, 15), unsigned long)
427 #define PROC_INVALIDATEMEMORY _IOW(DB, DB_IOC(DB_PROC, 16), unsigned long)
428 #define PROC_BEGINDMA _IOW(DB, DB_IOC(DB_PROC, 17), unsigned long)
429 #define PROC_ENDDMA _IOW(DB, DB_IOC(DB_PROC, 18), unsigned long)
430 
431 /* NODE Module */
432 #define NODE_ALLOCATE _IOWR(DB, DB_IOC(DB_NODE, 0), unsigned long)
433 #define NODE_ALLOCMSGBUF _IOWR(DB, DB_IOC(DB_NODE, 1), unsigned long)
434 #define NODE_CHANGEPRIORITY _IOW(DB, DB_IOC(DB_NODE, 2), unsigned long)
435 #define NODE_CONNECT _IOW(DB, DB_IOC(DB_NODE, 3), unsigned long)
436 #define NODE_CREATE _IOW(DB, DB_IOC(DB_NODE, 4), unsigned long)
437 #define NODE_DELETE _IOW(DB, DB_IOC(DB_NODE, 5), unsigned long)
438 #define NODE_FREEMSGBUF _IOW(DB, DB_IOC(DB_NODE, 6), unsigned long)
439 #define NODE_GETATTR _IOWR(DB, DB_IOC(DB_NODE, 7), unsigned long)
440 #define NODE_GETMESSAGE _IOWR(DB, DB_IOC(DB_NODE, 8), unsigned long)
441 #define NODE_PAUSE _IOW(DB, DB_IOC(DB_NODE, 9), unsigned long)
442 #define NODE_PUTMESSAGE _IOW(DB, DB_IOC(DB_NODE, 10), unsigned long)
443 #define NODE_REGISTERNOTIFY _IOWR(DB, DB_IOC(DB_NODE, 11), unsigned long)
444 #define NODE_RUN _IOW(DB, DB_IOC(DB_NODE, 12), unsigned long)
445 #define NODE_TERMINATE _IOWR(DB, DB_IOC(DB_NODE, 13), unsigned long)
446 #define NODE_GETUUIDPROPS _IOWR(DB, DB_IOC(DB_NODE, 14), unsigned long)
447 
448 /* STRM Module */
449 #define STRM_ALLOCATEBUFFER _IOWR(DB, DB_IOC(DB_STRM, 0), unsigned long)
450 #define STRM_CLOSE _IOW(DB, DB_IOC(DB_STRM, 1), unsigned long)
451 #define STRM_FREEBUFFER _IOWR(DB, DB_IOC(DB_STRM, 2), unsigned long)
452 #define STRM_GETEVENTHANDLE _IO(DB, DB_IOC(DB_STRM, 3)) /* Not Impl'd */
453 #define STRM_GETINFO _IOWR(DB, DB_IOC(DB_STRM, 4), unsigned long)
454 #define STRM_IDLE _IOW(DB, DB_IOC(DB_STRM, 5), unsigned long)
455 #define STRM_ISSUE _IOW(DB, DB_IOC(DB_STRM, 6), unsigned long)
456 #define STRM_OPEN _IOWR(DB, DB_IOC(DB_STRM, 7), unsigned long)
457 #define STRM_RECLAIM _IOWR(DB, DB_IOC(DB_STRM, 8), unsigned long)
458 #define STRM_REGISTERNOTIFY _IOWR(DB, DB_IOC(DB_STRM, 9), unsigned long)
459 #define STRM_SELECT _IOWR(DB, DB_IOC(DB_STRM, 10), unsigned long)
460 
461 /* CMM Module */
462 #define CMM_ALLOCBUF _IO(DB, DB_IOC(DB_CMM, 0)) /* Not Impl'd */
463 #define CMM_FREEBUF _IO(DB, DB_IOC(DB_CMM, 1)) /* Not Impl'd */
464 #define CMM_GETHANDLE _IOR(DB, DB_IOC(DB_CMM, 2), unsigned long)
465 #define CMM_GETINFO _IOR(DB, DB_IOC(DB_CMM, 3), unsigned long)
466 
467 #endif /* DSPAPIIOCTL_ */