home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / sxt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.3 KB  |  87 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10.  
  11. #ident    "@(#)/usr/include/sys/sxt.h.sl 1.1 4.0 12/08/90 59211 AT&T-USL"
  12.  
  13. /*
  14.  **    Multiplexed channels driver header
  15.  */
  16.  
  17. #define    SXTRACE        1        /* 1 to include tracing */
  18.  
  19. #define    MAXLINKS    32
  20. #define    CHAN(dev)    (dev&CHANMASK)
  21. #define    LINK(dev)    ((dev>>CHANBITS)&(0xff>>CHANBITS))
  22.  
  23.  
  24. #if    (MAXPCHAN*MAXLINKS) > 256
  25.     ERROR -- product cannot be greater than minor(dev)
  26. #endif
  27.  
  28.  
  29.  
  30. struct Channel
  31. {
  32.     struct tty    tty;        /* Virtual tty for this channel */
  33. };
  34.  
  35. typedef struct Channel *Ch_p;
  36.  
  37. struct Link
  38. {
  39.     struct tty *    line;        /* Real tty for this link */
  40.     char        controllingtty;    /* the current top dog */
  41.     char        old;        /* Old line discipline for line */
  42.     char        nchans;        /* Number of channels allowed */
  43.     unsigned char    chanmask;    /* Allowable channel bits */
  44.     char        open;        /* Channel open bits */
  45.     char        xopen;        /* Exclusive open bits */
  46.     char        wpending;    /* pending writes/channel */
  47.     char        iblocked;    /* channels blocked for input */
  48.     char        oblocked;    /* channels blocked for output*/
  49.     short        lwchan;        /* Last channel written bit */
  50.     char        wrcnt;        /* Number of writes on last channel written */
  51.     dev_t        dev;        /* major and minor device # */
  52.     struct Channel    chans[1];    /* Array of channels for this link */
  53. };
  54.  
  55. typedef    struct Link *    Link_p;
  56.  
  57. /*
  58. **    Ioctl args
  59. */
  60.  
  61. #define    SXTIOCLINK    ('b'<<8)
  62. #define    SXTIOCTRACE    (SXTIOCLINK|1)
  63. #define    SXTIOCNOTRACE    (SXTIOCLINK|2)
  64. #define SXTIOCSWTCH    (SXTIOCLINK|3)
  65. #define    SXTIOCWF    (SXTIOCLINK|4)
  66. #define SXTIOCBLK    (SXTIOCLINK|5)
  67. #define SXTIOCUBLK    (SXTIOCLINK|6)
  68. #define SXTIOCSTAT    (SXTIOCLINK|7)
  69.  
  70.  
  71.  
  72. /* the following structure is used for the SXTIOCSTAT ioctl call */
  73. struct sxtblock
  74. {
  75.     char    input;        /* channels blocked on input  */
  76.     char    output;        /* channels blocked on output */
  77. };
  78.  
  79.  
  80.  
  81. #define    t_link        t_dstat        /* Use dstat in real tty for linknumber */
  82.  
  83. #define    MAXPCHAN    8            /* Maximum channel number */
  84. #define    CHANBITS    3            /* Bits for channel number */
  85. #define    CHANMASK    07            /* 2**CHANBITS - 1 */
  86. #define    SXTHOG        2            /* Channel consecutive write limit */
  87.