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.

130 lines
5.6 KiB

  1. /***************************************************************************
  2. Name : T30.H
  3. Comment : Main include file for T30 driver.
  4. All common structire defns etc.
  5. Functions: (see Prototypes just below)
  6. Revision Log
  7. Date Name Description
  8. -------- ----- ---------------------------------------------------------
  9. ***************************************************************************/
  10. #include "timeouts.h"
  11. /**---------------------- #define of sizes of things ---------------------
  12. Frames can be at most 2.55 secs (sent) or 3.45 secs (recvd) long, or
  13. 2.55 * 300/8 = 96 bytes and 132 bytes long respectively
  14. For clumps of received frames, we collect them in a GlobalAlloced
  15. space for passing to teh WhatNext callback function. We arbitrarily
  16. decide to allow at most 10 frames and at most 500 bytes at a time.
  17. (500 bytes = 500/(300/8) = 13.33 secs, so that should be quite enough)
  18. ---------------------- #define of sizes of things ---------------------**/
  19. //#define ECM_TOTALFRAMESIZE (ECM_FRAME_SIZE + 4)
  20. // Used for calling ModemSync(). The shorter one during calls,
  21. // the longer one only on hangup and stuff
  22. #define RESYNC_TIMEOUT1 1100
  23. #define RESYNC_TIMEOUT2 500
  24. // This are way too long. We have built-in delays anyway, so don't need
  25. // the full time, and the recvrs have to recv from other fax machines
  26. // so take it easy here
  27. // #define PHASEC_PAUSE 100 // how long to pause before TCF/phase C
  28. #define RECV_PHASEC_PAUSE 55 // used by RecvSil() before TCF/phase C
  29. // ModemRecvSilence() always waits a bit longer than the amount requested
  30. // so to get it right we ask for the minimum required, i.e. 55ms
  31. // However ModemSendSilence() is pretty accurate, so ask for teh exact
  32. // nominal amount, i.e. 75ms
  33. // How long to try for AT+FRM before timing out and trying
  34. // for an AT+FRH instead. Must be 100% *sure* to get page if there
  35. // is one, because there's no recovery after missing that. But must
  36. // also be sure to get the 2nd CTC if there is one.
  37. // Other critical situations:- MCF is missed, and sender resends MPS
  38. // We miss this because we're in FRM, but we mustn't miss the 3rd one!
  39. // Ditto with DCS-TCF-missedCFR. Can't get 2nd, but we'll get 3rd
  40. // #define PHASEC_TIMEOUT 2800L // 2.8s
  41. // increase this to 3200. Limit is 3550, but we need 200ms or so to restart
  42. // receiving FRH=3
  43. //#define PHASEC_TIMEOUT 3300L // 3.3s
  44. // increase this to 5 seconds
  45. // it appears fax macines accept this delay before entering phase C
  46. #define PHASEC_TIMEOUT 5000L
  47. // How long to try for AT+FRM in TCF before timing out and trying
  48. // +FRH. Mustn't miss TCF, but if we do, must catch next DCS
  49. // increase this to 3200. Limit is 3550, but we need 200ms or so to restart
  50. // receiving FRH=3
  51. #define TCF_TIMEOUT 3300L // 3.3s
  52. // don't need this one. Besides don't want to send it at startup when
  53. // we're already transmitting HDLC. This can cause problems, if we already
  54. // have a delay (example after TCF, sending CFR. Delay is now 115, it will
  55. // become 180 or so).
  56. // #define LOWSPEED_PAUSE 60 // how long to pause before HDLC
  57. // reduce this too
  58. #define RECV_LOWSPEED_PAUSE 55 // used by RecvSil() before HDLC
  59. // ModemRecvSilence() always waits a bit longer than the amount requested
  60. // so to get it right we ask for the minimum required, i.e. 55ms
  61. // However ModemSendSilence() is pretty accurate, so ask for teh exact
  62. // nominal amount, i.e. 75ms
  63. // How long of silence to look for before sending V.21. (IFAX/MDDI only)
  64. // Use LOWSPEED_PAUSE defined above.
  65. // How long of silence to look for before sending PhaseC. (IFAX/MDDI only)
  66. // use 40ms or more (want to be pretty sure we got silenec)
  67. // ---> we use PHASEC_PAUSE which is OK
  68. // How long to look for silence before sending high-speed.
  69. // If this fails we go ahead and send anyway, so we don't want
  70. // it too long. But we want to try pretty hard to get silence,
  71. // because otherwise the other side will miss my training.
  72. // 3secs is about how long a NSF-DIS takes. If we hit one
  73. // we want to wait until it's done, not timeout??
  74. #define LONG_RECVSILENCE_TIMEOUT 3000 // how long to wait for silence before send HDLC or PIX
  75. // when sending DIS, DCS or DTC we may collide with DCS, DIS or DIS coming
  76. // from the other side. This can be really long (preamble+2NSFs+CSI+DIS > 5secs)
  77. // so wait for upto 6 secs (preamble + 150+ bytes)
  78. #define REALLY_LONG_RECVSILENCE_TIMEOUT 6000 // how long to wait for silence before send DIS/DCS/DTC
  79. #define ECHOPROTECT(ifr, mode) { pTG->EchoProtect.ifrLastSent=ifr; pTG->EchoProtect.modePrevRecv=mode; pTG->EchoProtect.fGotWrongMode=0; }
  80. extern USHORT TCFLen[];
  81. #define GetResponse(pTG, ifr) GetCmdResp(pTG, FALSE, ifr)
  82. #define GetCommand(pTG, ifr) GetCmdResp(pTG, TRUE, ifr)
  83. /****************** begin prototypes from hdlc.c *****************/
  84. USHORT ModemRecvBuf(PThrdGlbl pTG, LPBUFFER far* lplpbf, ULONG ulTimeout);
  85. /***************** end of prototypes from hdlc.c *****************/
  86. /****************** begin prototypes from t30.c *****************/
  87. IFR GetCmdResp(PThrdGlbl pTG, BOOL fCommand, USHORT ifrResp);
  88. /***************** end of prototypes from t30.c *****************/
  89. /****************** begin prototypes from t30main.c *****************/
  90. USHORT T30MainBody(PThrdGlbl pTG, BOOL fCaller);
  91. /***************** end of prototypes from t30main.c *****************/