home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) sxt.h 2.1 88/05/18
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- ** Multiplexed channels driver header
- */
-
- #define MAXLINKS 16
- #define MAXPCHAN 8 /* Maximum channel number */
-
- #define CHANBITS 3 /* Bits for channel number */
- #define CHANMASK 07 /* 2**CHANBITS - 1 */
-
- #define CHAN(dev) (dev&CHANMASK)
- #define LINK(dev) ((dev>>CHANBITS)&(0xff>>CHANBITS))
-
- #define SXTHOG 2 /* Channel consecutive write limit */
- #define SXTRACE 0 /* 1 to include tracing */
-
- #if (MAXPCHAN*MAXLINKS) > 256
- ERROR -- product cannot be greater than minor(dev)
- #endif
-
-
- struct Channel
- {
- struct tty tty; /* Virtual tty for this channel */
- };
-
- typedef struct Channel *Ch_p;
-
- struct Link
- {
- struct tty * line; /* Real tty for this link */
- char controllingtty; /* the current top dog */
- char old; /* Old line discipline for line */
- char nchans; /* Number of channels allowed */
- unsigned char chanmask; /* Allowable channel bits */
- char open; /* Channel open bits */
- char xopen; /* Exclusive open bits */
- char wpending; /* pending writes/channel */
- char iblocked; /* channels blocked for input */
- char oblocked; /* channels blocked for output*/
- char lwchan; /* Last channel written bit */
- char wrcnt; /* # of writes on last chan written */
- dev_t dev; /* major and minor device # */
- struct Channel chans[MAXPCHAN]; /* Array of channels for this link */
- };
-
- typedef struct Link * Link_p;
-
- extern struct Link sxtlink[];
-
-
- /*
- ** Ioctl args
- */
-
- #define SXTIOCLINK ('b'<<8)
- #define SXTIOCTRACE (SXTIOCLINK|1)
- #define SXTIOCNOTRACE (SXTIOCLINK|2)
- #define SXTIOCSWTCH (SXTIOCLINK|3)
- #define SXTIOCWF (SXTIOCLINK|4)
- #define SXTIOCBLK (SXTIOCLINK|5)
- #define SXTIOCUBLK (SXTIOCLINK|6)
- #define SXTIOCSTAT (SXTIOCLINK|7)
-
- /* the following structure is used for the SXTIOCSTAT ioctl call */
- #ifdef M_I386
- #pragma pack(2)
- #endif
-
- struct sxtblock
- {
- char input; /* channels blocked on input */
- char output; /* channels blocked on output */
- };
-
- #ifdef M_I386
- #pragma pack()
- #endif
-
-
- #define t_link t_dstat /* Use dstat in real tty for linknumber */
-
-