1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_X25_ASY_H
3#define _LINUX_X25_ASY_H
4
5/* X.25 asy configuration. */
6#define SL_NRUNIT	256		/* MAX number of X.25 channels;
7					   This can be overridden with
8					   insmod -ox25_asy_maxdev=nnn	*/
9#define SL_MTU		256
10
11/* X25 async protocol characters. */
12#define X25_END         0x7E		/* indicates end of frame	*/
13#define X25_ESC         0x7D		/* indicates byte stuffing	*/
14#define X25_ESCAPE(x)	((x)^0x20)
15#define X25_UNESCAPE(x)	((x)^0x20)
16
17
18struct x25_asy {
19  int			magic;
20
21  /* Various fields. */
22  spinlock_t		lock;
23  struct tty_struct	*tty;		/* ptr to TTY structure		*/
24  struct net_device	*dev;		/* easy for intr handling	*/
25
26  /* These are pointers to the malloc()ed frame buffers. */
27  unsigned char		*rbuff;		/* receiver buffer		*/
28  int                   rcount;         /* received chars counter       */
29  unsigned char		*xbuff;		/* transmitter buffer		*/
30  unsigned char         *xhead;         /* pointer to next byte to XMIT */
31  int                   xleft;          /* bytes left in XMIT queue     */
32  int                   buffsize;       /* Max buffers sizes            */
33
34  unsigned long		flags;		/* Flag values/ mode etc	*/
35#define SLF_INUSE	0		/* Channel in use               */
36#define SLF_ESCAPE	1               /* ESC received                 */
37#define SLF_ERROR	2               /* Parity, etc. error           */
38};
39
40
41
42#define X25_ASY_MAGIC 0x5303
43
44int x25_asy_init(struct net_device *dev);
45
46#endif	/* _LINUX_X25_ASY.H */
47