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

https://bitbucket.org/cyanogenmod/android_kernel_asus_tf300t · C Header · 85 lines · 36 code · 11 blank · 38 comment · 0 complexity · 032c660351afea54a011a991ede8fa38 MD5 · raw file

  1. /*
  2. * chnlpriv.h
  3. *
  4. * DSP-BIOS Bridge driver support functions for TI OMAP processors.
  5. *
  6. * Private channel header shared between DSPSYS, DSPAPI and
  7. * Bridge driver modules.
  8. *
  9. * Copyright (C) 2005-2006 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. #ifndef CHNLPRIV_
  20. #define CHNLPRIV_
  21. #include <dspbridge/chnldefs.h>
  22. #include <dspbridge/devdefs.h>
  23. #include <dspbridge/sync.h>
  24. /* Channel manager limits: */
  25. #define CHNL_MAXCHANNELS 32 /* Max channels available per transport */
  26. /*
  27. * Trans port channel Id definitions:(must match dsp-side).
  28. *
  29. * For CHNL_MAXCHANNELS = 16:
  30. *
  31. * ChnlIds:
  32. * 0-15 (PCPY) - transport 0)
  33. * 16-31 (DDMA) - transport 1)
  34. * 32-47 (ZCPY) - transport 2)
  35. */
  36. #define CHNL_PCPY 0 /* Proc-copy transport 0 */
  37. /* Higher level channel states: */
  38. #define CHNL_STATEREADY 0 /* Channel ready for I/O. */
  39. #define CHNL_STATECANCEL 1 /* I/O was cancelled. */
  40. #define CHNL_STATEEOS 2 /* End Of Stream reached. */
  41. /* Macros for checking mode: */
  42. #define CHNL_IS_INPUT(mode) (mode & CHNL_MODEFROMDSP)
  43. #define CHNL_IS_OUTPUT(mode) (!CHNL_IS_INPUT(mode))
  44. /* Types of channel class libraries: */
  45. #define CHNL_TYPESM 1 /* Shared memory driver. */
  46. /* Channel info. */
  47. struct chnl_info {
  48. struct chnl_mgr *chnl_mgr; /* Owning channel manager. */
  49. u32 cnhl_id; /* Channel ID. */
  50. void *event_obj; /* Channel I/O completion event. */
  51. /*Abstraction of I/O completion event. */
  52. struct sync_object *sync_event;
  53. s8 mode; /* Channel mode. */
  54. u8 state; /* Current channel state. */
  55. u32 bytes_tx; /* Total bytes transferred. */
  56. u32 cio_cs; /* Number of IOCs in queue. */
  57. u32 cio_reqs; /* Number of IO Requests in queue. */
  58. u32 process; /* Process owning this channel. */
  59. };
  60. /* Channel manager info: */
  61. struct chnl_mgrinfo {
  62. u8 type; /* Type of channel class library. */
  63. /* Channel handle, given the channel id. */
  64. struct chnl_object *chnl_obj;
  65. u8 open_channels; /* Number of open channels. */
  66. u8 max_channels; /* total # of chnls supported */
  67. };
  68. /* Channel Manager Attrs: */
  69. struct chnl_mgrattrs {
  70. /* Max number of channels this manager can use. */
  71. u8 max_channels;
  72. u32 word_size; /* DSP Word size. */
  73. };
  74. #endif /* CHNLPRIV_ */