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

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