home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / modem / xpc401.zip / DATA.C < prev    next >
Text File  |  1987-04-22  |  5KB  |  138 lines

  1. /************************************************************************
  2.  * data.c - XPC external data module
  3.  * Copyright (C) 1987, Tymnet MDNSC
  4.  * All Rights Reserved
  5.  *
  6.  * SUMMARY:
  7.  *     This module contains external data declarations for the XPC Driver.
  8.  *
  9.  * REVISION HISTORY:
  10.  *
  11.  *   Date    Version  By    Purpose of Revision
  12.  * --------  ------- -----  ---------------------------------------------
  13.  * 03/04/87   4.00    All   Initial Draft
  14.  *
  15.  ************************************************************************/
  16. #include "stddef.h"
  17. #include "xpc.h"
  18. #include "device.h"
  19. #include "iocomm.h"
  20. #include "param.h"
  21. #include "timer.h"
  22.  
  23. /* channel and logical channel info structure arrays and pointers
  24.  * (uninitialized)
  25.  */
  26. CHNLINFO cis[NUM_CHNL];
  27. CHNLINFO *ap_pcis;
  28. LCIINFO lcis[NUM_CHNL];
  29.  
  30. /* comm info structure (uninitialized)
  31.  */
  32. COMMINFO comm_info;
  33. UWORD xmt_intcnt = 0;            /* Number of ticks since last
  34.                      * transmit interrupt.
  35.                      */
  36.  
  37. UBYTE prev_mdmstatus = 0;        /* previous modem status */
  38.  
  39. /* device status structure (uninitialized)
  40.  */
  41. DEVSTAT dev_stat;
  42.  
  43. /* port parameters current (uninitialized) and default (initialized) structures
  44.  */
  45. PORTPARAMS default_params = {(WORD)DEFAULT_BAUD,
  46.                  (WORD)DEFAULT_DATA,
  47.                  (WORD)DEFAULT_PARITY,
  48.                  (WORD)DEFAULT_STOP,
  49.                  (WORD)DEFAULT_XON,
  50.                  (WORD)DEFAULT_MODE};
  51. PORTPARAMS port_params;
  52.  
  53. /* declare the timer list array (initialized)
  54.  */
  55. TIMER *timer_lists[TIMER_TYPES] = {NULLTIM,
  56.                    NULLTIM, 
  57.                    NULLTIM};
  58.  
  59. /* application interface data
  60.  */
  61. UWORD app_sp;                /* driver stack pointer */
  62. UWORD app_ss;                /* driver stack segment */
  63. UWORD asave_sp;                /* saves application stack pointer */
  64. UWORD asave_ss;                /* saves application stack segment */
  65. UWORD in_application;            /* flag used to prevent reentrancy */
  66. UWORD param_block[15];            /* saves application parameter block */
  67.  
  68. /* driver load-time data
  69.  */
  70. UWORD app_ivec;                /* calling interrupt vector */
  71. UWORD aivec_cs;                /* saves old code segment */
  72. UWORD aivec_ip;                /* saves old instruction pointer */
  73.  
  74. /* external data used by the PAD interface
  75.  */
  76. BUFLET *pecho = NULLBUF;        /* pointer to echo buffer */
  77. BUFLET *ptrans = NULLBUF;        /* pointer to assembly xmit packet */
  78. INT numecho = 0;            /* number of echo bytes */
  79.  
  80. #ifdef DEBUG
  81. INT num_readbytes = 0;            /* number of bytes read */
  82. INT num_written = 0;            /* number of characters written */
  83. #endif
  84.             
  85. INT write_error = 0;            /* error occurred during write */
  86. UWORD numprc = NULLUWORD;        /* number of characters written */
  87. UWORD numreq = NULLUWORD;        /* number of characters requested */
  88. UWORD trans_idx = NULLUWORD;        /* index into xmit packet */
  89. WORD pend_inc_calls = NULLWORD;        /* number of pending incoming calls */
  90. WORD len_mult = 1;            /* multiplication variable used
  91.                      * for T25 and T27 timers.
  92.                      */
  93. /* external link data
  94.  */
  95. BUFLET *frame_pntr = 0;            /* pointer to frame */
  96. BOOL in_a_frame = NO;            /* frame pointer is currently in
  97.                      * a frame.
  98.                      */
  99. BOOL restart_flag = NO;            /* restart is being performed by
  100.                      * the link.
  101.                      */
  102. BYTE restart_clear_code = 0;        /* restart clear code */
  103. UWORD num_chars_inframe = 0;        /* the number of characters int
  104.                      * the current input packet.
  105.                      */
  106. UBYTE linkchnl = 0;            /* the logical channel number */
  107. UBYTE pkttype = 0;            /* the type of input packet */
  108. UBYTE restart_devmode = 0;        /* restart cause */
  109. BOOL app_active = NO;            /* the application is active */
  110. BOOL clear_pad = NO;            /* the application should clear 
  111.                      * the pad before exiting.
  112.                      */
  113.  
  114. /* miscellaneous data
  115.  */
  116. BOOL first_time = YES;            /* first time driver called if true */
  117. UBYTE app_chnl = NULLUBYTE;        /* application channel number */
  118. UBYTE log_chnl = NULLUBYTE;        /* logical channel number */
  119. UBYTE xpc_stack[XPC_STACK_LEN + 2];    /* xpc timer internal stack */
  120. UWORD free_count = NULLUWORD;        /* buflet free list count */
  121. UWORD rnr_buflets_req = BUFLET_LOWATER; /* number of buflets required 
  122.                      * before RNRing.
  123.                      */
  124. UWORD program_error = NULLUWORD;    /* internal program error flag */
  125. UWORD xpc_cs = NULLUWORD;        /* xpc driver code segment */
  126. WORD device_nbr = NULLWORD;        /* logical device number */
  127. WORD got_ints = NULLWORD;        /* iocomm diagnostic */
  128. WORD nbr_disables = NULLWORD;        /* interrupt disable nest count */
  129. BOOL xpc_timer_active = NO;        /* Should X.PC timer interrupt
  130.                      * handling pass control to LINK?
  131.                      */
  132. BOOL use_timer_int = YES;        /* Should Device Reset set and
  133.                      * reset the timer interrupt
  134.                      * vectors?
  135.                      */
  136.  
  137.  
  138.