home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / nsxt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.7 KB  |  102 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. #ifndef _SYS_NSXT_H
  11. #define _SYS_NSXT_H
  12.  
  13. #ident    "@(#)/usr/include/sys/nsxt.h.sl 1.1 4.0 12/08/90 515 AT&T-USL"
  14.  
  15. /*    nsxt.h: STREAMS SXT driver header */
  16.  
  17. /*
  18.  **    Multiplexed channels driver header
  19.  */
  20.  
  21. #define    SXTRACE        0        /* 1 to include tracing */
  22.  
  23. #define    MAXLINKS    32
  24. #define    CHAN(dev)    (dev&CHANMASK)
  25. #define    LINK(dev)    ((dev>>CHANBITS)&(0xff>>CHANBITS))
  26.  
  27. #if    (MAXPCHAN*MAXLINKS) > 256
  28.     ERROR -- product cannot be greater than minor(dev)
  29. #endif
  30.  
  31. /*
  32.  * Flags for virtual TTY channels
  33.  */
  34. #define    SXTCTL    1
  35. #define SXTBLK    2
  36. #define SXT_IOCTL 4
  37.  
  38. /*
  39.  * Flags for control channel
  40.  */
  41. #define WAITSW  2    /* M_CTL (+ others, maybe) queued waiting for ACK/NAK */
  42. #define SXTIOCWAIT 4    /* waiting for ACK/NAK on active virtual TTY */
  43.  
  44. struct Channel
  45. {
  46.     struct strtty    tty;        /* Virtual tty for this channel */
  47. };
  48.  
  49. typedef struct Channel *Ch_p;
  50.  
  51. struct Link
  52. {
  53.     struct strtty  *line;        /* Real tty for this link */
  54.     char        controllingtty;    /* the current top dog */
  55.     char        old;        /* Old line discipline for line */
  56.     char        nchans;        /* Number of channels allowed */
  57.     unsigned char    chanmask;    /* Allowable channel bits */
  58.     char        open;        /* Channel open bits */
  59.     char        xopen;        /* Exclusive open bits */
  60.     char        wpending;    /* pending writes/channel */
  61.     char        iblocked;    /* channels blocked for input */
  62.     char        oblocked;    /* channels blocked for output*/
  63.     char        lwchan;        /* Last channel written bit */
  64.     char        wrcnt;        /* Number of writes on last channel written */
  65.     dev_t        dev;        /* major and minor device # */
  66.     struct Channel    chans[1];    /* Array of channels for this link */
  67. };
  68.  
  69. typedef    struct Link *    Link_p;
  70.  
  71. /*
  72. **    Ioctl args
  73. */
  74.  
  75. #define    SXTIOCLINK    ('b'<<8)
  76. #define    SXTIOCTRACE    (SXTIOCLINK|1)
  77. #define    SXTIOCNOTRACE    (SXTIOCLINK|2)
  78. #define SXTIOCSWTCH    (SXTIOCLINK|3)
  79. #define    SXTIOCWF    (SXTIOCLINK|4)
  80. #define SXTIOCBLK    (SXTIOCLINK|5)
  81. #define SXTIOCUBLK    (SXTIOCLINK|6)
  82. #define SXTIOCSTAT    (SXTIOCLINK|7)
  83.  
  84.  
  85. /* the following structure is used for the SXTIOCSTAT ioctl call */
  86. struct sxtblock
  87. {
  88.     char    input;        /* channels blocked on input  */
  89.     char    output;        /* channels blocked on output */
  90. };
  91.  
  92.  
  93.  
  94. #define    t_link        t_dstat        /* Use dstat in real tty for linknumber */
  95.  
  96. #define    MAXPCHAN    8            /* Maximum channel number */
  97. #define    CHANBITS    3            /* Bits for channel number */
  98. #define    CHANMASK    07            /* 2**CHANBITS - 1 */
  99. #define    SXTHOG        2            /* Channel consecutive write limit */
  100.  
  101. #endif    /* _SYS_NSXT_H */
  102.