home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / sxt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  2.3 KB  |  93 lines

  1. /*
  2.  *    @(#) sxt.h 2.1 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  **    Multiplexed channels driver header
  13.  */
  14.  
  15. #define    MAXLINKS    16
  16. #define    MAXPCHAN    8        /* Maximum channel number */
  17.  
  18. #define    CHANBITS    3        /* Bits for channel number */
  19. #define    CHANMASK    07        /* 2**CHANBITS - 1 */
  20.  
  21. #define    CHAN(dev)    (dev&CHANMASK)
  22. #define    LINK(dev)    ((dev>>CHANBITS)&(0xff>>CHANBITS))
  23.  
  24. #define    SXTHOG        2        /* Channel consecutive write limit */
  25. #define    SXTRACE        0        /* 1 to include tracing */
  26.  
  27. #if    (MAXPCHAN*MAXLINKS) > 256
  28.     ERROR -- product cannot be greater than minor(dev)
  29. #endif
  30.  
  31.  
  32. struct Channel
  33. {
  34.     struct tty    tty;        /* Virtual tty for this channel */
  35. };
  36.  
  37. typedef struct Channel *Ch_p;
  38.  
  39. struct Link
  40. {
  41.     struct tty *    line;        /* Real tty for this link */
  42.     char        controllingtty;    /* the current top dog */
  43.     char        old;        /* Old line discipline for line */
  44.     char        nchans;        /* Number of channels allowed */
  45.     unsigned char    chanmask;    /* Allowable channel bits */
  46.     char        open;        /* Channel open bits */
  47.     char        xopen;        /* Exclusive open bits */
  48.     char        wpending;    /* pending writes/channel */
  49.     char        iblocked;    /* channels blocked for input */
  50.     char        oblocked;    /* channels blocked for output*/
  51.     char        lwchan;        /* Last channel written bit */
  52.     char        wrcnt;        /* # of writes on last chan written */
  53.     dev_t        dev;        /* major and minor device # */
  54.     struct Channel    chans[MAXPCHAN]; /* Array of channels for this link */
  55. };
  56.  
  57. typedef    struct Link *    Link_p;
  58.  
  59. extern    struct Link sxtlink[];
  60.  
  61.  
  62. /*
  63. **    Ioctl args
  64. */
  65.  
  66. #define    SXTIOCLINK    ('b'<<8)
  67. #define    SXTIOCTRACE    (SXTIOCLINK|1)
  68. #define    SXTIOCNOTRACE    (SXTIOCLINK|2)
  69. #define SXTIOCSWTCH    (SXTIOCLINK|3)
  70. #define    SXTIOCWF    (SXTIOCLINK|4)
  71. #define SXTIOCBLK    (SXTIOCLINK|5)
  72. #define SXTIOCUBLK    (SXTIOCLINK|6)
  73. #define SXTIOCSTAT    (SXTIOCLINK|7)
  74.  
  75. /* the following structure is used for the SXTIOCSTAT ioctl call */
  76. #ifdef    M_I386
  77. #pragma    pack(2)
  78. #endif
  79.  
  80. struct sxtblock
  81. {
  82.     char    input;        /* channels blocked on input  */
  83.     char    output;        /* channels blocked on output */
  84. };
  85.  
  86. #ifdef    M_I386
  87. #pragma    pack()
  88. #endif
  89.  
  90.  
  91. #define    t_link    t_dstat        /* Use dstat in real tty for linknumber */
  92.  
  93.