Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * slip.h Define the SLIP device driver interface and constants.
4 *
5 * NOTE: THIS FILE WILL BE MOVED TO THE LINUX INCLUDE DIRECTORY
6 * AS SOON AS POSSIBLE!
7 *
8 * Version: @(#)slip.h 1.2.0 03/28/93
9 *
10 * Fixes:
11 * Alan Cox : Added slip mtu field.
12 * Matt Dillon : Printable slip (borrowed from net2e)
13 * Alan Cox : Added SL_SLIP_LOTS
14 * Dmitry Gorodchanin : A lot of changes in the 'struct slip'
15 * Dmitry Gorodchanin : Added CSLIP statistics.
16 * Stanislav Voronyi : Make line checking as created by
17 * Igor Chechik, RELCOM Corp.
18 * Craig Schlenter : Fixed #define bug that caused
19 * CSLIP telnets to hang in 1.3.61-6
20 *
21 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
22 */
23#ifndef _LINUX_SLIP_H
24#define _LINUX_SLIP_H
25
26
27#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
28# define SL_INCLUDE_CSLIP
29#endif
30
31#ifdef SL_INCLUDE_CSLIP
32# define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
33#else
34# define SL_MODE_DEFAULT SL_MODE_SLIP
35#endif
36
37/* SLIP configuration. */
38#define SL_NRUNIT 256 /* MAX number of SLIP channels;
39 This can be overridden with
40 insmod -oslip_maxdev=nnn */
41#define SL_MTU 296 /* 296; I am used to 600- FvK */
42
43/* some arch define END as assembly function ending, just undef it */
44#undef END
45/* SLIP protocol characters. */
46#define END 0300 /* indicates end of frame */
47#define ESC 0333 /* indicates byte stuffing */
48#define ESC_END 0334 /* ESC ESC_END means END 'data' */
49#define ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
50
51
52struct slip {
53 int magic;
54
55 /* Various fields. */
56 struct tty_struct *tty; /* ptr to TTY structure */
57 struct net_device *dev; /* easy for intr handling */
58 spinlock_t lock;
59 struct work_struct tx_work; /* Flushes transmit buffer */
60
61#ifdef SL_INCLUDE_CSLIP
62 struct slcompress *slcomp; /* for header compression */
63 unsigned char *cbuff; /* compression buffer */
64#endif
65
66 /* These are pointers to the malloc()ed frame buffers. */
67 unsigned char *rbuff; /* receiver buffer */
68 int rcount; /* received chars counter */
69 unsigned char *xbuff; /* transmitter buffer */
70 unsigned char *xhead; /* pointer to next byte to XMIT */
71 int xleft; /* bytes left in XMIT queue */
72 int mtu; /* Our mtu (to spot changes!) */
73 int buffsize; /* Max buffers sizes */
74
75#ifdef CONFIG_SLIP_MODE_SLIP6
76 int xdata, xbits; /* 6 bit slip controls */
77#endif
78
79 unsigned long flags; /* Flag values/ mode etc */
80#define SLF_INUSE 0 /* Channel in use */
81#define SLF_ESCAPE 1 /* ESC received */
82#define SLF_ERROR 2 /* Parity, etc. error */
83#define SLF_KEEPTEST 3 /* Keepalive test flag */
84#define SLF_OUTWAIT 4 /* is outpacket was flag */
85
86 unsigned char mode; /* SLIP mode */
87 unsigned char leased;
88 pid_t pid;
89#define SL_MODE_SLIP 0
90#define SL_MODE_CSLIP 1
91#define SL_MODE_SLIP6 2 /* Matt Dillon's printable slip */
92#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
93#define SL_MODE_AX25 4
94#define SL_MODE_ADAPTIVE 8
95#ifdef CONFIG_SLIP_SMART
96 unsigned char outfill; /* # of sec between outfill packet */
97 unsigned char keepalive; /* keepalive seconds */
98 struct timer_list outfill_timer;
99 struct timer_list keepalive_timer;
100#endif
101};
102
103#define SLIP_MAGIC 0x5302
104
105#endif /* _LINUX_SLIP.H */
1/*
2 * slip.h Define the SLIP device driver interface and constants.
3 *
4 * NOTE: THIS FILE WILL BE MOVED TO THE LINUX INCLUDE DIRECTORY
5 * AS SOON AS POSSIBLE!
6 *
7 * Version: @(#)slip.h 1.2.0 03/28/93
8 *
9 * Fixes:
10 * Alan Cox : Added slip mtu field.
11 * Matt Dillon : Printable slip (borrowed from net2e)
12 * Alan Cox : Added SL_SLIP_LOTS
13 * Dmitry Gorodchanin : A lot of changes in the 'struct slip'
14 * Dmitry Gorodchanin : Added CSLIP statistics.
15 * Stanislav Voronyi : Make line checking as created by
16 * Igor Chechik, RELCOM Corp.
17 * Craig Schlenter : Fixed #define bug that caused
18 * CSLIP telnets to hang in 1.3.61-6
19 *
20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
21 */
22#ifndef _LINUX_SLIP_H
23#define _LINUX_SLIP_H
24
25
26#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
27# define SL_INCLUDE_CSLIP
28#endif
29
30#ifdef SL_INCLUDE_CSLIP
31# define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
32#else
33# define SL_MODE_DEFAULT SL_MODE_SLIP
34#endif
35
36/* SLIP configuration. */
37#define SL_NRUNIT 256 /* MAX number of SLIP channels;
38 This can be overridden with
39 insmod -oslip_maxdev=nnn */
40#define SL_MTU 296 /* 296; I am used to 600- FvK */
41
42/* SLIP protocol characters. */
43#define END 0300 /* indicates end of frame */
44#define ESC 0333 /* indicates byte stuffing */
45#define ESC_END 0334 /* ESC ESC_END means END 'data' */
46#define ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
47
48
49struct slip {
50 int magic;
51
52 /* Various fields. */
53 struct tty_struct *tty; /* ptr to TTY structure */
54 struct net_device *dev; /* easy for intr handling */
55 spinlock_t lock;
56 struct work_struct tx_work; /* Flushes transmit buffer */
57
58#ifdef SL_INCLUDE_CSLIP
59 struct slcompress *slcomp; /* for header compression */
60 unsigned char *cbuff; /* compression buffer */
61#endif
62
63 /* These are pointers to the malloc()ed frame buffers. */
64 unsigned char *rbuff; /* receiver buffer */
65 int rcount; /* received chars counter */
66 unsigned char *xbuff; /* transmitter buffer */
67 unsigned char *xhead; /* pointer to next byte to XMIT */
68 int xleft; /* bytes left in XMIT queue */
69 int mtu; /* Our mtu (to spot changes!) */
70 int buffsize; /* Max buffers sizes */
71
72#ifdef CONFIG_SLIP_MODE_SLIP6
73 int xdata, xbits; /* 6 bit slip controls */
74#endif
75
76 unsigned long flags; /* Flag values/ mode etc */
77#define SLF_INUSE 0 /* Channel in use */
78#define SLF_ESCAPE 1 /* ESC received */
79#define SLF_ERROR 2 /* Parity, etc. error */
80#define SLF_KEEPTEST 3 /* Keepalive test flag */
81#define SLF_OUTWAIT 4 /* is outpacket was flag */
82
83 unsigned char mode; /* SLIP mode */
84 unsigned char leased;
85 pid_t pid;
86#define SL_MODE_SLIP 0
87#define SL_MODE_CSLIP 1
88#define SL_MODE_SLIP6 2 /* Matt Dillon's printable slip */
89#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
90#define SL_MODE_AX25 4
91#define SL_MODE_ADAPTIVE 8
92#ifdef CONFIG_SLIP_SMART
93 unsigned char outfill; /* # of sec between outfill packet */
94 unsigned char keepalive; /* keepalive seconds */
95 struct timer_list outfill_timer;
96 struct timer_list keepalive_timer;
97#endif
98};
99
100#define SLIP_MAGIC 0x5302
101
102#endif /* _LINUX_SLIP.H */