dfifo.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef __DIVA_IDI_DFIFO_INC__
  26. #define __DIVA_IDI_DFIFO_INC__
  27. #define DIVA_DFIFO_CACHE_SZ 64 /* Used to isolate pipe from
  28. rest of the world
  29. should be divisible by 4
  30. */
  31. #define DIVA_DFIFO_RAW_SZ (2512 * 8)
  32. #define DIVA_DFIFO_DATA_SZ 68
  33. #define DIVA_DFIFO_HDR_SZ 4
  34. #define DIVA_DFIFO_SEGMENT_SZ (DIVA_DFIFO_DATA_SZ + DIVA_DFIFO_HDR_SZ)
  35. #define DIVA_DFIFO_SEGMENTS ((DIVA_DFIFO_RAW_SZ) / (DIVA_DFIFO_SEGMENT_SZ) + 1)
  36. #define DIVA_DFIFO_MEM_SZ ( \
  37. (DIVA_DFIFO_SEGMENT_SZ) * (DIVA_DFIFO_SEGMENTS) + \
  38. (DIVA_DFIFO_CACHE_SZ) * 2 \
  39. )
  40. #define DIVA_DFIFO_STEP DIVA_DFIFO_SEGMENT_SZ
  41. /* -------------------------------------------------------------------------
  42. Block header layout is:
  43. byte[0] -> flags
  44. byte[1] -> length of data in block
  45. byte[2] -> reserved
  46. byte[4] -> reserved
  47. ------------------------------------------------------------------------- */
  48. #define DIVA_DFIFO_WRAP 0x80 /* This is the last block in fifo */
  49. #define DIVA_DFIFO_READY 0x40 /* This block is ready for processing */
  50. #define DIVA_DFIFO_LAST 0x20 /* This block is last in message */
  51. #define DIVA_DFIFO_AUTO 0x10 /* Don't look for 'ready', don't ack */
  52. int diva_dfifo_create(void *start, int length);
  53. #endif