| 1 | /* mx.h 4.3 81/02/25 */ |
| 2 | |
| 3 | #define NGROUPS 10 /* number of mpx files permitted at one time */ |
| 4 | #define NCHANS 20 /* number of channel structures */ |
| 5 | #define NPORTS 30 /* number of channels to i/o ports */ |
| 6 | #define CNTLSIZ 10 |
| 7 | #define NLEVELS 4 |
| 8 | #define NMSIZE 50 /* max size of mxlstn file name */ |
| 9 | |
| 10 | /* |
| 11 | * header returned on read of mpx |
| 12 | */ |
| 13 | struct rh { |
| 14 | short index; |
| 15 | short count; |
| 16 | short ccount; |
| 17 | }; |
| 18 | |
| 19 | /* |
| 20 | * head expected on write of mpx |
| 21 | */ |
| 22 | struct wh { |
| 23 | short index; |
| 24 | short count; |
| 25 | short ccount; |
| 26 | char *data; |
| 27 | }; |
| 28 | |
| 29 | struct mx_args { |
| 30 | char *m_name; |
| 31 | int m_cmd; |
| 32 | int m_arg[3]; |
| 33 | }; |
| 34 | |
| 35 | |
| 36 | #ifdef KERNEL |
| 37 | /* |
| 38 | * internal structure for channel |
| 39 | */ |
| 40 | |
| 41 | struct chan { |
| 42 | short c_flags; |
| 43 | char c_index; |
| 44 | char c_line; |
| 45 | struct group *c_group; |
| 46 | struct file *c_fy; |
| 47 | struct tty *c_ttyp; |
| 48 | struct clist c_ctlx; |
| 49 | int c_pgrp; |
| 50 | struct tty *c_ottyp; |
| 51 | char c_oline; |
| 52 | union { |
| 53 | struct clist datq; |
| 54 | } cx; |
| 55 | union { |
| 56 | struct clist datq; |
| 57 | struct chan *c_chan; |
| 58 | } cy; |
| 59 | struct clist c_ctly; |
| 60 | }; |
| 61 | |
| 62 | struct schan { |
| 63 | short c_flags; |
| 64 | char c_index; |
| 65 | char c_line; |
| 66 | struct group *c_group; |
| 67 | struct file *c_fy; |
| 68 | struct tty *c_ttyp; |
| 69 | struct clist c_ctlx; |
| 70 | int c_pgrp; |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | /* |
| 75 | * flags |
| 76 | */ |
| 77 | #define INUSE 01 |
| 78 | #define SIOCTL 02 |
| 79 | #define XGRP 04 |
| 80 | #define YGRP 010 |
| 81 | #define WCLOSE 020 |
| 82 | #define ISGRP 0100 |
| 83 | #define BLOCK 0200 |
| 84 | #define EOTMARK 0400 |
| 85 | #define SIGBLK 01000 |
| 86 | #define BLKMSG 01000 |
| 87 | #define ENAMSG 02000 |
| 88 | #define WFLUSH 04000 |
| 89 | #define NMBUF 010000 |
| 90 | #define PORT 020000 |
| 91 | #define ALT 040000 |
| 92 | #define FBLOCK 0100000 |
| 93 | |
| 94 | #endif |
| 95 | |
| 96 | /* |
| 97 | * mpxchan command codes |
| 98 | */ |
| 99 | #define MPX 5 |
| 100 | #define MPXN 6 |
| 101 | #define CHAN 1 |
| 102 | #define JOIN 2 |
| 103 | #define EXTR 3 |
| 104 | #define ATTACH 4 |
| 105 | #define CONNECT 7 |
| 106 | #define DETACH 8 |
| 107 | #define DISCON 9 |
| 108 | #define DEBUG 10 |
| 109 | #define NPGRP 11 |
| 110 | #define CSIG 12 |
| 111 | #define PACK 13 |
| 112 | |
| 113 | #define NDEBUGS 30 |
| 114 | /* |
| 115 | * control channel message codes |
| 116 | */ |
| 117 | #define M_WATCH 1 |
| 118 | #define M_CLOSE 2 |
| 119 | #define M_EOT 3 |
| 120 | #define M_OPEN 4 |
| 121 | #define M_BLK 5 |
| 122 | #define M_UBLK 6 |
| 123 | #define DO_BLK 7 |
| 124 | #define DO_UBLK 8 |
| 125 | #define M_IOCTL 12 |
| 126 | #define M_IOANS 13 |
| 127 | #define M_SIG 14 |
| 128 | |
| 129 | /* |
| 130 | * debug codes other than mpxchan cmds |
| 131 | */ |
| 132 | #define MCCLOSE 29 |
| 133 | #define MCOPEN 28 |
| 134 | #define ALL 27 |
| 135 | #define SCON 26 |
| 136 | #define MSREAD 25 |
| 137 | #define SDATA 24 |
| 138 | #define MCREAD 23 |
| 139 | #define MCWRITE 22 |
| 140 | /* mux io controls */ |
| 141 | #define MXLSTN (('x'<<8)|1) |
| 142 | #define MXNBLK (('x'<<8)|2) |