1 /* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Definitions for the Interfaces handler. 7 * 8 * Version: @(#)dev.h 1.0.10 08/12/93 9 * 10 * Authors: Ross Biro 11 * Fred N. van Kempen, <waltje (at) uWalt.NL.Mugnet.ORG> 12 * Corey Minyard <wf-rch!minyard (at) relay.EU.net> 13 * Donald J. Becker, <becker (at) cesdis.gsfc.nasa.gov> 14 * Alan Cox, <Alan.Cox (at) linux.org> 15 * Bjorn Ekwall. <bj0rn (at) blox.se> 16 * Pekka Riikonen <priikone (at) poseidon.pspt.fi> 17 * 18 * This program is free software; you can redistribute it and/or 19 * modify it under the terms of the GNU General Public License 20 * as published by the Free Software Foundation; either version 21 * 2 of the License, or (at your option) any later version. 22 * 23 * Moved to /usr/include/linux for NET3 24 */ 25 #ifndef _LINUX_NETDEVICE_H 26 #define _LINUX_NETDEVICE_H 27 28 #include <linux/if.h> 29 #include <linux/if_ether.h> 30 #include <linux/if_packet.h> 31 32 33 #define MAX_ADDR_LEN 32 /* Largest hardware address length */ 34 35 /* Driver transmit return codes */ 36 #define NETDEV_TX_OK 0 /* driver took care of packet */ 37 #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ 38 #define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ 39 40 /* 41 * Compute the worst case header length according to the protocols 42 * used. 43 */ 44 45 #if !defined(CONFIG_AX25) && !defined(CONFIG_AX25_MODULE) && !defined(CONFIG_TR) 46 #define LL_MAX_HEADER 32 47 #else 48 #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) 49 #define LL_MAX_HEADER 96 50 #else 51 #define LL_MAX_HEADER 48 52 #endif 53 #endif 54 55 #if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \ 56 !defined(CONFIG_NET_IPGRE) && !defined(CONFIG_NET_IPGRE_MODULE) && \ 57 !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \ 58 !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE) 59 #define MAX_HEADER LL_MAX_HEADER 60 #else 61 #define MAX_HEADER (LL_MAX_HEADER + 48) 62 #endif 63 64 struct net_device_subqueue 65 { 66 /* Give a control state for each queue. This struct may contain 67 * per-queue locks in the future. 68 */ 69 unsigned long state; 70 }; 71 72 /* 73 * Network device statistics. Akin to the 2.0 ether stats but 74 * with byte counters. 75 */ 76 77 struct net_device_stats 78 { 79 unsigned long rx_packets; /* total packets received */ 80 unsigned long tx_packets; /* total packets transmitted */ 81 unsigned long rx_bytes; /* total bytes received */ 82 unsigned long tx_bytes; /* total bytes transmitted */ 83 unsigned long rx_errors; /* bad packets received */ 84 unsigned long tx_errors; /* packet transmit problems */ 85 unsigned long rx_dropped; /* no space in linux buffers */ 86 unsigned long tx_dropped; /* no space available in linux */ 87 unsigned long multicast; /* multicast packets received */ 88 unsigned long collisions; 89 90 /* detailed rx_errors: */ 91 unsigned long rx_length_errors; 92 unsigned long rx_over_errors; /* receiver ring buff overflow */ 93 unsigned long rx_crc_errors; /* recved pkt with crc error */ 94 unsigned long rx_frame_errors; /* recv'd frame alignment error */ 95 unsigned long rx_fifo_errors; /* recv'r fifo overrun */ 96 unsigned long rx_missed_errors; /* receiver missed packet */ 97 98 /* detailed tx_errors */ 99 unsigned long tx_aborted_errors; 100 unsigned long tx_carrier_errors; 101 unsigned long tx_fifo_errors; 102 unsigned long tx_heartbeat_errors; 103 unsigned long tx_window_errors; 104 105 /* for cslip etc */ 106 unsigned long rx_compressed; 107 unsigned long tx_compressed; 108 }; 109 110 111 /* Media selection options. */ 112 enum { 113 IF_PORT_UNKNOWN = 0, 114 IF_PORT_10BASE2, 115 IF_PORT_10BASET, 116 IF_PORT_AUI, 117 IF_PORT_100BASET, 118 IF_PORT_100BASETX, 119 IF_PORT_100BASEFX 120 }; 121 122 123 #endif /* _LINUX_DEV_H */ 124