di.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. /*
  26. * some macros for detailed trace management
  27. */
  28. #include "di_dbg.h"
  29. /*****************************************************************************/
  30. #define XMOREC 0x1f
  31. #define XMOREF 0x20
  32. #define XBUSY 0x40
  33. #define RMORE 0x80
  34. #define DIVA_MISC_FLAGS_REMOVE_PENDING 0x01
  35. #define DIVA_MISC_FLAGS_NO_RC_CANCELLING 0x02
  36. #define DIVA_MISC_FLAGS_RX_DMA 0x04
  37. /* structure for all information we have to keep on a per */
  38. /* adapater basis */
  39. typedef struct adapter_s ADAPTER;
  40. struct adapter_s {
  41. void *io;
  42. byte IdTable[256];
  43. byte IdTypeTable[256];
  44. byte FlowControlIdTable[256];
  45. byte FlowControlSkipTable[256];
  46. byte ReadyInt;
  47. byte RcExtensionSupported;
  48. byte misc_flags_table[256];
  49. dword protocol_capabilities;
  50. byte (*ram_in)(ADAPTER *a, void *adr);
  51. word (*ram_inw)(ADAPTER *a, void *adr);
  52. void (*ram_in_buffer)(ADAPTER *a, void *adr, void *P, word length);
  53. void (*ram_look_ahead)(ADAPTER *a, PBUFFER *RBuffer, ENTITY *e);
  54. void (*ram_out)(ADAPTER *a, void *adr, byte data);
  55. void (*ram_outw)(ADAPTER *a, void *adr, word data);
  56. void (*ram_out_buffer)(ADAPTER *a, void *adr, void *P, word length);
  57. void (*ram_inc)(ADAPTER *a, void *adr);
  58. #if defined(DIVA_ISTREAM)
  59. dword rx_stream[256];
  60. dword tx_stream[256];
  61. word tx_pos[256];
  62. word rx_pos[256];
  63. byte stream_buffer[2512];
  64. dword (*ram_offset)(ADAPTER *a);
  65. void (*ram_out_dw)(ADAPTER *a,
  66. void *addr,
  67. const dword *data,
  68. int dwords);
  69. void (*ram_in_dw)(ADAPTER *a,
  70. void *addr,
  71. dword *data,
  72. int dwords);
  73. void (*istream_wakeup)(ADAPTER *a);
  74. #else
  75. byte stream_buffer[4];
  76. #endif
  77. };
  78. /*------------------------------------------------------------------*/
  79. /* public functions of IDI common code */
  80. /*------------------------------------------------------------------*/
  81. void pr_out(ADAPTER *a);
  82. byte pr_dpc(ADAPTER *a);
  83. byte scom_test_int(ADAPTER *a);
  84. void scom_clear_int(ADAPTER *a);
  85. /*------------------------------------------------------------------*/
  86. /* OS specific functions used by IDI common code */
  87. /*------------------------------------------------------------------*/
  88. void free_entity(ADAPTER *a, byte e_no);
  89. void assign_queue(ADAPTER *a, byte e_no, word ref);
  90. byte get_assign(ADAPTER *a, word ref);
  91. void req_queue(ADAPTER *a, byte e_no);
  92. byte look_req(ADAPTER *a);
  93. void next_req(ADAPTER *a);
  94. ENTITY *entity_ptr(ADAPTER *a, byte e_no);
  95. #if defined(DIVA_ISTREAM)
  96. struct _diva_xdi_stream_interface;
  97. void diva_xdi_provide_istream_info(ADAPTER *a,
  98. struct _diva_xdi_stream_interface *pI);
  99. void pr_stream(ADAPTER *a);
  100. int diva_istream_write(void *context,
  101. int Id,
  102. void *data,
  103. int length,
  104. int final,
  105. byte usr1,
  106. byte usr2);
  107. int diva_istream_read(void *context,
  108. int Id,
  109. void *data,
  110. int max_length,
  111. int *final,
  112. byte *usr1,
  113. byte *usr2);
  114. #if defined(DIVA_IDI_RX_DMA)
  115. #include "diva_dma.h"
  116. #endif
  117. #endif