4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * System-wide channel objects and constants.
8 * Copyright (C) 2005-2006 Texas Instruments, Inc.
10 * This package is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 /* Channel id option. */
23 #define CHNL_PICKFREE (~0UL) /* Let manager pick a free channel. */
25 /* Channel manager limits: */
26 #define CHNL_INITIOREQS 4 /* Default # of I/O requests. */
29 #define CHNL_MODETODSP 0 /* Data streaming to the DSP. */
30 #define CHNL_MODEFROMDSP 1 /* Data streaming from the DSP. */
32 /* GetIOCompletion flags */
33 #define CHNL_IOCINFINITE 0xffffffff /* Wait forever for IO completion. */
34 #define CHNL_IOCNOWAIT 0x0 /* Dequeue an IOC, if available. */
36 /* IO Completion Record status: */
37 #define CHNL_IOCSTATCOMPLETE 0x0000 /* IO Completed. */
38 #define CHNL_IOCSTATCANCEL 0x0002 /* IO was cancelled */
39 #define CHNL_IOCSTATTIMEOUT 0x0008 /* Wait for IOC timed out. */
40 #define CHNL_IOCSTATEOS 0x8000 /* End Of Stream reached. */
42 /* Macros for checking I/O Completion status: */
43 #define CHNL_IS_IO_COMPLETE(ioc) (!(ioc.status & ~CHNL_IOCSTATEOS))
44 #define CHNL_IS_IO_CANCELLED(ioc) (ioc.status & CHNL_IOCSTATCANCEL)
45 #define CHNL_IS_TIMED_OUT(ioc) (ioc.status & CHNL_IOCSTATTIMEOUT)
47 /* Channel attributes: */
49 u32 uio_reqs; /* Max # of preallocated I/O requests. */
50 void *event_obj; /* User supplied auto-reset event object. */
51 char *pstr_event_name; /* Ptr to name of user event object. */
52 void *reserved1; /* Reserved for future use. */
53 u32 reserved2; /* Reserved for future use. */
57 /* I/O completion record: */
59 void *pbuf; /* Buffer to be filled/emptied. */
60 u32 byte_size; /* Bytes transferred. */
61 u32 buf_size; /* Actual buffer size in bytes */
62 u32 status; /* Status of IO completion. */
63 u32 dw_arg; /* User argument associated with pbuf. */
66 #endif /* CHNLDEFS_ */