Bell 32V development
[unix-history] / usr / include / sys / pack.h
CommitLineData
26415b64
TL
1struct pack {
2 short p_state; /* line state */
3 short p_bits; /* mask for getepack */
4 short p_psize; /* packet size */
5 short p_icount; /* input byte count */
6 char p_ostate; /* output state */
7 char p_istate; /* input state */
8 char p_msgs; /* # cntl msgs sent */
9 char p_window; /* window size */
10 char p_iseq; /* input SEQ byte */
11 char p_oseq; /* output SEQ byte */
12 char p_msg; /* control msg */
13 char p_msg2; /* extra msg bits */
14 char p_ps,p_pr; /* last packet sent, recv'd */
15 char p_rps,p_rpr; /* remote (received) ps and pr */
16 char p_nxtps; /* next output seq number */
17 char p_nxtpr; /* expected input seq number */
18 char p_prcopy; /* oldest received packet in kernel */
19 char p_pscopy; /* newest output packet */
20 char *p_input; /* points into input buffer */
21 char p_iobuf[6]; /* cntl packet buffer */
22 char *p_ob[8]; /* output buffers */
23 char *p_ib[8]; /* input buffers */
24 char p_bstate[8]; /* output buffer status */
25 char p_cstate[8]; /* input buffer status */
26 short p_checks[8];
27 short p_rcheck;
28 struct tty *p_ttyp;
29 int p_timer;
30 int xcount,rcount;
31};
32#define NPSTRUCT (1+(sizeof(struct pack))/64)
33#define NPERBUF (8/NPSTRUCT)
34#define CHECK 0125252
35
36int npbits;
37
38/*
39 * driver state
40 */
41#define DEAD 0
42#define INITa 1
43#define INITb 2
44#define ISINIT 3
45#define LIVE 4
46#define RESYNC 010
47#define DOWN 020
48#define RREJ 040
49#define RXMIT 0100
50#define PDEBUG 0200
51#define DRAINO 0400
52#define WAITO 01000
53
54/*
55 * input side states
56 */
57#define P_IDLE 1
58#define P_SCAN 2
59#define P_SEQ1 3
60#define P_PACK 4
61#define P_CHK1 5
62#define P_CHK2 6
63#define P_SEQ2 7
64#define P_FLUSH 8
65
66#define SYN 026
67
68/*
69 * output side states
70 */
71#define T_IDLE 0
72#define T_READY 1
73#define T_HDR 2
74#define T_PACK 3
75#define T_TAIL 4
76
77/*
78 * io buffer states
79 */
80#define B_FREE 0
81#define B_READY 1
82#define B_SENT 2
83#define B_PACK 4
84#define B_COPY 010
85#define B_XMIT 020
86
87/*
88 * frame control messages
89 */
90#define RR 1
91#define RWR 2
92#define REJ 3
93#define CLOSE 4
94#define RESET 6
95#define INIT 7
96#define UA 8
97
98
99
100
101#define PKOPRI 31
102#define PKIPRI 30
103
104#define NPLINES 8
105
106/*
107 * packet ioctl buf
108 */
109struct piocb {
110 unsigned t;
111 short psize;
112 short mode;
113 short state;
114 char window;
115};