di_defs.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 _DI_DEFS_
  26. #define _DI_DEFS_
  27. /* typedefs for our data structures */
  28. typedef struct get_name_s GET_NAME;
  29. /* The entity_s structure is used to pass all
  30. parameters between application and IDI */
  31. typedef struct entity_s ENTITY;
  32. typedef struct buffers_s BUFFERS;
  33. typedef struct postcall_s POSTCALL;
  34. typedef struct get_para_s GET_PARA;
  35. #define BOARD_NAME_LENGTH 9
  36. #define IDI_CALL_LINK_T
  37. #define IDI_CALL_ENTITY_T
  38. /* typedef void ( * IDI_CALL)(ENTITY *); */
  39. /* --------------------------------------------------------
  40. IDI_CALL
  41. -------------------------------------------------------- */
  42. typedef void (IDI_CALL_LINK_T *IDI_CALL)(ENTITY IDI_CALL_ENTITY_T *);
  43. typedef struct {
  44. word length; /* length of data/parameter field */
  45. byte P[270]; /* data/parameter field */
  46. } DBUFFER;
  47. struct get_name_s {
  48. word command; /* command = 0x0100 */
  49. byte name[BOARD_NAME_LENGTH];
  50. };
  51. struct postcall_s {
  52. word command; /* command = 0x0300 */
  53. word dummy; /* not used */
  54. void (*callback)(void *); /* call back */
  55. void *context; /* context pointer */
  56. };
  57. #define REQ_PARA 0x0600 /* request command line parameters */
  58. #define REQ_PARA_LEN 1 /* number of data bytes */
  59. #define L1_STARTUP_DOWN_POS 0 /* '-y' command line parameter in......*/
  60. #define L1_STARTUP_DOWN_MSK 0x01 /* first byte position (index 0) with value 0x01 */
  61. struct get_para_s {
  62. word command; /* command = 0x0600 */
  63. byte len; /* max length of para field in bytes */
  64. byte para[REQ_PARA_LEN]; /* parameter field */
  65. };
  66. struct buffers_s {
  67. word PLength;
  68. byte *P;
  69. };
  70. struct entity_s {
  71. byte Req; /* pending request */
  72. byte Rc; /* return code received */
  73. byte Ind; /* indication received */
  74. byte ReqCh; /* channel of current Req */
  75. byte RcCh; /* channel of current Rc */
  76. byte IndCh; /* channel of current Ind */
  77. byte Id; /* ID used by this entity */
  78. byte GlobalId; /* reserved field */
  79. byte XNum; /* number of X-buffers */
  80. byte RNum; /* number of R-buffers */
  81. BUFFERS *X; /* pointer to X-buffer list */
  82. BUFFERS *R; /* pointer to R-buffer list */
  83. word RLength; /* length of current R-data */
  84. DBUFFER *RBuffer; /* buffer of current R-data */
  85. byte RNR; /* receive not ready flag */
  86. byte complete; /* receive complete status */
  87. IDI_CALL callback;
  88. word user[2];
  89. /* fields used by the driver internally */
  90. byte No; /* entity number */
  91. byte reserved2; /* reserved field */
  92. byte More; /* R/X More flags */
  93. byte MInd; /* MDATA coding for this ID */
  94. byte XCurrent; /* current transmit buffer */
  95. byte RCurrent; /* current receive buffer */
  96. word XOffset; /* offset in x-buffer */
  97. word ROffset; /* offset in r-buffer */
  98. };
  99. typedef struct {
  100. byte type;
  101. byte channels;
  102. word features;
  103. IDI_CALL request;
  104. } DESCRIPTOR;
  105. /* descriptor type field coding */
  106. #define IDI_ADAPTER_S 1
  107. #define IDI_ADAPTER_PR 2
  108. #define IDI_ADAPTER_DIVA 3
  109. #define IDI_ADAPTER_MAESTRA 4
  110. #define IDI_VADAPTER 0x40
  111. #define IDI_DRIVER 0x80
  112. #define IDI_DADAPTER 0xfd
  113. #define IDI_DIDDPNP 0xfe
  114. #define IDI_DIMAINT 0xff
  115. /* Hardware IDs ISA PNP */
  116. #define HW_ID_DIVA_PRO 3 /* same as IDI_ADAPTER_DIVA */
  117. #define HW_ID_MAESTRA 4 /* same as IDI_ADAPTER_MAESTRA */
  118. #define HW_ID_PICCOLA 5
  119. #define HW_ID_DIVA_PRO20 6
  120. #define HW_ID_DIVA20 7
  121. #define HW_ID_DIVA_PRO20_U 8
  122. #define HW_ID_DIVA20_U 9
  123. #define HW_ID_DIVA30 10
  124. #define HW_ID_DIVA30_U 11
  125. /* Hardware IDs PCI */
  126. #define HW_ID_EICON_PCI 0x1133
  127. #define HW_ID_SIEMENS_PCI 0x8001 /* unused SubVendor ID for Siemens Cornet-N cards */
  128. #define HW_ID_PROTTYPE_CORNETN 0x0014 /* SubDevice ID for Siemens Cornet-N cards */
  129. #define HW_ID_FUJITSU_SIEMENS_PCI 0x110A /* SubVendor ID for Fujitsu Siemens */
  130. #define HW_ID_GS03_PCI 0x0021 /* SubDevice ID for Fujitsu Siemens ISDN S0 card */
  131. #define HW_ID_DIVA_PRO20_PCI 0xe001
  132. #define HW_ID_DIVA20_PCI 0xe002
  133. #define HW_ID_DIVA_PRO20_PCI_U 0xe003
  134. #define HW_ID_DIVA20_PCI_U 0xe004
  135. #define HW_ID_DIVA201_PCI 0xe005
  136. #define HW_ID_DIVA_CT_ST 0xe006
  137. #define HW_ID_DIVA_CT_U 0xe007
  138. #define HW_ID_DIVA_CTL_ST 0xe008
  139. #define HW_ID_DIVA_CTL_U 0xe009
  140. #define HW_ID_DIVA_ISDN_V90_PCI 0xe00a
  141. #define HW_ID_DIVA202_PCI_ST 0xe00b
  142. #define HW_ID_DIVA202_PCI_U 0xe00c
  143. #define HW_ID_DIVA_PRO30_PCI 0xe00d
  144. #define HW_ID_MAESTRA_PCI 0xe010
  145. #define HW_ID_MAESTRAQ_PCI 0xe012
  146. #define HW_ID_DSRV_Q8M_V2_PCI 0xe013
  147. #define HW_ID_MAESTRAP_PCI 0xe014
  148. #define HW_ID_DSRV_P30M_V2_PCI 0xe015
  149. #define HW_ID_DSRV_VOICE_Q8M_PCI 0xe016
  150. #define HW_ID_DSRV_VOICE_Q8M_V2_PCI 0xe017
  151. #define HW_ID_DSRV_B2M_V2_PCI 0xe018
  152. #define HW_ID_DSRV_VOICE_P30M_V2_PCI 0xe019
  153. #define HW_ID_DSRV_B2F_PCI 0xe01a
  154. #define HW_ID_DSRV_VOICE_B2M_V2_PCI 0xe01b
  155. /* Hardware IDs USB */
  156. #define EICON_USB_VENDOR_ID 0x071D
  157. #define HW_ID_DIVA_USB_REV1 0x1000
  158. #define HW_ID_DIVA_USB_REV2 0x1003
  159. #define HW_ID_TELEDAT_SURF_USB_REV2 0x1004
  160. #define HW_ID_TELEDAT_SURF_USB_REV1 0x2000
  161. /* --------------------------------------------------------------------------
  162. Adapter array change notification framework
  163. -------------------------------------------------------------------------- */
  164. typedef void (IDI_CALL_LINK_T *didd_adapter_change_callback_t)(void IDI_CALL_ENTITY_T *context, DESCRIPTOR *adapter, int removal);
  165. /* -------------------------------------------------------------------------- */
  166. #define DI_VOICE 0x0 /* obsolete define */
  167. #define DI_FAX3 0x1
  168. #define DI_MODEM 0x2
  169. #define DI_POST 0x4
  170. #define DI_V110 0x8
  171. #define DI_V120 0x10
  172. #define DI_POTS 0x20
  173. #define DI_CODEC 0x40
  174. #define DI_MANAGE 0x80
  175. #define DI_V_42 0x0100
  176. #define DI_EXTD_FAX 0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */
  177. #define DI_AT_PARSER 0x0400 /* Build-in AT Parser in the L2 */
  178. #define DI_VOICE_OVER_IP 0x0800 /* Voice over IP support */
  179. typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
  180. #endif