Leaked source code of windows server 2003
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.

128 lines
4.7 KiB

  1. /***************************************************************************
  2. Name : MODEMINT.H
  3. Comment :
  4. Functions: (see Prototypes just below)
  5. Copyright (c) Microsoft Corp. 1991, 1992, 1993
  6. Revision Log
  7. Date Name Description
  8. -------- ----- ---------------------------------------------------------
  9. ***************************************************************************/
  10. /**---------------------- #define of sizes of things ---------------------
  11. Frames can be at most 2.55 secs (sent) or 3.45 secs (recvd) long, or
  12. 2.55 * 300/8 = 96 bytes and 132 bytes long respectively
  13. Dialstrings are limited to 512 bytes (arbitrarily)
  14. Commands (except dial) are never more than about 10-20 bytes long, so
  15. we use a buffer of 40 bytes. Replies are never big at all, but we
  16. might hold a frame in there, so keep it same size as a Framebuffer
  17. The Dial command is ATDT <string><CR>, so we use 512+10 bytes buffer
  18. ---------------------- #define of sizes of things ---------------------**/
  19. #define MAXPHONESIZE 512
  20. #define DIALBUFSIZE MAXPHONESIZE + 10
  21. #define CR 0x0d
  22. #define LF 0x0a
  23. #define DLE 0x10 // DLE = ^P = 16d = 10h
  24. #define ETX 0x03
  25. // The following bunch of defines allow us to combine detection
  26. // with pre-read settings (from unimodem, say).
  27. #define fGOTCMD_Reset (0x1)
  28. #define fGOTCMD_Setup (0x1<<1)
  29. #define fGOTCMD_PreAnswer (0x1<<2)
  30. #define fGOTCMD_PreDial (0x1<<3)
  31. #define fGOTCMD_PreExit (0x1<<4)
  32. #define fGOTCMDS \
  33. fGOTCMD_Reset \
  34. | fGOTCMD_Setup \
  35. | fGOTCMD_PreAnswer \
  36. | fGOTCMD_PreDial \
  37. | fGOTCMD_PreExit
  38. #define fGOTCAP_CLASSES (0x1<<10)
  39. #define fGOTCAP_SENDSPEEDS (0x1<<11)
  40. #define fGOTCAP_RECVSPEEDS (0x1<<12)
  41. #define fGOTCAPS \
  42. fGOTCAP_CLASSES \
  43. | fGOTCAP_SENDSPEEDS \
  44. | fGOTCAP_RECVSPEEDS
  45. #define fGOTPARM_PORTSPEED (0x1<<20)
  46. #define fGOTPARM_IDCMD (0x1<<21)
  47. #define fGOTPARM_ID (0x1<<22)
  48. #define fGOTPARMS \
  49. fGOTPARM_PORTSPEED \
  50. | fGOTPARM_IDCMD \
  51. | fGOTPARM_ID
  52. #define fGOTIDS \
  53. fGOTPARM_IDCMD \
  54. | fGOTPARM_ID
  55. #define fGOTFLAGS (0x1<<23)
  56. // Following structure has stuff which should ideally go into
  57. // MODEMCAPS, but we can't change that at this state (11/94).
  58. extern BOOL fMegaHertzHack;
  59. // used for Resync type stuff. RepeatCount = 2
  60. // This has to be multi-line too, because echo could be on and
  61. // we could get the command echoed back instead of response!
  62. // Looks like even 330 is too short for some modems..
  63. // 550 is too short for Sharad's PP9600FXMT & things
  64. // can get really screwed up if this times out, so use
  65. // a nice large value
  66. #define iSyncModemDialog(pTG, s, l, w) \
  67. iiModemDialog(pTG, s, l, 990, TRUE, 2, TRUE, (CBPSTR)w, (CBPSTR)(NULL))
  68. // This version for dealing with possible NON-numeric responses as well...
  69. #define iSyncModemDialog2(pTG, s, l, w1, w2) \
  70. iiModemDialog(pTG, s, l, 990, TRUE, 2, TRUE, (CBPSTR)w1, (CBPSTR)w2, (CBPSTR)(NULL))
  71. // These are used for offline things, so we make them all (a) multiline
  72. // (b) long timeout (c) 2 tries and (d) make sure they all look for ERROR
  73. // as a response, to speed things up
  74. #define OfflineDialog2(pTG, s,l,w1,w2) iiModemDialog(pTG, s, l, 5000, TRUE, 2, TRUE, (CBPSTR)w1, (CBPSTR)w2, (CBPSTR)(NULL))
  75. #define GOCLASS2_0 3
  76. extern CBSZ cbszOK, cbszERROR;
  77. /****************** begin prototypes from modem.c *****************/
  78. SWORD iModemSync(PThrdGlbl pTG);
  79. SWORD iModemReset(PThrdGlbl pTG, CBPSTR szCmd);
  80. UWORD GetCap(PThrdGlbl pTG, CBPSTR cbpstrSend, UWORD uwLen);
  81. UWORD GetCapAux(PThrdGlbl pTG, CBPSTR cbpstrSend, UWORD uwLen);
  82. BOOL iModemGetCaps(PThrdGlbl pTG, LPMODEMCAPS lpMdmCaps,
  83. DWORD dwSpeed, LPSTR lpszReset, LPDWORD lpdwGot);
  84. BOOL iiModemGoClass(PThrdGlbl pTG, USHORT uClass, DWORD dwSpeed);
  85. /***************** end of prototypes from modem.c *****************/
  86. /****************** begin prototypes from identify.c *****************/
  87. USHORT iModemGetCmdTab(PThrdGlbl pTG, LPCMDTAB lpCmdTab, LPMODEMCAPS lpMdmCaps);
  88. USHORT iModemInstall(PThrdGlbl pTG, BOOL fDontPurge);
  89. USHORT iModemFigureOutCmds(PThrdGlbl pTG, LPCMDTAB lpCmdTab);
  90. USHORT iModemGetWriteCaps(PThrdGlbl pTG);
  91. /***************** end of prototypes from identify.c *****************/