Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

301 lines
11 KiB

  1. /***************************************************************************
  2. Name : MODEMDDI.H
  3. Comment : Interface for Modem/NCU DDI
  4. Revision Log
  5. Date Name Description
  6. -------- ----- ---------------------------------------------------------
  7. ***************************************************************************/
  8. #ifndef _MODEMDDI_
  9. #define _MODEMDDI_
  10. #include <ncuparm.h>
  11. typedef struct {
  12. USHORT uSize; // of this structure
  13. USHORT uNumLines, uNumFaxModems, uNumDataModems, uNumHandsets;
  14. BOOL fToneDial, fPulseDial;
  15. } NCUCONFIG, far* LPNCUCONFIG;
  16. /******************** Not Used *************************
  17. typedef struct {
  18. USHORT uErrorCode, uErrorFlags, uExtErrorCode, uWarning;
  19. } MODEMSTATUS, far* LPMODEMSTATUS;
  20. #define MODEMERR_OK 0
  21. #define MODEMERR_TIMEOUT 1
  22. #define MODEMERR_HARDWARE 2
  23. #define MODEMERR_OVERRUN 3
  24. #define MODEMERR_DEADMAN 4
  25. #define MODEMERR_COMPORT 5
  26. #define MODEMERR_BUG 6
  27. #define MODEMERR_RESOURCES 7
  28. #define MODEMERR_BADPARAM 8
  29. #define MODEMERR_UNDERRUN 11
  30. #define MODEMERR_BADCOMMAND 12
  31. #define MODEMERR_BADCRC 13
  32. #define MODEMERRFLAGS_FATAL 2
  33. #define MODEMERRFLAGS_TRANSIENT 1
  34. #define MODEMWARNING_UNDERRUN 1
  35. // Tone generation etc
  36. #define TONE_CED 1
  37. #define TONE_CNG 2
  38. **************************************************************/
  39. typedef struct {
  40. USHORT uSize, uClasses, uSendSpeeds, uRecvSpeeds;
  41. USHORT uHDLCSendSpeeds, uHDLCRecvSpeeds;
  42. } MODEMCAPS, far* LPMODEMCAPS;
  43. // uClasses is one or more of the below
  44. #define FAXCLASS0 0x01
  45. #define FAXCLASS1 0x02
  46. #define FAXCLASS2 0x04
  47. #define FAXCLASS2_0 0x08 // Class4==0x10
  48. // uSendSpeeds, uRecvSpeeds, uHDLCSendSpeeds and uHDLCRecvSpeeds
  49. // are one or more of the below. If V27 is provided
  50. // at 2400bps *only*, then V27 is *not* set
  51. // V27 2400 (nonHDLC) is always assumed
  52. #define V27 2 // V27ter capability at 4800 bps
  53. #define V29 1 // V29 at 7200 & 9600 bps
  54. #define V33 4 // V33 at 12000 & 14400 bps
  55. #define V17 8 // V17 at 7200 thru 14400 bps
  56. #define V27_V29_V33_V17 11 // 15 --> 11 in T30speak
  57. // used only in selecting modulation -- not in capability
  58. // #define V21 7 // V21 ch2 at 300bps
  59. // #define V27_FALLBACK 32 // V27ter capability at 2400 bps
  60. // various calls return & use these
  61. //typedef HANDLE HLINE;
  62. //typedef HANDLE HCALL;
  63. typedef HANDLE HMODEM;
  64. // NCUModemInit returns these
  65. #define INIT_OK 0
  66. #define INIT_INTERNAL_ERROR 13
  67. #define INIT_MODEMERROR 15
  68. #define INIT_PORTBUSY 16
  69. #define INIT_MODEMDEAD 17
  70. #define INIT_GETCAPS_FAIL 18
  71. #define INIT_USERCANCEL 19
  72. // NCUCheckRing and NCUCheckHandset returns one of these
  73. #define NCUSTATUS_IDLE 0
  74. #define NCUSTATUS_RINGING 1
  75. #define NCUSTATUS_BUSY 2
  76. #define NCUSTATUS_OFFHOOK 3
  77. #define NCUSTATUS_NODIALTONE 4
  78. #define NCUSTATUS_ERROR 5
  79. // NCULink takes one of these flags (mutually exclusive)
  80. #define NCULINK_HANGUP 0
  81. #define NCULINK_TX 1
  82. #define NCULINK_RX 2
  83. #define NCULINK_OFFHOOK 3
  84. #define NCULINK_MODEMASK 0x7
  85. // and this flag may be added along with NCULINK_RX
  86. #define NCULINK_IMMEDIATE 16 // don't wait for NCUParams.RingsBeforeAnswer
  87. // NCUDial(and iModemDial), NCUTxDigit, ModemConnectTx and ModemConnectRx return one of
  88. #define CONNECT_TIMEOUT 0
  89. #define CONNECT_OK 1
  90. #define CONNECT_BUSY 2
  91. #define CONNECT_NOANSWER 3
  92. #define CONNECT_NODIALTONE 4
  93. #define CONNECT_ERROR 5
  94. #define CONNECT_HANGUP 6
  95. // NCULink (and iModemAnswer) returns one of the following (or OK or ERROR)
  96. #define CONNECT_RING_ERROR 7 // was ringing when tried NCULINK_TX
  97. #define CONNECT_NORING_ERROR 8 // was not ringing when tried NCULINK_RX
  98. #define CONNECT_RINGEND_ERROR 9 // stopped ringing before
  99. // NCUParams.RingsBeforeAnswer count was
  100. // was reached when tried NCULINK_RX
  101. /////// SUPPORT FOR ADAPTIVE ANSWER ////////
  102. #define CONNECT_WRONGMODE_DATAMODEM 10 // We're connected as a datamodem.
  103. ///////////////////////// Ricoh Only /////////////////////////////////
  104. // ModemConnectTx() and ModemConnectRx() can take this flag.
  105. // ModemConnectTx: When this flag is set, if it detects CED, it begins
  106. // transmitting 800Hz tone and immediately returns (before
  107. // tone transmission completes) the return value CONNECT_ESCAPE
  108. // ModemConnectRx: When this flag is set, it enables 800Hz tone detection
  109. // If the tone is detected, then the return value is CONNECT_ESCAPE
  110. #define RICOHAI_MODE 128
  111. // ModemConnectRx() and ModemConnectTx() can also return the following
  112. // when 800Hz tone is detected or transmitted
  113. #define CONNECT_ESCAPE 128
  114. ///////////////////////// Ricoh Only /////////////////////////////////
  115. // ModemOpen and ModemGetCaps take one of these for uType
  116. #define MODEM_FAX 1
  117. #define MODEM_DATA 2
  118. // SendMode and RecvMode take one of these for uModulation
  119. #define V21_300 7 // used an arbitary vacant slot
  120. #define V27_2400 0
  121. #define V27_4800 2
  122. #define V29_9600 1
  123. #define V29_7200 3
  124. #define V33_14400 4
  125. #define V33_12000 6
  126. #define V17_START 8 // every code above this is considered V17
  127. #define V17_14400 8
  128. #define V17_12000 10
  129. #define V17_9600 9
  130. #define V17_7200 11
  131. #define ST_FLAG 0x10
  132. #define V17_14400_ST (V17_14400 | ST_FLAG)
  133. #define V17_12000_ST (V17_12000 | ST_FLAG)
  134. #define V17_9600_ST (V17_9600 | ST_FLAG)
  135. #define V17_7200_ST (V17_7200 | ST_FLAG)
  136. // SendMem take one one or more of these for uFlags
  137. // SEND_ENDFRAME must _always_ be TRUE in HDLC mode
  138. // (partial frames are no longer supported)
  139. #define SEND_FINAL 1
  140. #define SEND_ENDFRAME 2
  141. // #define SEND_STUFF 4
  142. // RecvMem and RecvMode return one these
  143. #define RECV_OK 0
  144. #define RECV_ERROR 1
  145. #define RECV_TIMEOUT 2
  146. #define RECV_WRONGMODE 3 // only Recvmode returns this
  147. #define RECV_EOF 8
  148. #define RECV_BADFRAME 16
  149. // Min modem recv buffer size. Used for all recvs
  150. // For IFAX30: *All* RecvMem calls will be called with exactly this size
  151. #define MIN_RECVBUFSIZE 265
  152. // Max phone number size passed into NCUDial
  153. #define MAX_PHONENUM_LEN 60
  154. /**-- may be used in ModemSendMode ----**/
  155. #define ifrDIS 1
  156. #define ifrCSI 2
  157. #define ifrNSF 3
  158. #define ifrDTC 4
  159. #define ifrCIG 5
  160. #define ifrNSC 6
  161. #define ifrDCS 7
  162. #define ifrTSI 8
  163. #define ifrNSS 9
  164. #define ifrCFR 10
  165. #define ifrFTT 11
  166. #define ifrMPS 12
  167. #define ifrEOM 13
  168. #define ifrEOP 14
  169. #define ifrPWD 15
  170. #define ifrSEP 16
  171. #define ifrSUB 17
  172. #define ifrMCF 18
  173. #define ifrRTP 19
  174. #define ifrRTN 20
  175. #define ifrPIP 21
  176. #define ifrPIN 22
  177. #define ifrDCN 23
  178. #define ifrCRP 24
  179. #define ifrPRI_MPS 25
  180. #define ifrPRI_EOM 26
  181. #define ifrPRI_EOP 27
  182. #define ifrCTC 28
  183. #define ifrCTR 29
  184. #define ifrRR 30
  185. #define ifrPPR 31
  186. #define ifrRNR 32
  187. #define ifrERR 33
  188. #define ifrPPS_NULL 34
  189. #define ifrPPS_MPS 35
  190. #define ifrPPS_EOM 36
  191. #define ifrPPS_EOP 37
  192. #define ifrPPS_PRI_MPS 38
  193. #define ifrPPS_PRI_EOM 39
  194. #define ifrPPS_PRI_EOP 40
  195. #define ifrEOR_NULL 41
  196. #define ifrEOR_MPS 42
  197. #define ifrEOR_EOM 43
  198. #define ifrEOR_EOP 44
  199. #define ifrEOR_PRI_MPS 45
  200. #define ifrEOR_PRI_EOM 46
  201. #define ifrEOR_PRI_EOP 47
  202. // don't use these values
  203. // #define ifrMAX 48
  204. // #define ifrBAD 49
  205. // #define ifrTIMEOUT 50
  206. // #define ifrERROR 51
  207. /**-- may be used in ModemSendMode and ModemRecvMode ----**/
  208. #define ifrTCF 55
  209. // #define ifrPIX 56 // not used anymore
  210. #define ifrECMPIX 57
  211. #define ifrPIX_MH 67
  212. #define ifrPIX_MR 68
  213. #define ifrPIX_SWECM 69
  214. /**-- may be used in ModemRecvMode ----**/
  215. // each value corresponds to one of the "Response Recvd" and
  216. // "Command Recvd" boxes in the T30 flowchart.
  217. #define ifrPHASEBresponse 58 // receiver PhaseB
  218. #define ifrTCFresponse 59 // sender after sending TCF
  219. #define ifrPOSTPAGEresponse 60 // sender after sending MPS/EOM/EOP
  220. #define ifrPPSresponse 61 // sender after sending PPS-Q
  221. #define ifrCTCresponse 62 // sender after sending RR
  222. #define ifrRRresponse 63 // sender after sending RR
  223. #define ifrPHASEBcommand 64 // sender PhaseB
  224. #define ifrNODEFcommand 65 // receiver main loop (Node F)
  225. #define ifrRNRcommand 66 // receiver after sending RNR
  226. #define ifrEORresponse 70
  227. #define ifrNODEFafterWRONGMODE 71 // hint for RecvMode after WRONGMODE
  228. #define ifrEOFfromRECVMODE 72 // GetCmdResp retval if RecvMode returns EOF
  229. #define ifrEND 73 // Max legal values (not incl this one)
  230. // messages posted by NCUHandsetNotif and NCURingNotif
  231. #define IF_MODEM_START (IF_START+0x321)
  232. #define IF_MODEM_END (IF_START+0x325)
  233. #define IF_NCU_RING (IF_MODEM_START + 0x00)
  234. #define IF_NCU_HANDSET (IF_MODEM_START + 0x01)
  235. #endif //_MODEMDDI_