mdm_msg.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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 __EICON_MDM_MSG_H__
  26. #define __EICON_MDM_MSG_H__
  27. #define DSP_UDATA_INDICATION_DCD_OFF 0x01
  28. #define DSP_UDATA_INDICATION_DCD_ON 0x02
  29. #define DSP_UDATA_INDICATION_CTS_OFF 0x03
  30. #define DSP_UDATA_INDICATION_CTS_ON 0x04
  31. /* =====================================================================
  32. DCD_OFF Message:
  33. <word> time of DCD off (sampled from counter at 8kHz)
  34. DCD_ON Message:
  35. <word> time of DCD on (sampled from counter at 8kHz)
  36. <byte> connected norm
  37. <word> connected options
  38. <dword> connected speed (bit/s, max of tx and rx speed)
  39. <word> roundtrip delay (ms)
  40. <dword> connected speed tx (bit/s)
  41. <dword> connected speed rx (bit/s)
  42. Size of this message == 19 bytes, but we will receive only 11
  43. ===================================================================== */
  44. #define DSP_CONNECTED_NORM_UNSPECIFIED 0
  45. #define DSP_CONNECTED_NORM_V21 1
  46. #define DSP_CONNECTED_NORM_V23 2
  47. #define DSP_CONNECTED_NORM_V22 3
  48. #define DSP_CONNECTED_NORM_V22_BIS 4
  49. #define DSP_CONNECTED_NORM_V32_BIS 5
  50. #define DSP_CONNECTED_NORM_V34 6
  51. #define DSP_CONNECTED_NORM_V8 7
  52. #define DSP_CONNECTED_NORM_BELL_212A 8
  53. #define DSP_CONNECTED_NORM_BELL_103 9
  54. #define DSP_CONNECTED_NORM_V29_LEASED_LINE 10
  55. #define DSP_CONNECTED_NORM_V33_LEASED_LINE 11
  56. #define DSP_CONNECTED_NORM_V90 12
  57. #define DSP_CONNECTED_NORM_V21_CH2 13
  58. #define DSP_CONNECTED_NORM_V27_TER 14
  59. #define DSP_CONNECTED_NORM_V29 15
  60. #define DSP_CONNECTED_NORM_V33 16
  61. #define DSP_CONNECTED_NORM_V17 17
  62. #define DSP_CONNECTED_NORM_V32 18
  63. #define DSP_CONNECTED_NORM_K56_FLEX 19
  64. #define DSP_CONNECTED_NORM_X2 20
  65. #define DSP_CONNECTED_NORM_V18 21
  66. #define DSP_CONNECTED_NORM_V18_LOW_HIGH 22
  67. #define DSP_CONNECTED_NORM_V18_HIGH_LOW 23
  68. #define DSP_CONNECTED_NORM_V21_LOW_HIGH 24
  69. #define DSP_CONNECTED_NORM_V21_HIGH_LOW 25
  70. #define DSP_CONNECTED_NORM_BELL103_LOW_HIGH 26
  71. #define DSP_CONNECTED_NORM_BELL103_HIGH_LOW 27
  72. #define DSP_CONNECTED_NORM_V23_75_1200 28
  73. #define DSP_CONNECTED_NORM_V23_1200_75 29
  74. #define DSP_CONNECTED_NORM_EDT_110 30
  75. #define DSP_CONNECTED_NORM_BAUDOT_45 31
  76. #define DSP_CONNECTED_NORM_BAUDOT_47 32
  77. #define DSP_CONNECTED_NORM_BAUDOT_50 33
  78. #define DSP_CONNECTED_NORM_DTMF 34
  79. #define DSP_CONNECTED_NORM_V18_RESERVED_13 35
  80. #define DSP_CONNECTED_NORM_V18_RESERVED_14 36
  81. #define DSP_CONNECTED_NORM_V18_RESERVED_15 37
  82. #define DSP_CONNECTED_NORM_VOWN 38
  83. #define DSP_CONNECTED_NORM_V23_OFF_HOOK 39
  84. #define DSP_CONNECTED_NORM_V23_ON_HOOK 40
  85. #define DSP_CONNECTED_NORM_VOWN_RESERVED_3 41
  86. #define DSP_CONNECTED_NORM_VOWN_RESERVED_4 42
  87. #define DSP_CONNECTED_NORM_VOWN_RESERVED_5 43
  88. #define DSP_CONNECTED_NORM_VOWN_RESERVED_6 44
  89. #define DSP_CONNECTED_NORM_VOWN_RESERVED_7 45
  90. #define DSP_CONNECTED_NORM_VOWN_RESERVED_8 46
  91. #define DSP_CONNECTED_NORM_VOWN_RESERVED_9 47
  92. #define DSP_CONNECTED_NORM_VOWN_RESERVED_10 48
  93. #define DSP_CONNECTED_NORM_VOWN_RESERVED_11 49
  94. #define DSP_CONNECTED_NORM_VOWN_RESERVED_12 50
  95. #define DSP_CONNECTED_NORM_VOWN_RESERVED_13 51
  96. #define DSP_CONNECTED_NORM_VOWN_RESERVED_14 52
  97. #define DSP_CONNECTED_NORM_VOWN_RESERVED_15 53
  98. #define DSP_CONNECTED_NORM_VOWN_RESERVED_16 54
  99. #define DSP_CONNECTED_NORM_VOWN_RESERVED_17 55
  100. #define DSP_CONNECTED_NORM_VOWN_RESERVED_18 56
  101. #define DSP_CONNECTED_NORM_VOWN_RESERVED_19 57
  102. #define DSP_CONNECTED_NORM_VOWN_RESERVED_20 58
  103. #define DSP_CONNECTED_NORM_VOWN_RESERVED_21 59
  104. #define DSP_CONNECTED_NORM_VOWN_RESERVED_22 60
  105. #define DSP_CONNECTED_NORM_VOWN_RESERVED_23 61
  106. #define DSP_CONNECTED_NORM_VOWN_RESERVED_24 62
  107. #define DSP_CONNECTED_NORM_VOWN_RESERVED_25 63
  108. #define DSP_CONNECTED_NORM_VOWN_RESERVED_26 64
  109. #define DSP_CONNECTED_NORM_VOWN_RESERVED_27 65
  110. #define DSP_CONNECTED_NORM_VOWN_RESERVED_28 66
  111. #define DSP_CONNECTED_NORM_VOWN_RESERVED_29 67
  112. #define DSP_CONNECTED_NORM_VOWN_RESERVED_30 68
  113. #define DSP_CONNECTED_NORM_VOWN_RESERVED_31 69
  114. #define DSP_CONNECTED_OPTION_TRELLIS 0x0001
  115. #define DSP_CONNECTED_OPTION_V42_TRANS 0x0002
  116. #define DSP_CONNECTED_OPTION_V42_LAPM 0x0004
  117. #define DSP_CONNECTED_OPTION_SHORT_TRAIN 0x0008
  118. #define DSP_CONNECTED_OPTION_TALKER_ECHO_PROTECT 0x0010
  119. #define DSP_CONNECTED_OPTION_V42BIS 0x0020
  120. #define DSP_CONNECTED_OPTION_MNP2 0x0040
  121. #define DSP_CONNECTED_OPTION_MNP3 0x0080
  122. #define DSP_CONNECTED_OPTION_MNP4 0x00c0
  123. #define DSP_CONNECTED_OPTION_MNP5 0x0100
  124. #define DSP_CONNECTED_OPTION_MNP10 0x0200
  125. #define DSP_CONNECTED_OPTION_MASK_V42 0x0024
  126. #define DSP_CONNECTED_OPTION_MASK_MNP 0x03c0
  127. #define DSP_CONNECTED_OPTION_MASK_ERROR_CORRECT 0x03e4
  128. #define DSP_CONNECTED_OPTION_MASK_COMPRESSION 0x0320
  129. #define DSP_UDATA_INDICATION_DISCONNECT 5
  130. /*
  131. returns:
  132. <byte> cause
  133. */
  134. /* ==========================================================
  135. DLC: B2 modem configuration
  136. ========================================================== */
  137. /*
  138. Fields in assign DLC information element for modem protocol V.42/MNP:
  139. <byte> length of information element
  140. <word> information field length
  141. <byte> address A (not used, default 3)
  142. <byte> address B (not used, default 1)
  143. <byte> modulo mode (not used, default 7)
  144. <byte> window size (not used, default 7)
  145. <word> XID length (not used, default 0)
  146. ... XID information (not used, default empty)
  147. <byte> modem protocol negotiation options
  148. <byte> modem protocol options
  149. <byte> modem protocol break configuration
  150. <byte> modem protocol application options
  151. */
  152. #define DLC_MODEMPROT_DISABLE_V42_V42BIS 0x01
  153. #define DLC_MODEMPROT_DISABLE_MNP_MNP5 0x02
  154. #define DLC_MODEMPROT_REQUIRE_PROTOCOL 0x04
  155. #define DLC_MODEMPROT_DISABLE_V42_DETECT 0x08
  156. #define DLC_MODEMPROT_DISABLE_COMPRESSION 0x10
  157. #define DLC_MODEMPROT_REQUIRE_PROTOCOL_V34UP 0x20
  158. #define DLC_MODEMPROT_NO_PROTOCOL_IF_1200 0x01
  159. #define DLC_MODEMPROT_BUFFER_IN_V42_DETECT 0x02
  160. #define DLC_MODEMPROT_DISABLE_V42_SREJ 0x04
  161. #define DLC_MODEMPROT_DISABLE_MNP3 0x08
  162. #define DLC_MODEMPROT_DISABLE_MNP4 0x10
  163. #define DLC_MODEMPROT_DISABLE_MNP10 0x20
  164. #define DLC_MODEMPROT_NO_PROTOCOL_IF_V22BIS 0x40
  165. #define DLC_MODEMPROT_NO_PROTOCOL_IF_V32BIS 0x80
  166. #define DLC_MODEMPROT_BREAK_DISABLED 0x00
  167. #define DLC_MODEMPROT_BREAK_NORMAL 0x01
  168. #define DLC_MODEMPROT_BREAK_EXPEDITED 0x02
  169. #define DLC_MODEMPROT_BREAK_DESTRUCTIVE 0x03
  170. #define DLC_MODEMPROT_BREAK_CONFIG_MASK 0x03
  171. #define DLC_MODEMPROT_APPL_EARLY_CONNECT 0x01
  172. #define DLC_MODEMPROT_APPL_PASS_INDICATIONS 0x02
  173. /* ==========================================================
  174. CAI parameters used for the modem L1 configuration
  175. ========================================================== */
  176. /*
  177. Fields in assign CAI information element:
  178. <byte> length of information element
  179. <byte> info field and B-channel hardware
  180. <byte> rate adaptation bit rate
  181. <byte> async framing parameters
  182. <byte> reserved
  183. <word> packet length
  184. <byte> modem line taking options
  185. <byte> modem modulation negotiation parameters
  186. <byte> modem modulation options
  187. <byte> modem disabled modulations mask low
  188. <byte> modem disabled modulations mask high
  189. <byte> modem enabled modulations mask
  190. <word> modem min TX speed
  191. <word> modem max TX speed
  192. <word> modem min RX speed
  193. <word> modem max RX speed
  194. <byte> modem disabled symbol rates mask
  195. <byte> modem info options mask
  196. <byte> modem transmit level adjust
  197. <byte> modem speaker parameters
  198. <word> modem private debug config
  199. <struct> modem reserved
  200. <struct> v18 config parameters
  201. <struct> v18 probing sequence
  202. <struct> v18 probing message
  203. */
  204. #define DSP_CAI_HARDWARE_HDLC_64K 0x05
  205. #define DSP_CAI_HARDWARE_HDLC_56K 0x08
  206. #define DSP_CAI_HARDWARE_TRANSP 0x09
  207. #define DSP_CAI_HARDWARE_V110_SYNC 0x0c
  208. #define DSP_CAI_HARDWARE_V110_ASYNC 0x0d
  209. #define DSP_CAI_HARDWARE_HDLC_128K 0x0f
  210. #define DSP_CAI_HARDWARE_FAX 0x10
  211. #define DSP_CAI_HARDWARE_MODEM_ASYNC 0x11
  212. #define DSP_CAI_HARDWARE_MODEM_SYNC 0x12
  213. #define DSP_CAI_HARDWARE_V110_HDLCA 0x13
  214. #define DSP_CAI_HARDWARE_ADVANCED_VOICE 0x14
  215. #define DSP_CAI_HARDWARE_TRANSP_DTMF 0x16
  216. #define DSP_CAI_HARDWARE_DTMF_VOICE_ISDN 0x17
  217. #define DSP_CAI_HARDWARE_DTMF_VOICE_LOCAL 0x18
  218. #define DSP_CAI_HARDWARE_MASK 0x3f
  219. #define DSP_CAI_ENABLE_INFO_INDICATIONS 0x80
  220. #define DSP_CAI_RATE_ADAPTATION_300 0x00
  221. #define DSP_CAI_RATE_ADAPTATION_600 0x01
  222. #define DSP_CAI_RATE_ADAPTATION_1200 0x02
  223. #define DSP_CAI_RATE_ADAPTATION_2400 0x03
  224. #define DSP_CAI_RATE_ADAPTATION_4800 0x04
  225. #define DSP_CAI_RATE_ADAPTATION_9600 0x05
  226. #define DSP_CAI_RATE_ADAPTATION_19200 0x06
  227. #define DSP_CAI_RATE_ADAPTATION_38400 0x07
  228. #define DSP_CAI_RATE_ADAPTATION_48000 0x08
  229. #define DSP_CAI_RATE_ADAPTATION_56000 0x09
  230. #define DSP_CAI_RATE_ADAPTATION_7200 0x0a
  231. #define DSP_CAI_RATE_ADAPTATION_14400 0x0b
  232. #define DSP_CAI_RATE_ADAPTATION_28800 0x0c
  233. #define DSP_CAI_RATE_ADAPTATION_12000 0x0d
  234. #define DSP_CAI_RATE_ADAPTATION_1200_75 0x0e
  235. #define DSP_CAI_RATE_ADAPTATION_75_1200 0x0f
  236. #define DSP_CAI_RATE_ADAPTATION_MASK 0x0f
  237. #define DSP_CAI_ASYNC_PARITY_ENABLE 0x01
  238. #define DSP_CAI_ASYNC_PARITY_SPACE 0x00
  239. #define DSP_CAI_ASYNC_PARITY_ODD 0x02
  240. #define DSP_CAI_ASYNC_PARITY_EVEN 0x04
  241. #define DSP_CAI_ASYNC_PARITY_MARK 0x06
  242. #define DSP_CAI_ASYNC_PARITY_MASK 0x06
  243. #define DSP_CAI_ASYNC_ONE_STOP_BIT 0x00
  244. #define DSP_CAI_ASYNC_TWO_STOP_BITS 0x20
  245. #define DSP_CAI_ASYNC_CHAR_LENGTH_8 0x00
  246. #define DSP_CAI_ASYNC_CHAR_LENGTH_7 0x40
  247. #define DSP_CAI_ASYNC_CHAR_LENGTH_6 0x80
  248. #define DSP_CAI_ASYNC_CHAR_LENGTH_5 0xc0
  249. #define DSP_CAI_ASYNC_CHAR_LENGTH_MASK 0xc0
  250. #define DSP_CAI_MODEM_LEASED_LINE_MODE 0x01
  251. #define DSP_CAI_MODEM_4_WIRE_OPERATION 0x02
  252. #define DSP_CAI_MODEM_DISABLE_BUSY_DETECT 0x04
  253. #define DSP_CAI_MODEM_DISABLE_CALLING_TONE 0x08
  254. #define DSP_CAI_MODEM_DISABLE_ANSWER_TONE 0x10
  255. #define DSP_CAI_MODEM_ENABLE_DIAL_TONE_DET 0x20
  256. #define DSP_CAI_MODEM_USE_POTS_INTERFACE 0x40
  257. #define DSP_CAI_MODEM_FORCE_RAY_TAYLOR_FAX 0x80
  258. #define DSP_CAI_MODEM_NEGOTIATE_HIGHEST 0x00
  259. #define DSP_CAI_MODEM_NEGOTIATE_DISABLED 0x01
  260. #define DSP_CAI_MODEM_NEGOTIATE_IN_CLASS 0x02
  261. #define DSP_CAI_MODEM_NEGOTIATE_V100 0x03
  262. #define DSP_CAI_MODEM_NEGOTIATE_V8 0x04
  263. #define DSP_CAI_MODEM_NEGOTIATE_V8BIS 0x05
  264. #define DSP_CAI_MODEM_NEGOTIATE_MASK 0x07
  265. #define DSP_CAI_MODEM_GUARD_TONE_NONE 0x00
  266. #define DSP_CAI_MODEM_GUARD_TONE_550HZ 0x40
  267. #define DSP_CAI_MODEM_GUARD_TONE_1800HZ 0x80
  268. #define DSP_CAI_MODEM_GUARD_TONE_MASK 0xc0
  269. #define DSP_CAI_MODEM_DISABLE_RETRAIN 0x01
  270. #define DSP_CAI_MODEM_DISABLE_STEPUPDOWN 0x02
  271. #define DSP_CAI_MODEM_DISABLE_SPLIT_SPEED 0x04
  272. #define DSP_CAI_MODEM_DISABLE_TRELLIS 0x08
  273. #define DSP_CAI_MODEM_ALLOW_RDL_TEST_LOOP 0x10
  274. #define DSP_CAI_MODEM_DISABLE_FLUSH_TIMER 0x40
  275. #define DSP_CAI_MODEM_REVERSE_DIRECTION 0x80
  276. #define DSP_CAI_MODEM_DISABLE_V21 0x01
  277. #define DSP_CAI_MODEM_DISABLE_V23 0x02
  278. #define DSP_CAI_MODEM_DISABLE_V22 0x04
  279. #define DSP_CAI_MODEM_DISABLE_V22BIS 0x08
  280. #define DSP_CAI_MODEM_DISABLE_V32 0x10
  281. #define DSP_CAI_MODEM_DISABLE_V32BIS 0x20
  282. #define DSP_CAI_MODEM_DISABLE_V34 0x40
  283. #define DSP_CAI_MODEM_DISABLE_V90 0x80
  284. #define DSP_CAI_MODEM_DISABLE_BELL103 0x01
  285. #define DSP_CAI_MODEM_DISABLE_BELL212A 0x02
  286. #define DSP_CAI_MODEM_DISABLE_VFC 0x04
  287. #define DSP_CAI_MODEM_DISABLE_K56FLEX 0x08
  288. #define DSP_CAI_MODEM_DISABLE_X2 0x10
  289. #define DSP_CAI_MODEM_ENABLE_V29FDX 0x01
  290. #define DSP_CAI_MODEM_ENABLE_V33 0x02
  291. #define DSP_CAI_MODEM_DISABLE_2400_SYMBOLS 0x01
  292. #define DSP_CAI_MODEM_DISABLE_2743_SYMBOLS 0x02
  293. #define DSP_CAI_MODEM_DISABLE_2800_SYMBOLS 0x04
  294. #define DSP_CAI_MODEM_DISABLE_3000_SYMBOLS 0x08
  295. #define DSP_CAI_MODEM_DISABLE_3200_SYMBOLS 0x10
  296. #define DSP_CAI_MODEM_DISABLE_3429_SYMBOLS 0x20
  297. #define DSP_CAI_MODEM_DISABLE_TX_REDUCTION 0x01
  298. #define DSP_CAI_MODEM_DISABLE_PRECODING 0x02
  299. #define DSP_CAI_MODEM_DISABLE_PREEMPHASIS 0x04
  300. #define DSP_CAI_MODEM_DISABLE_SHAPING 0x08
  301. #define DSP_CAI_MODEM_DISABLE_NONLINEAR_EN 0x10
  302. #define DSP_CAI_MODEM_SPEAKER_OFF 0x00
  303. #define DSP_CAI_MODEM_SPEAKER_DURING_TRAIN 0x01
  304. #define DSP_CAI_MODEM_SPEAKER_TIL_CONNECT 0x02
  305. #define DSP_CAI_MODEM_SPEAKER_ALWAYS_ON 0x03
  306. #define DSP_CAI_MODEM_SPEAKER_CONTROL_MASK 0x03
  307. #define DSP_CAI_MODEM_SPEAKER_VOLUME_MIN 0x00
  308. #define DSP_CAI_MODEM_SPEAKER_VOLUME_LOW 0x04
  309. #define DSP_CAI_MODEM_SPEAKER_VOLUME_HIGH 0x08
  310. #define DSP_CAI_MODEM_SPEAKER_VOLUME_MAX 0x0c
  311. #define DSP_CAI_MODEM_SPEAKER_VOLUME_MASK 0x0c
  312. /* ==========================================================
  313. DCD/CTS State
  314. ========================================================== */
  315. #define MDM_WANT_CONNECT_B3_ACTIVE_I 0x01
  316. #define MDM_NCPI_VALID 0x02
  317. #define MDM_NCPI_CTS_ON_RECEIVED 0x04
  318. #define MDM_NCPI_DCD_ON_RECEIVED 0x08
  319. /* ==========================================================
  320. CAPI NCPI Constants
  321. ========================================================== */
  322. #define MDM_NCPI_ECM_V42 0x0001
  323. #define MDM_NCPI_ECM_MNP 0x0002
  324. #define MDM_NCPI_TRANSPARENT 0x0004
  325. #define MDM_NCPI_COMPRESSED 0x0010
  326. /* ==========================================================
  327. CAPI B2 Config Constants
  328. ========================================================== */
  329. #define MDM_B2_DISABLE_V42bis 0x0001
  330. #define MDM_B2_DISABLE_MNP 0x0002
  331. #define MDM_B2_DISABLE_TRANS 0x0004
  332. #define MDM_B2_DISABLE_V42 0x0008
  333. #define MDM_B2_DISABLE_COMP 0x0010
  334. /* ==========================================================
  335. CAPI B1 Config Constants
  336. ========================================================== */
  337. #define MDM_CAPI_DISABLE_RETRAIN 0x0001
  338. #define MDM_CAPI_DISABLE_RING_TONE 0x0002
  339. #define MDM_CAPI_GUARD_1800 0x0004
  340. #define MDM_CAPI_GUARD_550 0x0008
  341. #define MDM_CAPI_NEG_V8 0x0003
  342. #define MDM_CAPI_NEG_V100 0x0002
  343. #define MDM_CAPI_NEG_MOD_CLASS 0x0001
  344. #define MDM_CAPI_NEG_DISABLED 0x0000
  345. #endif