1 /* dev.h */ 2 /* 3 Copyright (C) 1992 Ross Biro 4
5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9
10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14
15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software 17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18
19 The Author may be reached as bir7@leland.stanford.edu or 20 C/O Department of Mathematics; Stanford University; Stanford, CA 94305 21 */ 22 /* $Id: dev.h,v 0.8.4.7 1993/01/23 18:00:11 bir7 Exp $ */ 23 /* $Log: dev.h,v $ 24 * Revision 0.8.4.7 1993/01/23 18:00:11 bir7 25 * Fixed problems from merging. 26 * 27 * Revision 0.8.4.6 1993/01/22 22:58:08 bir7 28 * Changed so transmitting takes place in bottom half of interrupt routine. 29 * 30 * Revision 0.8.4.5 1992/12/08 20:49:15 bir7 31 * Edited ctrl-h's out of log messages. 32 * 33 * Revision 0.8.4.4 1992/12/06 23:29:59 bir7 34 * Converted to using lower half interrupt routine. 35 * 36 * Revision 0.8.4.3 1992/12/05 21:35:53 bir7 37 * Updated dev->init type. 38 * 39 * Revision 0.8.4.2 1992/12/03 19:54:12 bir7 40 * Added paranoid queue checking. 41 * 42 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7 43 * version change only. 44 * 45 * Revision 0.8.3.2 1992/11/10 00:14:47 bir7 46 * Changed malloc to kmalloc and added Id and Log 47 * 48 */ 49
50 #ifndef_TCP_DEV_H 51 #define_TCP_DEV_H 52 /* for future expansion when we will have different priorities. */ 53 #defineDEV_NUMBUFFS 3
54 #defineMAX_ADDR_LEN 6
55 #defineMAX_HEADER 14
56 #defineMAX_ROUTE 16
57
58 structdevice 59 { 60 char *name;
61 unsignedlongrmem_end;
62 unsignedlongrmem_start;
63 unsignedlongmem_end;
64 unsignedlongmem_start;
65 unsignedshortbase_addr;
66 unsignedcharirq;
67 volatileunsignedcharstart:1,
68 tbusy:1,
69 loopback:1,
70 interrupt:1,
71 up:1;
72 structdevice *next;
73 int (*init)(structdevice *dev);
74 unsignedlongtrans_start;
75 volatilestructsk_buff * volatilebuffs[DEV_NUMBUFFS];
76 structsk_buff *backlog; /* no longer used. */ 77 int (*open)(structdevice *dev);
78 int (*stop)(structdevice *dev);
79 int (*hard_start_xmit) (structsk_buff *skb, structdevice *dev);
80 int (*hard_header) (unsignedchar *buff, structdevice *dev,
81 unsignedshorttype, unsignedlongdaddr,
82 unsignedlongsaddr, unsignedlen);
83 void (*add_arp) (unsignedlongaddr, structsk_buff *skb,
84 structdevice *dev);
85 void (*queue_xmit)(structsk_buff *skb, structdevice *dev, intpri);
86 int (*rebuild_header)(void *eth, structdevice *dev);
87 unsignedshort (*type_trans) (structsk_buff *skb, structdevice *dev);
88 void (*send_packet)(structsk_buff *skb, structdevice *dev); /* no longer 89 used */ 90 void *private;
91
92 unsignedshorttype;
93 unsignedshorthard_header_len;
94 unsignedshortmtu;
95 unsignedcharbroadcast[MAX_ADDR_LEN];
96 unsignedchardev_addr[MAX_ADDR_LEN];
97 unsignedcharaddr_len;
98 };
99
100 externstructdevice *dev_base;
101
102 structpacket_type 103 { 104 unsignedshorttype; /* This is really NET16(ether_type) other devices 105 will have to translate appropriately. */ 106 unsignedshortcopy:1;
107 int (*func) (structsk_buff *, structdevice *, structpacket_type *);
108 void *data;
109 structpacket_type *next;
110 };
111
112 /* used by dev_rint */ 113 #defineIN_SKBUFF 1
114 #defineDEV_QUEUE_MAGIC 0x17432895
115
116
117 externstructpacket_type *ptype_base;
118 voiddev_queue_xmit (structsk_buff *skb, structdevice *dev, intpri);
119 intdev_rint (unsignedchar *buff, longlen, intflags, structdevice *dev);
120 voiddev_tint ( structdevice *dev);
121 voiddev_add_pack (structpacket_type *pt);
122 voiddev_remove_pack (structpacket_type *pt);
123 structdevice *get_dev (char *name);
124 voidinet_bh (void *tmp);
125
126
127 #endif