File: /usr/src/linux/drivers/net/wan/x25_asy.h
1 #ifndef _LINUX_X25_ASY_H
2 #define _LINUX_X25_ASY_H
3
4 /* X.25 asy configuration. */
5 #define SL_NRUNIT 256 /* MAX number of X.25 channels;
6 This can be overridden with
7 insmod -ox25_asy_maxdev=nnn */
8 #define SL_MTU 256
9
10 /* X25 async protocol characters. */
11 #define X25_END 0x7E /* indicates end of frame */
12 #define X25_ESC 0x7D /* indicates byte stuffing */
13 #define X25_ESCAPE(x) ((x)^0x20)
14 #define X25_UNESCAPE(x) ((x)^0x20)
15
16
17 struct x25_asy {
18 int magic;
19
20 /* Various fields. */
21 struct tty_struct *tty; /* ptr to TTY structure */
22 struct net_device *dev; /* easy for intr handling */
23
24 /* These are pointers to the malloc()ed frame buffers. */
25 unsigned char *rbuff; /* receiver buffer */
26 int rcount; /* received chars counter */
27 unsigned char *xbuff; /* transmitter buffer */
28 unsigned char *xhead; /* pointer to next byte to XMIT */
29 int xleft; /* bytes left in XMIT queue */
30
31 /* X.25 interface statistics. */
32 unsigned long rx_packets; /* inbound frames counter */
33 unsigned long tx_packets; /* outbound frames counter */
34 unsigned long rx_bytes; /* inbound byte counte */
35 unsigned long tx_bytes; /* outbound byte counter */
36 unsigned long rx_errors; /* Parity, etc. errors */
37 unsigned long tx_errors; /* Planned stuff */
38 unsigned long rx_dropped; /* No memory for skb */
39 unsigned long tx_dropped; /* When MTU change */
40 unsigned long rx_over_errors; /* Frame bigger then X.25 buf. */
41
42 int mtu; /* Our mtu (to spot changes!) */
43 int buffsize; /* Max buffers sizes */
44
45 unsigned long flags; /* Flag values/ mode etc */
46 #define SLF_INUSE 0 /* Channel in use */
47 #define SLF_ESCAPE 1 /* ESC received */
48 #define SLF_ERROR 2 /* Parity, etc. error */
49 #define SLF_OUTWAIT 4 /* Waiting for output */
50 };
51
52
53
54 #define X25_ASY_MAGIC 0x5303
55
56 extern int x25_asy_init(struct net_device *dev);
57
58 #endif /* _LINUX_X25_ASY.H */
59