OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [net/] [slip.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
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
 *      Dmitry Gorodchanin      :       Added CSLIP statistics.
15
 *      Stanislav Voronyi       :       Make line checking as created by
16
 *                                      Igor Chechik, RELCOM Corp.
17
 *      Craig Schlenter         :       Fixed #define bug that caused
18
 *                                      CSLIP telnets to hang in 1.3.61-6
19
 *      Kenneth Albanowski      :       Flags needs to be 32 bits
20
 *
21
 * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
22
 */
23
#ifndef _LINUX_SLIP_H
24
#define _LINUX_SLIP_H
25
 
26
#include <linux/config.h>
27
 
28
#if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
29
# define SL_INCLUDE_CSLIP
30
#endif
31
 
32
#ifdef SL_INCLUDE_CSLIP
33
# define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
34
#else
35
# define SL_MODE_DEFAULT SL_MODE_SLIP
36
#endif
37
 
38
/* SLIP configuration. */
39
#define SL_NRUNIT       256             /* MAX number of SLIP channels;
40
                                           This can be overridden with
41
                                           insmod -oslip_maxdev=nnn     */
42
#define SL_MTU          296             /* 296; I am used to 600- FvK   */
43
 
44
/* SLIP protocol characters. */
45
#define END             0300            /* indicates end of frame       */
46
#define ESC             0333            /* indicates byte stuffing      */
47
#define ESC_END         0334            /* ESC ESC_END means END 'data' */
48
#define ESC_ESC         0335            /* ESC ESC_ESC means ESC 'data' */
49
 
50
 
51
struct slip {
52
  int                   magic;
53
 
54
  /* Various fields. */
55
  struct tty_struct     *tty;           /* ptr to TTY structure         */
56
  struct device         *dev;           /* easy for intr handling       */
57
#ifdef SL_INCLUDE_CSLIP
58
  struct slcompress     *slcomp;        /* for header compression       */
59
  unsigned char         *cbuff;         /* compression buffer           */
60
#endif
61
 
62
  /* These are pointers to the malloc()ed frame buffers. */
63
  unsigned char         *rbuff;         /* receiver buffer              */
64
  int                   rcount;         /* received chars counter       */
65
  unsigned char         *xbuff;         /* transmitter buffer           */
66
  unsigned char         *xhead;         /* pointer to next byte to XMIT */
67
  int                   xleft;          /* bytes left in XMIT queue     */
68
 
69
  /* SLIP interface statistics. */
70
  unsigned long         rx_packets;     /* inbound frames counter       */
71
  unsigned long         tx_packets;     /* outbound frames counter      */
72
  unsigned long         rx_errors;      /* Parity, etc. errors          */
73
  unsigned long         tx_errors;      /* Planned stuff                */
74
  unsigned long         rx_dropped;     /* No memory for skb            */
75
  unsigned long         tx_dropped;     /* When MTU change              */
76
  unsigned long         rx_over_errors; /* Frame bigger then SLIP buf.  */
77
#ifdef SL_INCLUDE_CSLIP
78
  unsigned long         tx_compressed;
79
  unsigned long         rx_compressed;
80
  unsigned long         tx_misses;
81
#endif
82
  /* Detailed SLIP statistics. */
83
 
84
  int                   mtu;            /* Our mtu (to spot changes!)   */
85
  int                   buffsize;       /* Max buffers sizes            */
86
 
87
#ifdef CONFIG_SLIP_MODE_SLIP6
88
  int                   xdata, xbits;   /* 6 bit slip controls          */
89
#endif
90
 
91
  unsigned long         flags;          /* Flag values/ mode etc        */
92
#define SLF_INUSE       0                /* Channel in use               */
93
#define SLF_ESCAPE      1               /* ESC received                 */
94
#define SLF_ERROR       2               /* Parity, etc. error           */
95
#define SLF_KEEPTEST    3               /* Keepalive test flag          */
96
#define SLF_OUTWAIT     4               /* is outpacket was flag        */
97
 
98
  unsigned char         mode;           /* SLIP mode                    */
99
#define SL_MODE_SLIP    0
100
#define SL_MODE_CSLIP   1
101
#define SL_MODE_SLIP6   2               /* Matt Dillon's printable slip */
102
#define SL_MODE_CSLIP6  (SL_MODE_SLIP6|SL_MODE_CSLIP)
103
#define SL_MODE_AX25    4
104
#define SL_MODE_ADAPTIVE 8
105
#ifdef CONFIG_SLIP_SMART  
106
  unsigned char         outfill;        /* # of sec between outfill packet */
107
  unsigned char         keepalive;      /* keepalive seconds            */
108
  struct timer_list     outfill_timer;
109
  struct timer_list     keepalive_timer;
110
#endif  
111
};
112
 
113
 
114
 
115
#define SLIP_MAGIC 0x5302
116
 
117
extern int slip_init(struct device *dev);
118
 
119
#endif  /* _LINUX_SLIP.H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.