aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h
blob: cb67c309b6ca334991afe8ba29340c01fec4eb28 (plain) (blame)
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
/*
 * chnldefs.h
 *
 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
 *
 * System-wide channel objects and constants.
 *
 * Copyright (C) 2005-2006 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 CHNLDEFS_
#define CHNLDEFS_

/* Channel id option. */
#define CHNL_PICKFREE       (~0UL)	/* Let manager pick a free channel. */

/* Channel modes */
#define CHNL_MODETODSP		0	/* Data streaming to the DSP. */
#define CHNL_MODEFROMDSP	1	/* Data streaming from the DSP. */

/* GetIOCompletion flags */
#define CHNL_IOCINFINITE     0xffffffff	/* Wait forever for IO completion. */
#define CHNL_IOCNOWAIT       0x0	/* Dequeue an IOC, if available. */

/* IO Completion Record status: */
#define CHNL_IOCSTATCOMPLETE 0x0000	/* IO Completed. */
#define CHNL_IOCSTATCANCEL   0x0002	/* IO was cancelled */
#define CHNL_IOCSTATTIMEOUT  0x0008	/* Wait for IOC timed out. */
#define CHNL_IOCSTATEOS      0x8000	/* End Of Stream reached. */

/* Macros for checking I/O Completion status: */
#define CHNL_IS_IO_COMPLETE(ioc)  (!(ioc.status & ~CHNL_IOCSTATEOS))
#define CHNL_IS_IO_CANCELLED(ioc) (ioc.status & CHNL_IOCSTATCANCEL)
#define CHNL_IS_TIMED_OUT(ioc)    (ioc.status & CHNL_IOCSTATTIMEOUT)

/* Channel attributes: */
struct chnl_attr {
	u32 uio_reqs;		/* Max # of preallocated I/O requests. */
	void *event_obj;	/* User supplied auto-reset event object. */
	char *str_event_name;	/* Ptr to name of user event object. */
	void *reserved1;	/* Reserved for future use. */
	u32 reserved2;		/* Reserved for future use. */

};

/* I/O completion record: */
struct chnl_ioc {
	void *buf;		/* Buffer to be filled/emptied. */
	u32 byte_size;		/* Bytes transferred. */
	u32 buf_size;		/* Actual buffer size in bytes */
	u32 status;		/* Status of IO completion. */
	u32 arg;		/* User argument associated with buf. */
};

#endif /* CHNLDEFS_ */