root/net/drv/slip/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   (02/11/93)
   8  *
   9  * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  10  */
  11 #ifndef _LINUX_SLIP_H
  12 #define _LINUX_SLIP_H
  13 
  14 /* SLIP configuration. */
  15 #define SL_NRUNIT       4               /* number of SLIP channels      */
  16 #define SL_MTU          296             /* 296; I am used to 600- FvK   */
  17 #define SL_BUF_SIZE     8192            /* same as TTY for now          */
  18 #ifdef not_any_more
  19 #define SL_RCV_SIZE     2048
  20 #endif
  21 
  22 /* SLIP protocol characters. */
  23 #define END             0300            /* indicates end of frame       */
  24 #define ESC             0333            /* indicates byte stuffing      */
  25 #define ESC_END         0334            /* ESC ESC_END means END 'data' */
  26 #define ESC_ESC         0335            /* ESC ESC_ESC means ESC 'data' */
  27 
  28 struct sl_queue {
  29   unsigned long         data;
  30   unsigned long         head;
  31   unsigned long         tail;
  32   struct wait_queue     *proc_list;
  33   unsigned char         buf[SL_BUF_SIZE];
  34 };
  35 
  36 struct slip {
  37   int                   inuse;          /* are we allocated?            */
  38   int                   line;           /* SLIP channel number          */
  39   struct tty_struct     *tty;           /* ptr to TTY structure         */
  40 #if 0
  41   struct device         *dev;           /* easy for intr handling       */
  42 #endif
  43   unsigned int          sending;        /* "channel busy" indicator     */
  44   struct sl_queue       rcv_queue;
  45   char                  snd_buf[(SL_MTU*2)+4];
  46   unsigned char         xbuff[(SL_MTU * 2)];
  47   int                   escape;         /* SLIP state machine           */
  48   int                   received;       /* SLIP receive counter         */
  49   unsigned long         sent;           /* #frames sent                 */
  50   unsigned long         rcvd;           /* #frames rcvd                 */
  51   unsigned long         errors;         /* error count                  */
  52 };
  53 
  54 #define SL_INC(a)       ((a) = ((a)+1) & (SL_BUF_SIZE-1))
  55 #define SL_DEC(a)       ((a) = ((a)-1) & (SL_BUF_SIZE-1))
  56 #define SL_EMPTY(a)     ((a)->head == (a)->tail)
  57 #define SL_LEFT(a)      (((a)->tail-(a)->head-1)&(SL_BUF_SIZE-1))
  58 #define SL_LAST(a)      ((a)->buf[(SL_BUF_SIZE-1)&((a)->head-1)])
  59 #define SL_FULL(a)      (!SL_LEFT(a))
  60 #define SL_CHARS(a)     (((a)->head-(a)->tail)&(SL_BUF_SIZE-1))
  61 
  62 extern int slip_init(struct ddi *dev);
  63 
  64 #endif  /* _LINUX_SLIP.H */

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