18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * slip.h Define the SLIP device driver interface and constants. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * NOTE: THIS FILE WILL BE MOVED TO THE LINUX INCLUDE DIRECTORY 68c2ecf20Sopenharmony_ci * AS SOON AS POSSIBLE! 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Version: @(#)slip.h 1.2.0 03/28/93 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * Fixes: 118c2ecf20Sopenharmony_ci * Alan Cox : Added slip mtu field. 128c2ecf20Sopenharmony_ci * Matt Dillon : Printable slip (borrowed from net2e) 138c2ecf20Sopenharmony_ci * Alan Cox : Added SL_SLIP_LOTS 148c2ecf20Sopenharmony_ci * Dmitry Gorodchanin : A lot of changes in the 'struct slip' 158c2ecf20Sopenharmony_ci * Dmitry Gorodchanin : Added CSLIP statistics. 168c2ecf20Sopenharmony_ci * Stanislav Voronyi : Make line checking as created by 178c2ecf20Sopenharmony_ci * Igor Chechik, RELCOM Corp. 188c2ecf20Sopenharmony_ci * Craig Schlenter : Fixed #define bug that caused 198c2ecf20Sopenharmony_ci * CSLIP telnets to hang in 1.3.61-6 208c2ecf20Sopenharmony_ci * 218c2ecf20Sopenharmony_ci * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 228c2ecf20Sopenharmony_ci */ 238c2ecf20Sopenharmony_ci#ifndef _LINUX_SLIP_H 248c2ecf20Sopenharmony_ci#define _LINUX_SLIP_H 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED) 288c2ecf20Sopenharmony_ci# define SL_INCLUDE_CSLIP 298c2ecf20Sopenharmony_ci#endif 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci#ifdef SL_INCLUDE_CSLIP 328c2ecf20Sopenharmony_ci# define SL_MODE_DEFAULT SL_MODE_ADAPTIVE 338c2ecf20Sopenharmony_ci#else 348c2ecf20Sopenharmony_ci# define SL_MODE_DEFAULT SL_MODE_SLIP 358c2ecf20Sopenharmony_ci#endif 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* SLIP configuration. */ 388c2ecf20Sopenharmony_ci#define SL_NRUNIT 256 /* MAX number of SLIP channels; 398c2ecf20Sopenharmony_ci This can be overridden with 408c2ecf20Sopenharmony_ci insmod -oslip_maxdev=nnn */ 418c2ecf20Sopenharmony_ci#define SL_MTU 296 /* 296; I am used to 600- FvK */ 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* SLIP protocol characters. */ 448c2ecf20Sopenharmony_ci#define END 0300 /* indicates end of frame */ 458c2ecf20Sopenharmony_ci#define ESC 0333 /* indicates byte stuffing */ 468c2ecf20Sopenharmony_ci#define ESC_END 0334 /* ESC ESC_END means END 'data' */ 478c2ecf20Sopenharmony_ci#define ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_cistruct slip { 518c2ecf20Sopenharmony_ci int magic; 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci /* Various fields. */ 548c2ecf20Sopenharmony_ci struct tty_struct *tty; /* ptr to TTY structure */ 558c2ecf20Sopenharmony_ci struct net_device *dev; /* easy for intr handling */ 568c2ecf20Sopenharmony_ci spinlock_t lock; 578c2ecf20Sopenharmony_ci struct work_struct tx_work; /* Flushes transmit buffer */ 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci#ifdef SL_INCLUDE_CSLIP 608c2ecf20Sopenharmony_ci struct slcompress *slcomp; /* for header compression */ 618c2ecf20Sopenharmony_ci unsigned char *cbuff; /* compression buffer */ 628c2ecf20Sopenharmony_ci#endif 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci /* These are pointers to the malloc()ed frame buffers. */ 658c2ecf20Sopenharmony_ci unsigned char *rbuff; /* receiver buffer */ 668c2ecf20Sopenharmony_ci int rcount; /* received chars counter */ 678c2ecf20Sopenharmony_ci unsigned char *xbuff; /* transmitter buffer */ 688c2ecf20Sopenharmony_ci unsigned char *xhead; /* pointer to next byte to XMIT */ 698c2ecf20Sopenharmony_ci int xleft; /* bytes left in XMIT queue */ 708c2ecf20Sopenharmony_ci int mtu; /* Our mtu (to spot changes!) */ 718c2ecf20Sopenharmony_ci int buffsize; /* Max buffers sizes */ 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#ifdef CONFIG_SLIP_MODE_SLIP6 748c2ecf20Sopenharmony_ci int xdata, xbits; /* 6 bit slip controls */ 758c2ecf20Sopenharmony_ci#endif 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci unsigned long flags; /* Flag values/ mode etc */ 788c2ecf20Sopenharmony_ci#define SLF_INUSE 0 /* Channel in use */ 798c2ecf20Sopenharmony_ci#define SLF_ESCAPE 1 /* ESC received */ 808c2ecf20Sopenharmony_ci#define SLF_ERROR 2 /* Parity, etc. error */ 818c2ecf20Sopenharmony_ci#define SLF_KEEPTEST 3 /* Keepalive test flag */ 828c2ecf20Sopenharmony_ci#define SLF_OUTWAIT 4 /* is outpacket was flag */ 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci unsigned char mode; /* SLIP mode */ 858c2ecf20Sopenharmony_ci unsigned char leased; 868c2ecf20Sopenharmony_ci pid_t pid; 878c2ecf20Sopenharmony_ci#define SL_MODE_SLIP 0 888c2ecf20Sopenharmony_ci#define SL_MODE_CSLIP 1 898c2ecf20Sopenharmony_ci#define SL_MODE_SLIP6 2 /* Matt Dillon's printable slip */ 908c2ecf20Sopenharmony_ci#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP) 918c2ecf20Sopenharmony_ci#define SL_MODE_AX25 4 928c2ecf20Sopenharmony_ci#define SL_MODE_ADAPTIVE 8 938c2ecf20Sopenharmony_ci#ifdef CONFIG_SLIP_SMART 948c2ecf20Sopenharmony_ci unsigned char outfill; /* # of sec between outfill packet */ 958c2ecf20Sopenharmony_ci unsigned char keepalive; /* keepalive seconds */ 968c2ecf20Sopenharmony_ci struct timer_list outfill_timer; 978c2ecf20Sopenharmony_ci struct timer_list keepalive_timer; 988c2ecf20Sopenharmony_ci#endif 998c2ecf20Sopenharmony_ci}; 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci#define SLIP_MAGIC 0x5302 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci#endif /* _LINUX_SLIP.H */ 104