root/net/tcp/dev.h

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

INCLUDED FROM


   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.5 1992/12/08 20:49:15 bir7 Exp $ */
  23 /* $Log: dev.h,v $
  24  * Revision 0.8.4.5  1992/12/08  20:49:15  bir7
  25  * Edited ctrl-h's out of log messages.
  26  *
  27  * Revision 0.8.4.4  1992/12/06  23:29:59  bir7
  28  * Converted to using lower half interrupt routine.
  29  *
  30  * Revision 0.8.4.3  1992/12/05  21:35:53  bir7
  31  * Updated dev->init type.
  32  *
  33  * Revision 0.8.4.2  1992/12/03  19:54:12  bir7
  34  * Added paranoid queue checking.
  35  *
  36  * Revision 0.8.4.1  1992/11/10  00:17:18  bir7
  37  * version change only.
  38  *
  39  * Revision 0.8.3.2  1992/11/10  00:14:47  bir7
  40  * Changed malloc to kmalloc and added Id and Log
  41  *
  42  */
  43 
  44 #ifndef _TCP_DEV_H
  45 #define _TCP_DEV_H
  46 /* for future expansion when we will have different priorities. */
  47 #define DEV_NUMBUFFS 3
  48 #define MAX_ADDR_LEN 6
  49 #define MAX_HEADER 14
  50 #define MAX_ROUTE 16
  51 
  52 struct device
  53 {
  54   char *name;
  55   unsigned long rmem_end;
  56   unsigned long rmem_start;
  57   unsigned long mem_end;
  58   unsigned long mem_start;
  59   unsigned short base_addr;
  60   unsigned char irq;
  61   unsigned char start:1,
  62                 tbusy:1,
  63                 loopback:1,
  64                 interrupt:1,
  65                 up:1;
  66   struct device *next;
  67   int (*init)(struct device *dev);
  68   unsigned long trans_start;
  69   struct sk_buff *buffs[DEV_NUMBUFFS];
  70   struct sk_buff *backlog; /* no longer used. */
  71   int  (*open)(struct device *dev);
  72   int  (*stop)(struct device *dev);
  73   int (*hard_start_xmit) (struct sk_buff *skb, struct device *dev);
  74   int (*hard_header) (unsigned char *buff, struct device *dev,
  75                       unsigned short type, unsigned long daddr,
  76                       unsigned long saddr, unsigned len);
  77   void (*add_arp) (unsigned long addr, struct sk_buff *skb,
  78                    struct device *dev);
  79   void (*queue_xmit)(struct sk_buff *skb, struct device *dev, int pri);
  80   int (*rebuild_header)(void *eth, struct device *dev);
  81   unsigned short (*type_trans) (struct sk_buff *skb, struct device *dev);
  82   void (*send_packet)(struct sk_buff *skb, struct device *dev);
  83   void *private;
  84 
  85   unsigned short type;
  86   unsigned short hard_header_len;
  87   unsigned short mtu;
  88   unsigned char broadcast[MAX_ADDR_LEN];
  89   unsigned char dev_addr[MAX_ADDR_LEN];
  90   unsigned char addr_len;
  91 };
  92 
  93 extern struct device *dev_base;
  94 
  95 struct packet_type
  96 {
  97    unsigned short type; /* This is really NET16(ether_type) other devices
  98                            will have to translate appropriately. */
  99    unsigned short copy:1;
 100    int (*func) (struct sk_buff *, struct device *, struct packet_type *);
 101    void *data;
 102    struct packet_type *next;
 103 };
 104 
 105 /* used by dev_rint */
 106 #define IN_SKBUFF 1
 107 #define DEV_QUEUE_MAGIC 0x17432895
 108 
 109 
 110 extern struct packet_type *ptype_base;
 111 void dev_queue_xmit (struct sk_buff *skb, struct device *dev, int pri);
 112 int dev_rint (unsigned char *buff, long len, int flags, struct device *dev);
 113 unsigned long dev_tint (unsigned char *buff, struct device *dev);
 114 void dev_add_pack (struct packet_type *pt);
 115 void dev_remove_pack (struct packet_type *pt);
 116 struct device *get_dev (char *name);
 117 void inet_bh (void *tmp);
 118 
 119 
 120 #endif

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