1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _LINUX_SLIP_H
19 #define _LINUX_SLIP_H
20
21 #include <linux/config.h>
22
23 #if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
24 # define SL_INCLUDE_CSLIP
25 #endif
26
27 #ifdef SL_INCLUDE_CSLIP
28 # define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
29 #else
30 # define SL_MODE_DEFAULT SL_MODE_SLIP
31 #endif
32
33
34 #ifndef SL_SLIP_LOTS
35 #define SL_NRUNIT 4
36 #else
37 #define SL_NRUNIT 16
38 #endif
39 #define SL_MTU 296
40
41
42 #define END 0300
43 #define ESC 0333
44 #define ESC_END 0334
45 #define ESC_ESC 0335
46
47
48 struct slip {
49 int magic;
50
51
52 struct tty_struct *tty;
53 struct device *dev;
54 #ifdef SL_INCLUDE_CSLIP
55 struct slcompress *slcomp;
56 unsigned char *cbuff;
57 #endif
58
59
60 unsigned char *rbuff;
61 int rcount;
62 unsigned char *xbuff;
63 unsigned char *xhead;
64 int xleft;
65
66
67 unsigned long rx_packets;
68 unsigned long tx_packets;
69 unsigned long rx_errors;
70 unsigned long tx_errors;
71 unsigned long rx_dropped;
72 unsigned long tx_dropped;
73 unsigned long rx_over_errors;
74 #ifdef SL_INCLUDE_CSLIP
75 unsigned long tx_compressed;
76 unsigned long rx_compressed;
77 unsigned long tx_misses;
78 #endif
79
80
81 int mtu;
82 int buffsize;
83
84 #ifdef CONFIG_SLIP_MODE_SLIP6
85 int xdata, xbits;
86 #endif
87
88 unsigned char flags;
89 #define SLF_INUSE 0
90 #define SLF_ESCAPE 1
91 #define SLF_ERROR 2
92
93 unsigned char mode;
94 #define SL_MODE_SLIP 0
95 #define SL_MODE_CSLIP 1
96 #define SL_MODE_SLIP6 2
97 #define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
98 #define SL_MODE_AX25 4
99 #define SL_MODE_ADAPTIVE 8
100 };
101
102
103
104 #define SLIP_MAGIC 0x5302
105
106 extern int slip_init(struct device *dev);
107
108 #endif