home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / sxt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.1 KB  |  85 lines

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