1
2
3
4
5
6
7
8
9
10
11 #ifndef _LINUX_SLIP_H
12 #define _LINUX_SLIP_H
13
14
15 #define SL_NRUNIT 4
16 #define SL_MTU 296
17 #define SL_BUF_SIZE 8192
18 #ifdef not_any_more
19 #define SL_RCV_SIZE 2048
20 #endif
21
22
23 #define END 0300
24 #define ESC 0333
25 #define ESC_END 0334
26 #define ESC_ESC 0335
27
28 struct sl_queue {
29 unsigned long data;
30 unsigned long head;
31 unsigned long tail;
32 struct wait_queue *proc_list;
33 unsigned char buf[SL_BUF_SIZE];
34 };
35
36 struct slip {
37 int inuse;
38 int line;
39 struct tty_struct *tty;
40 #if 0
41 struct device *dev;
42 #endif
43 unsigned int sending;
44 struct sl_queue rcv_queue;
45 char snd_buf[(SL_MTU*2)+4];
46 unsigned char xbuff[(SL_MTU * 2)];
47 int escape;
48 int received;
49 unsigned long sent;
50 unsigned long rcvd;
51 unsigned long errors;
52 };
53
54 #define SL_INC(a) ((a) = ((a)+1) & (SL_BUF_SIZE-1))
55 #define SL_DEC(a) ((a) = ((a)-1) & (SL_BUF_SIZE-1))
56 #define SL_EMPTY(a) ((a)->head == (a)->tail)
57 #define SL_LEFT(a) (((a)->tail-(a)->head-1)&(SL_BUF_SIZE-1))
58 #define SL_LAST(a) ((a)->buf[(SL_BUF_SIZE-1)&((a)->head-1)])
59 #define SL_FULL(a) (!SL_LEFT(a))
60 #define SL_CHARS(a) (((a)->head-(a)->tail)&(SL_BUF_SIZE-1))
61
62 extern int slip_init(struct ddi *dev);
63
64 #endif