root/drivers/net/slip.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   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  *
  14  * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  15  */
  16 #ifndef _LINUX_SLIP_H
  17 #define _LINUX_SLIP_H
  18 
  19 /* SLIP configuration. */
  20 #ifndef SL_SLIP_LOTS
  21 #define SL_NRUNIT       4               /* number of SLIP channels      */
  22 #else
  23 #define SL_NRUNIT       16
  24 #endif
  25 #define SL_MTU          296             /* 296; I am used to 600- FvK   */
  26 
  27 /* SLIP protocol characters. */
  28 #define END             0300            /* indicates end of frame       */
  29 #define ESC             0333            /* indicates byte stuffing      */
  30 #define ESC_END         0334            /* ESC ESC_END means END 'data' */
  31 #define ESC_ESC         0335            /* ESC ESC_ESC means ESC 'data' */
  32 
  33 
  34 struct slip {
  35   int                   magic;
  36   /* Bitmapped flag fields. */
  37   char                  inuse;          /* are we allocated?            */
  38   char                  sending;        /* "channel busy" indicator     */
  39   char                  escape;         /* SLIP state machine           */
  40   char                  unused;         /* fillers                      */
  41 
  42   /* Various fields. */
  43   int                   line;           /* SLIP channel number          */
  44   struct tty_struct     *tty;           /* ptr to TTY structure         */
  45   struct device         *dev;           /* easy for intr handling       */
  46   struct slcompress     *slcomp;        /* for header compression       */
  47 
  48   /* These are pointers to the malloc()ed frame buffers. */
  49   unsigned char         *rbuff;         /* receiver buffer              */
  50   unsigned char         *xbuff;         /* transmitter buffer           */
  51   unsigned char         *cbuff;         /* compression buffer           */
  52 
  53   /* These are the various pointers into the buffers. */
  54   unsigned char         *rhead;         /* RECV buffer pointer (head)   */
  55   unsigned char         *rend;          /* RECV buffer pointer (end)    */
  56   int                   rcount;         /* SLIP receive counter         */
  57   unsigned char         *xhead;         /* XMIT buffer pointer (head)   */
  58   unsigned char         *xtail;         /* XMIT buffer pointer (tail)   */
  59 
  60   /* SLIP interface statistics. */
  61   unsigned long         rpacket;        /* inbound frame counter        */
  62   unsigned long         roverrun;       /* "buffer overrun" counter     */
  63   unsigned long         spacket;        /* outbound frames counter      */
  64   unsigned long         sbusy;          /* "transmitter busy" counter   */
  65   unsigned long         errors;         /* error count                  */
  66   
  67   int                   mtu;            /* Our mtu (to spot changes!)   */
  68   unsigned char         flags;          /* Flag values/ mode etc        */
  69 #define SLF_ESCAPE      2
  70 #define SLF_ERROR       4
  71 #define SLF_COMP        16
  72 #define SLF_EXPN        32
  73 #define SLF_XMIT_BUSY   64
  74   unsigned char         mode;           /* SLIP mode                    */
  75 #define SL_MODE_SLIP    0
  76 #define SL_MODE_CSLIP   1
  77 #define SL_MODE_SLIP6   2               /* Matt Dillon's printable slip */
  78 #define SL_MODE_CSLIP6  (SL_MODE_SLIP6|SL_MODE_CSLIP)
  79 #define SL_MODE_AX25    4
  80 #define SL_MODE_ADAPTIVE 8
  81   int                   xdata,xbits;    /* 6 bit slip controls          */
  82 };
  83 
  84 #define SLIP_MAGIC 0x5302
  85 
  86 extern int      slip_init(struct device *dev);
  87 extern int      slip_esc(unsigned char *s, unsigned char *d, int len);
  88 extern int      slip_esc6(unsigned char *s, unsigned char *d, int len);
  89 extern void     slip_unesc(struct slip *sl, unsigned char s);
  90 extern void     slip_unesc6(struct slip *sl, unsigned char s);
  91 
  92 #endif  /* _LINUX_SLIP.H */

/* [previous][next][first][last][top][bottom][index][help] */