/drivers/staging/tidspbridge/include/dspbridge/chnldefs.h

https://bitbucket.org/wisechild/galaxy-nexus · C++ Header · 63 lines · 29 code · 10 blank · 24 comment · 0 complexity · a0ff2cb533c32c2db83d453e093677a9 MD5 · raw file

  1. /*
  2. * chnldefs.h
  3. *
  4. * DSP-BIOS Bridge driver support functions for TI OMAP processors.
  5. *
  6. * System-wide channel objects and constants.
  7. *
  8. * Copyright (C) 2005-2006 Texas Instruments, Inc.
  9. *
  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.
  13. *
  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.
  17. */
  18. #ifndef CHNLDEFS_
  19. #define CHNLDEFS_
  20. /* Channel id option. */
  21. #define CHNL_PICKFREE (~0UL) /* Let manager pick a free channel. */
  22. /* Channel modes */
  23. #define CHNL_MODETODSP 0 /* Data streaming to the DSP. */
  24. #define CHNL_MODEFROMDSP 1 /* Data streaming from the DSP. */
  25. /* GetIOCompletion flags */
  26. #define CHNL_IOCINFINITE 0xffffffff /* Wait forever for IO completion. */
  27. #define CHNL_IOCNOWAIT 0x0 /* Dequeue an IOC, if available. */
  28. /* IO Completion Record status: */
  29. #define CHNL_IOCSTATCOMPLETE 0x0000 /* IO Completed. */
  30. #define CHNL_IOCSTATCANCEL 0x0002 /* IO was cancelled */
  31. #define CHNL_IOCSTATTIMEOUT 0x0008 /* Wait for IOC timed out. */
  32. #define CHNL_IOCSTATEOS 0x8000 /* End Of Stream reached. */
  33. /* Macros for checking I/O Completion status: */
  34. #define CHNL_IS_IO_COMPLETE(ioc) (!(ioc.status & ~CHNL_IOCSTATEOS))
  35. #define CHNL_IS_IO_CANCELLED(ioc) (ioc.status & CHNL_IOCSTATCANCEL)
  36. #define CHNL_IS_TIMED_OUT(ioc) (ioc.status & CHNL_IOCSTATTIMEOUT)
  37. /* Channel attributes: */
  38. struct chnl_attr {
  39. u32 uio_reqs; /* Max # of preallocated I/O requests. */
  40. void *event_obj; /* User supplied auto-reset event object. */
  41. char *str_event_name; /* Ptr to name of user event object. */
  42. void *reserved1; /* Reserved for future use. */
  43. u32 reserved2; /* Reserved for future use. */
  44. };
  45. /* I/O completion record: */
  46. struct chnl_ioc {
  47. void *buf; /* Buffer to be filled/emptied. */
  48. u32 byte_size; /* Bytes transferred. */
  49. u32 buf_size; /* Actual buffer size in bytes */
  50. u32 status; /* Status of IO completion. */
  51. u32 arg; /* User argument associated with buf. */
  52. };
  53. #endif /* CHNLDEFS_ */