00001 /* 00002 * Copyright (C) 2003 CTIE, Monash University 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef _ETHERNETDEFS_H 00020 #define _ETHERNETDEFS_H 00021 00022 00023 // Constants from the 802.3 spec 00024 #define MAX_PACKETBURST 13 00025 #define GIGABIT_MAX_BURST_BYTES 8192 /* don't start new frame after 8192 or more bytes already transmitted */ 00026 #define MAX_ETHERNET_DATA 1500 /* including LLC, SNAP etc headers */ 00027 #define MAX_ETHERNET_FRAME 1518 /* excludes preamble and SFD */ 00028 #define MIN_ETHERNET_FRAME 64 /* excludes preamble and SFD */ 00029 #define GIGABIT_MIN_FRAME_WITH_EXT 512 /* excludes preamble and SFD, but includes 448 byte extension */ 00030 #define INTERFRAME_GAP_BITS 96 00031 #define ETHERNET_TXRATE 10000000L /* 10 Mbit/sec (in bit/s) */ 00032 #define FAST_ETHERNET_TXRATE 100000000L /* 100 Mbit/sec (in bit/s) */ 00033 #define GIGABIT_ETHERNET_TXRATE 1000000000L /* 1000 Mbit/sec (in bit/s) */ 00034 #define SLOT_TIME (512.0/ETHERNET_TXRATE) /* for Ethernet & Fast Ethernet, in seconds */ 00035 #define GIGABIT_SLOT_TIME (4096.0/GIGABIT_ETHERNET_TXRATE) /* seconds */ 00036 #define MAX_ATTEMPTS 16 00037 #define BACKOFF_RANGE_LIMIT 10 00038 #define JAM_SIGNAL_BYTES 4 00039 #define PREAMBLE_BYTES 7 00040 #define SFD_BYTES 1 00041 #define PAUSE_BITTIME 512 /* pause is in 512-bit-time units */ 00042 00043 #define ETHER_MAC_FRAME_BYTES (6+6+2+4) /* src(6)+dest(6)+length/type(2)+FCS(4) */ 00044 #define ETHER_LLC_HEADER_LENGTH (3) /* ssap(1)+dsap(1)+control(1) */ 00045 #define ETHER_SNAP_HEADER_LENGTH (5) /* org(3)+local(2) */ 00046 #define ETHER_PAUSE_COMMAND_BYTES (6) /* FIXME verify */ 00047 00048 #endif 00049
1.2.17