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  *      Dmitry Gorodchanin      :       A lot of changes in the 'struct slip'
  14  *
  15  * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  16  */
  17 #ifndef _LINUX_SLIP_H
  18 #define _LINUX_SLIP_H
  19 
  20 /* SLIP configuration. */
  21 #ifndef SL_SLIP_LOTS
  22 #define SL_NRUNIT       4               /* number of SLIP channels      */
  23 #else
  24 #define SL_NRUNIT       16
  25 #endif
  26 #define SL_MTU          296             /* 296; I am used to 600- FvK   */
  27 
  28 /* SLIP protocol characters. */
  29 #define END             0300            /* indicates end of frame       */
  30 #define ESC             0333            /* indicates byte stuffing      */
  31 #define ESC_END         0334            /* ESC ESC_END means END 'data' */
  32 #define ESC_ESC         0335            /* ESC ESC_ESC means ESC 'data' */
  33 
  34 
  35 struct slip {
  36   int                   magic;
  37 
  38   /* Various fields. */
  39   struct tty_struct     *tty;           /* ptr to TTY structure         */
  40   struct device         *dev;           /* easy for intr handling       */
  41 #if defined(CONFIG_INET)
  42   struct slcompress     *slcomp;        /* for header compression       */
  43   unsigned char         *cbuff;         /* compression buffer           */
  44 #endif
  45 
  46   /* These are pointers to the malloc()ed frame buffers. */
  47   unsigned char         *rbuff;         /* receiver buffer              */
  48   int                   rcount;         /* received chars counter       */
  49   unsigned char         *xbuff;         /* transmitter buffer           */
  50   unsigned char         *xhead;         /* pointer to next byte to XMIT */
  51   int                   xleft;          /* bytes left in XMIT queue     */
  52 
  53   /* SLIP interface statistics. */
  54   unsigned long         rx_packets;     /* inbound frames counter       */
  55   unsigned long         tx_packets;     /* outbound frames counter      */
  56   unsigned long         rx_errors;      /* Parity, etc. errors          */
  57   unsigned long         tx_errors;      /* Planned stuff                */
  58   unsigned long         rx_dropped;     /* No memory for skb            */
  59   unsigned long         tx_dropped;     /* When MTU change              */
  60   unsigned long         rx_over_errors; /* Frame bigger then SLIP buf.  */
  61   /* Detailed SLIP statistics. */
  62 
  63   int                   mtu;            /* Our mtu (to spot changes!)   */
  64   int                   buffsize;       /* Max buffers sizes            */
  65 
  66 #ifdef CONFIG_SLIP_MODE_SLIP6
  67   int                   xdata, xbits;   /* 6 bit slip controls          */
  68 #endif
  69 
  70   unsigned char         flags;          /* Flag values/ mode etc        */
  71 #define SLF_INUSE       0               /* Channel in use               */
  72 #define SLF_ESCAPE      1               /* ESC received                 */
  73 #define SLF_ERROR       2               /* Parity, etc. error           */
  74 
  75   unsigned char         mode;           /* SLIP mode                    */
  76 #define SL_MODE_SLIP    0
  77 #define SL_MODE_CSLIP   1
  78 #define SL_MODE_SLIP6   2               /* Matt Dillon's printable slip */
  79 #define SL_MODE_CSLIP6  (SL_MODE_SLIP6|SL_MODE_CSLIP)
  80 #define SL_MODE_AX25    4
  81 #define SL_MODE_ADAPTIVE 8
  82 };
  83 
  84 #ifdef CONFIG_INET
  85 #ifdef CONFIG_SLIP_ADAPTIVE
  86 #define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
  87 #else  /* !CONFIG_SLIP_ADAPTIVE */
  88 #ifdef CONFIG_SLIP_COMPRESSED
  89 #define SL_MODE_DEFAULT (SL_MODE_CSLIP | SL_MODE_ADAPTIVE)
  90 #else  /* !CONFIG_SLIP_COMPRESSED */
  91 #define SL_MODE_DEFAULT SL_MODE_SLIP
  92 #endif /* CONFIG_SLIP_COMPRESSED */
  93 #endif /* CONFIG_SLIP_ADAPTIVE */
  94 #else  /* !CONFIG_INET */
  95 #define SL_MODE_DEFAULT SL_MODE_SLIP
  96 #endif /* CONFIG_INET */
  97 
  98 
  99 #define SLIP_MAGIC 0x5302
 100 
 101 extern int slip_init(struct device *dev);
 102 
 103 #endif  /* _LINUX_SLIP.H */

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