|
|
1.1 root 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 [email protected] or
20: C/O Department of Mathematics; Stanford University; Stanford, CA 94305
21: */
22: #ifndef _TCP_DEV_H
23: #define _TCP_DEV_H
24: /* for future expansion when we will have different priorities. */
25: #define DEV_NUMBUFFS 3
26: #define MAX_ADDR_LEN 6
27: #define MAX_HEADER 14
28: #define MAX_ROUTE 16
29:
30: struct device
31: {
32: char *name;
33: unsigned long rmem_end;
34: unsigned long rmem_start;
35: unsigned long mem_end;
36: unsigned long mem_start;
37: unsigned short base_addr;
38: unsigned char irq;
39: unsigned char start:1,
40: tbusy:1,
41: loopback:1,
42: interrupt:1,
43: up:1;
44: struct device *next;
45: void (*init)(struct device *dev);
46: unsigned long trans_start;
47: struct sk_buff *buffs[DEV_NUMBUFFS];
48: struct sk_buff *backlog;
49: int (*open)(struct device *dev);
50: int (*stop)(struct device *dev);
51: int (*hard_start_xmit) (struct sk_buff *skb, struct device *dev);
52: int (*hard_header) (unsigned char *buff, struct device *dev,
53: unsigned short type, unsigned long daddr,
54: unsigned long saddr, unsigned len);
55: void (*add_arp) (unsigned long addr, struct sk_buff *skb,
56: struct device *dev);
57: void (*queue_xmit)(struct sk_buff *skb, struct device *dev, int pri);
58: int (*rebuild_header)(void *eth, struct device *dev);
59: unsigned short (*type_trans) (struct sk_buff *skb, struct device *dev);
60: void (*send_packet)(struct sk_buff *skb, struct device *dev);
61: void *private;
62:
63: unsigned short type;
64: unsigned short hard_header_len;
65: unsigned short mtu;
66: unsigned char broadcast[MAX_ADDR_LEN];
67: unsigned char dev_addr[MAX_ADDR_LEN];
68: unsigned char addr_len;
69: };
70:
71: extern struct device *dev_base;
72:
73: struct packet_type
74: {
75: unsigned short type; /* This is really NET16(ether_type) other devices
76: will have to translate appropriately. */
77: unsigned short copy:1;
78: int (*func) (struct sk_buff *, struct device *, struct packet_type *);
79: void *data;
80: struct packet_type *next;
81: };
82:
83: /* used by dev_rint */
84: #define IN_SKBUFF 1
85:
86: extern struct packet_type *ptype_base;
87: void dev_queue_xmit (struct sk_buff *skb, struct device *dev, int pri);
88: int dev_rint (unsigned char *buff, unsigned long len, int flags,
89: struct device *dev);
90: unsigned long dev_tint (unsigned char *buff, struct device *dev);
91: void dev_add_pack (struct packet_type *pt);
92: void dev_remove_pack (struct packet_type *pt);
93: struct device *get_dev (char *name);
94:
95:
96: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.