eicon_dsp.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:8k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* $Id: eicon_dsp.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2.  *
  3.  * ISDN lowlevel-module for Eicon active cards.
  4.  * DSP definitions
  5.  *
  6.  * Copyright 1999,2000  by Armin Schindler (mac@melware.de)
  7.  * Copyright 1999,2000  Cytronics & Melware (info@melware.de)
  8.  *
  9.  * This software may be used and distributed according to the terms
  10.  * of the GNU General Public License, incorporated herein by reference.
  11.  *
  12.  */
  13. #ifndef DSP_H 
  14. #define DSP_H
  15. #include "dsp_defs.h"
  16. #define DSP_UDATA_REQUEST_SWITCH_FRAMER         1
  17. /*
  18. parameters:
  19.   <byte> transmit framer type
  20.   <byte> receive framer type
  21. */
  22. #define DSP_REQUEST_SWITCH_FRAMER_HDLC          0
  23. #define DSP_REQUEST_SWITCH_FRAMER_TRANSPARENT   1
  24. #define DSP_REQUEST_SWITCH_FRAMER_ASYNC         2
  25. #define DSP_UDATA_REQUEST_CLEARDOWN             2
  26. /*
  27. parameters:
  28.   - none -
  29. */
  30. #define DSP_UDATA_REQUEST_TX_CONFIRMATION_ON    3
  31. /*
  32. parameters:
  33.   - none -
  34. */
  35. #define DSP_UDATA_REQUEST_TX_CONFIRMATION_OFF   4
  36. /*
  37. parameters:
  38.   - none -
  39. */
  40. typedef struct eicon_dsp_ind {
  41. __u16 time __attribute__ ((packed));
  42. __u8 norm __attribute__ ((packed));
  43. __u16 options __attribute__ ((packed));
  44. __u32 speed __attribute__ ((packed));
  45. __u16 delay __attribute__ ((packed));
  46. __u32 txspeed __attribute__ ((packed));
  47. __u32 rxspeed __attribute__ ((packed));
  48. } eicon_dsp_ind;
  49. #define DSP_CONNECTED_OPTION_V42_TRANS           0x0002
  50. #define DSP_CONNECTED_OPTION_V42_LAPM            0x0004
  51. #define DSP_CONNECTED_OPTION_SHORT_TRAIN         0x0008
  52. #define DSP_CONNECTED_OPTION_TALKER_ECHO_PROTECT 0x0010
  53. #define DSP_UDATA_INDICATION_DISCONNECT         5
  54. /*
  55. returns:
  56.   <byte> cause
  57. */
  58. #define DSP_DISCONNECT_CAUSE_NONE               0x00
  59. #define DSP_DISCONNECT_CAUSE_BUSY_TONE          0x01
  60. #define DSP_DISCONNECT_CAUSE_CONGESTION_TONE    0x02
  61. #define DSP_DISCONNECT_CAUSE_INCOMPATIBILITY    0x03
  62. #define DSP_DISCONNECT_CAUSE_CLEARDOWN          0x04
  63. #define DSP_DISCONNECT_CAUSE_TRAINING_TIMEOUT   0x05
  64. #define DSP_UDATA_INDICATION_TX_CONFIRMATION    6
  65. /*
  66. returns:
  67.   <word> confirmation number
  68. */
  69. #define DSP_UDATA_REQUEST_SEND_DTMF_DIGITS      16
  70. /*
  71. parameters:
  72.   <word> tone duration (ms)
  73.   <word> gap duration (ms)
  74.   <byte> digit 0 tone code
  75.   ...
  76.   <byte> digit n tone code
  77. */
  78. #define DSP_SEND_DTMF_DIGITS_HEADER_LENGTH      5
  79. #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_697_HZ    0x00
  80. #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_770_HZ    0x01
  81. #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_852_HZ    0x02
  82. #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_941_HZ    0x03
  83. #define DSP_DTMF_DIGIT_TONE_LOW_GROUP_MASK      0x03
  84. #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1209_HZ  0x00
  85. #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1336_HZ  0x04
  86. #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1477_HZ  0x08
  87. #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_1633_HZ  0x0c
  88. #define DSP_DTMF_DIGIT_TONE_HIGH_GROUP_MASK     0x0c
  89. #define DSP_DTMF_DIGIT_TONE_CODE_0              0x07
  90. #define DSP_DTMF_DIGIT_TONE_CODE_1              0x00
  91. #define DSP_DTMF_DIGIT_TONE_CODE_2              0x04
  92. #define DSP_DTMF_DIGIT_TONE_CODE_3              0x08
  93. #define DSP_DTMF_DIGIT_TONE_CODE_4              0x01
  94. #define DSP_DTMF_DIGIT_TONE_CODE_5              0x05
  95. #define DSP_DTMF_DIGIT_TONE_CODE_6              0x09
  96. #define DSP_DTMF_DIGIT_TONE_CODE_7              0x02
  97. #define DSP_DTMF_DIGIT_TONE_CODE_8              0x06
  98. #define DSP_DTMF_DIGIT_TONE_CODE_9              0x0a
  99. #define DSP_DTMF_DIGIT_TONE_CODE_STAR           0x03
  100. #define DSP_DTMF_DIGIT_TONE_CODE_HASHMARK       0x0b
  101. #define DSP_DTMF_DIGIT_TONE_CODE_A              0x0c
  102. #define DSP_DTMF_DIGIT_TONE_CODE_B              0x0d
  103. #define DSP_DTMF_DIGIT_TONE_CODE_C              0x0e
  104. #define DSP_DTMF_DIGIT_TONE_CODE_D              0x0f
  105. #define DSP_UDATA_INDICATION_DTMF_DIGITS_SENT   16
  106. /*
  107. returns:
  108.   - none -
  109.   One indication will be sent for every request.
  110. */
  111. #define DSP_UDATA_REQUEST_ENABLE_DTMF_RECEIVER  17
  112. /*
  113. parameters:
  114.   <word> tone duration (ms)
  115.   <word> gap duration (ms)
  116. */
  117. typedef struct enable_dtmf_s {
  118. __u16 tone;
  119. __u16 gap;
  120. } enable_dtmf_s;
  121. #define DSP_UDATA_REQUEST_DISABLE_DTMF_RECEIVER 18
  122. /*
  123. parameters:
  124.   - none -
  125. */
  126. #define DSP_UDATA_INDICATION_DTMF_DIGITS_RECEIVED 17
  127. /*
  128. returns:
  129.   <byte> digit 0 tone code
  130.   ...
  131.   <byte> digit n tone code
  132. */
  133. #define DSP_DTMF_DIGITS_RECEIVED_HEADER_LENGTH  1
  134. #define DSP_UDATA_INDICATION_MODEM_CALLING_TONE 18
  135. /*
  136. returns:
  137.   - none -
  138. */
  139. #define DSP_UDATA_INDICATION_FAX_CALLING_TONE   19
  140. /*
  141. returns:
  142.   - none -
  143. */
  144. #define DSP_UDATA_INDICATION_ANSWER_TONE        20
  145. /*
  146. returns:
  147.   - none -
  148. */
  149. /* ============= FAX ================ */
  150. #define EICON_FAXID_LEN 20
  151. typedef struct eicon_t30_s {
  152.   __u8          code;
  153.   __u8          rate;
  154.   __u8          resolution;
  155.   __u8          format;
  156.   __u8          pages_low;
  157.   __u8          pages_high;
  158.   __u8          atf;
  159.   __u8          control_bits_low;
  160.   __u8          control_bits_high;
  161.   __u8          feature_bits_low;
  162.   __u8          feature_bits_high;
  163.   __u8          universal_5;
  164.   __u8          universal_6;
  165.   __u8          universal_7;
  166.   __u8          station_id_len;
  167.   __u8          head_line_len;
  168.   __u8          station_id[EICON_FAXID_LEN];
  169. /* __u8          head_line[]; */
  170. } eicon_t30_s;
  171.         /* EDATA transmit messages */
  172. #define EDATA_T30_DIS       0x01
  173. #define EDATA_T30_FTT       0x02
  174. #define EDATA_T30_MCF       0x03
  175.         /* EDATA receive messages */
  176. #define EDATA_T30_DCS       0x81
  177. #define EDATA_T30_TRAIN_OK  0x82
  178. #define EDATA_T30_EOP       0x83
  179. #define EDATA_T30_MPS       0x84
  180. #define EDATA_T30_EOM       0x85
  181. #define EDATA_T30_DTC       0x86
  182. #define T30_FORMAT_SFF            0
  183. #define T30_FORMAT_ASCII          1
  184. #define T30_FORMAT_COUNT          2
  185. #define T30_CONTROL_BIT_DISABLE_FINE      0x0001
  186. #define T30_CONTROL_BIT_ENABLE_ECM        0x0002
  187. #define T30_CONTROL_BIT_ECM_64_BYTES      0x0004
  188. #define T30_CONTROL_BIT_ENABLE_2D_CODING  0x0008
  189. #define T30_CONTROL_BIT_ENABLE_T6_CODING  0x0010
  190. #define T30_CONTROL_BIT_ENABLE_UNCOMPR    0x0020
  191. #define T30_CONTROL_BIT_ACCEPT_POLLING    0x0040
  192. #define T30_CONTROL_BIT_REQUEST_POLLING   0x0080
  193. #define T30_CONTROL_BIT_MORE_DOCUMENTS    0x0100
  194. #define T30_CONTROL_BIT_ALL_FEATURES
  195.   (T30_CONTROL_BIT_ENABLE_ECM | T30_CONTROL_BIT_ENABLE_2D_CODING |
  196.    T30_CONTROL_BIT_ENABLE_T6_CODING | T30_CONTROL_BIT_ENABLE_UNCOMPR)
  197. #define T30_FEATURE_BIT_FINE              0x0001
  198. #define T30_FEATURE_BIT_ECM               0x0002
  199. #define T30_FEATURE_BIT_ECM_64_BYTES      0x0004
  200. #define T30_FEATURE_BIT_2D_CODING         0x0008
  201. #define T30_FEATURE_BIT_T6_CODING         0x0010
  202. #define T30_FEATURE_BIT_UNCOMPR_ENABLED   0x0020
  203. #define T30_FEATURE_BIT_POLLING           0x0040
  204. #define FAX_OBJECT_DOCU 1
  205. #define FAX_OBJECT_PAGE 2
  206. #define FAX_OBJECT_LINE 3
  207. #define T4_EOL 0x800
  208. #define T4_EOL_BITSIZE 12
  209. #define T4_EOL_DWORD (T4_EOL << (32 - T4_EOL_BITSIZE))
  210. #define T4_EOL_MASK_DWORD ((__u32) -1 << (32 - T4_EOL_BITSIZE))
  211. #define SFF_LEN_FLD_SIZE 3
  212. #define _DLE_ 0x10
  213. #define _ETX_ 0x03
  214. typedef struct eicon_sff_dochead {
  215. __u32 id __attribute__ ((packed));
  216. __u8 version __attribute__ ((packed));
  217. __u8 reserved1 __attribute__ ((packed));
  218. __u16 userinfo __attribute__ ((packed));
  219. __u16 pagecount __attribute__ ((packed));
  220. __u16 off1pagehead __attribute__ ((packed));
  221. __u32 offnpagehead __attribute__ ((packed));
  222. __u32 offdocend __attribute__ ((packed));
  223. } eicon_sff_dochead;
  224. typedef struct eicon_sff_pagehead {
  225. __u8 pageheadid __attribute__ ((packed));
  226. __u8 pageheadlen __attribute__ ((packed));
  227. __u8 resvert __attribute__ ((packed));
  228. __u8 reshoriz __attribute__ ((packed));
  229. __u8 coding __attribute__ ((packed));
  230. __u8 reserved2 __attribute__ ((packed));
  231. __u16 linelength __attribute__ ((packed));
  232. __u16 pagelength __attribute__ ((packed));
  233. __u32 offprevpage __attribute__ ((packed));
  234. __u32 offnextpage __attribute__ ((packed));
  235. } eicon_sff_pagehead;
  236. #endif /* DSP_H */