diff --git a/src/dev/etherbus.hh b/src/dev/net/etherbus.hh rename from src/dev/etherbus.hh rename to src/dev/net/etherbus.hh --- a/src/dev/etherbus.hh +++ b/src/dev/net/etherbus.hh @@ -32,11 +32,11 @@ * Device module for modelling an ethernet hub */ -#ifndef __ETHERBUS_H__ -#define __ETHERBUS_H__ +#ifndef __DEV_NET_ETHERBUS_HH__ +#define __DEV_NET_ETHERBUS_HH__ -#include "dev/etherobject.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherobject.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherBus.hh" #include "sim/eventq.hh" #include "sim/sim_object.hh" @@ -87,4 +87,4 @@ virtual EtherInt *getEthPort(const std::string &if_name, int idx); }; -#endif // __ETHERBUS_H__ +#endif // __DEV_NET_ETHERBUS_HH__ diff --git a/src/dev/etherbus.cc b/src/dev/net/etherbus.cc rename from src/dev/etherbus.cc rename to src/dev/net/etherbus.cc --- a/src/dev/etherbus.cc +++ b/src/dev/net/etherbus.cc @@ -31,6 +31,7 @@ /* @file * Device module for modelling an ethernet hub */ +#include "dev/net/etherbus.hh" #include #include @@ -40,10 +41,9 @@ #include "base/trace.hh" #include "debug/Ethernet.hh" #include "debug/EthernetData.hh" -#include "dev/etherbus.hh" -#include "dev/etherdump.hh" -#include "dev/etherint.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherdump.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherBus.hh" #include "sim/core.hh" diff --git a/src/dev/etherdevice.hh b/src/dev/net/etherdevice.hh rename from src/dev/etherdevice.hh rename to src/dev/net/etherdevice.hh --- a/src/dev/etherdevice.hh +++ b/src/dev/net/etherdevice.hh @@ -33,13 +33,13 @@ * Base Ethernet Device declaration. */ -#ifndef __DEV_ETHERDEVICE_HH__ -#define __DEV_ETHERDEVICE_HH__ +#ifndef __DEV_NET_ETHERDEVICE_HH__ +#define __DEV_NET_ETHERDEVICE_HH__ #include "base/statistics.hh" #include "dev/pci/device.hh" +#include "params/EtherDevBase.hh" #include "params/EtherDevice.hh" -#include "params/EtherDevBase.hh" #include "sim/sim_object.hh" class EtherInt; @@ -148,4 +148,5 @@ }; -#endif //__DEV_ETHERDEVICE_HH__ +#endif // __DEV_NET_ETHERDEVICE_HH__ + diff --git a/src/dev/etherdevice.cc b/src/dev/net/etherdevice.cc rename from src/dev/etherdevice.cc rename to src/dev/net/etherdevice.cc --- a/src/dev/etherdevice.cc +++ b/src/dev/net/etherdevice.cc @@ -29,7 +29,8 @@ * Lisa Hsu */ -#include "dev/etherdevice.hh" +#include "dev/net/etherdevice.hh" + #include "sim/stats.hh" void diff --git a/src/dev/etherdump.hh b/src/dev/net/etherdump.hh rename from src/dev/etherdump.hh rename to src/dev/net/etherdump.hh --- a/src/dev/etherdump.hh +++ b/src/dev/net/etherdump.hh @@ -32,12 +32,12 @@ * Simple object for creating a simple pcap style packet trace */ -#ifndef __ETHERDUMP_H__ -#define __ETHERDUMP_H__ +#ifndef __DEV_NET_ETHERDUMP_HH__ +#define __DEV_NET_ETHERDUMP_HH__ #include -#include "dev/etherpkt.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherDump.hh" #include "sim/sim_object.hh" @@ -59,4 +59,4 @@ inline void dump(EthPacketPtr &pkt) { dumpPacket(pkt); } }; -#endif // __ETHERDUMP_H__ +#endif // __DEV_NET_ETHERDUMP_HH__ # Node ID 3bde4004982b698d72e2828f8f16216977088daf # Parent 905d5e377d3bb92cd5735c4931c2ac1a62642ba7 diff --git a/src/base/inet.hh b/src/base/inet.hh --- a/src/base/inet.hh +++ b/src/base/inet.hh @@ -53,7 +53,7 @@ #include #include "base/types.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherpkt.hh" #include "dnet/os.h" #include "dnet/eth.h" #include "dnet/ip.h" diff --git a/src/dev/Ethernet.py b/src/dev/net/Ethernet.py rename from src/dev/Ethernet.py rename to src/dev/net/Ethernet.py --- a/src/dev/Ethernet.py +++ b/src/dev/net/Ethernet.py @@ -46,11 +46,11 @@ class EtherObject(SimObject): type = 'EtherObject' abstract = True - cxx_header = "dev/etherobject.hh" + cxx_header = "dev/net/etherobject.hh" class EtherLink(EtherObject): type = 'EtherLink' - cxx_header = "dev/etherlink.hh" + cxx_header = "dev/net/etherlink.hh" int0 = SlavePort("interface 0") int1 = SlavePort("interface 1") delay = Param.Latency('0us', "packet transmit delay") @@ -60,7 +60,7 @@ class MultiEtherLink(EtherObject): type = 'MultiEtherLink' - cxx_header = "dev/multi_etherlink.hh" + cxx_header = "dev/net/multi_etherlink.hh" int0 = SlavePort("interface 0") delay = Param.Latency('0us', "packet transmit delay") delay_var = Param.Latency('0ns', "packet transmit delay variability") @@ -74,34 +74,34 @@ class EtherBus(EtherObject): type = 'EtherBus' - cxx_header = "dev/etherbus.hh" + cxx_header = "dev/net/etherbus.hh" loopback = Param.Bool(True, "send packet back to the sending interface") dump = Param.EtherDump(NULL, "dump object") speed = Param.NetworkBandwidth('100Mbps', "bus speed in bits per second") class EtherTap(EtherObject): type = 'EtherTap' - cxx_header = "dev/ethertap.hh" + cxx_header = "dev/net/ethertap.hh" bufsz = Param.Int(10000, "tap buffer size") dump = Param.EtherDump(NULL, "dump object") port = Param.UInt16(3500, "tap port") class EtherDump(SimObject): type = 'EtherDump' - cxx_header = "dev/etherdump.hh" + cxx_header = "dev/net/etherdump.hh" file = Param.String("dump file") maxlen = Param.Int(96, "max portion of packet data to dump") class EtherDevice(PciDevice): type = 'EtherDevice' abstract = True - cxx_header = "dev/etherdevice.hh" + cxx_header = "dev/net/etherdevice.hh" interface = MasterPort("Ethernet Interface") class IGbE(EtherDevice): # Base class for two IGbE adapters listed above type = 'IGbE' - cxx_header = "dev/i8254xGBe.hh" + cxx_header = "dev/net/i8254xGBe.hh" hardware_address = Param.EthernetAddr(NextEthernetAddr, "Ethernet Hardware Address") rx_fifo_size = Param.MemorySize('384kB', "Size of the rx FIFO") @@ -154,7 +154,7 @@ class EtherDevBase(EtherDevice): type = 'EtherDevBase' abstract = True - cxx_header = "dev/etherdevice.hh" + cxx_header = "dev/net/etherdevice.hh" hardware_address = Param.EthernetAddr(NextEthernetAddr, "Ethernet Hardware Address") @@ -177,7 +177,7 @@ class NSGigE(EtherDevBase): type = 'NSGigE' - cxx_header = "dev/ns_gige.hh" + cxx_header = "dev/net/ns_gige.hh" dma_data_free = Param.Bool(False, "DMA of Data is free") dma_desc_free = Param.Bool(False, "DMA of Descriptors is free") @@ -207,7 +207,7 @@ class Sinic(EtherDevBase): type = 'Sinic' cxx_class = 'Sinic::Device' - cxx_header = "dev/sinic.hh" + cxx_header = "dev/net/sinic.hh" rx_max_copy = Param.MemorySize('1514B', "rx max copy") tx_max_copy = Param.MemorySize('16kB', "tx max copy") diff --git a/src/dev/SConscript b/src/dev/SConscript --- a/src/dev/SConscript +++ b/src/dev/SConscript @@ -41,7 +41,6 @@ SimObject('BadDevice.py') SimObject('DiskImage.py') -SimObject('Ethernet.py') SimObject('Ide.py') SimObject('Platform.py') SimObject('SimpleDisk.py') @@ -51,29 +50,14 @@ Source('baddev.cc') Source('disk_image.cc') Source('dma_device.cc') -Source('etherbus.cc') -Source('etherdevice.cc') -Source('etherdump.cc') -Source('etherint.cc') -Source('etherlink.cc') -Source('multi_packet.cc') -Source('multi_iface.cc') -Source('multi_etherlink.cc') -Source('tcp_iface.cc') -Source('etherpkt.cc') -Source('ethertap.cc') -Source('i8254xGBe.cc') Source('ide_ctrl.cc') Source('ide_disk.cc') Source('intel_8254_timer.cc') Source('mc146818.cc') -Source('ns_gige.cc') Source('pixelpump.cc') -Source('pktfifo.cc') Source('platform.cc') Source('ps2.cc') Source('simple_disk.cc') -Source('sinic.cc') Source('terminal.cc') Source('uart.cc') Source('uart8250.cc') @@ -81,17 +65,6 @@ DebugFlag('DiskImageRead') DebugFlag('DiskImageWrite') DebugFlag('DMA') -DebugFlag('Ethernet') -DebugFlag('MultiEthernet') -DebugFlag('MultiEthernetPkt') -DebugFlag('EthernetCksum') -DebugFlag('EthernetDMA') -DebugFlag('EthernetData') -DebugFlag('EthernetDesc') -DebugFlag('EthernetEEPROM') -DebugFlag('EthernetIntr') -DebugFlag('EthernetPIO') -DebugFlag('EthernetSM') DebugFlag('IdeCtrl') DebugFlag('IdeDisk') DebugFlag('Intel8254Timer') @@ -103,9 +76,4 @@ DebugFlag('Uart') CompoundFlag('DiskImageAll', [ 'DiskImageRead', 'DiskImageWrite' ]) -CompoundFlag('EthernetAll', [ 'Ethernet', 'EthernetPIO', 'EthernetDMA', - 'EthernetData' , 'EthernetDesc', 'EthernetIntr', 'EthernetSM', - 'EthernetCksum', 'EthernetEEPROM' ]) -CompoundFlag('EthernetNoData', [ 'Ethernet', 'EthernetPIO', 'EthernetDesc', - 'EthernetIntr', 'EthernetSM', 'EthernetCksum' ]) CompoundFlag('IdeAll', [ 'IdeCtrl', 'IdeDisk' ]) diff --git a/src/dev/ns_gige_reg.h b/src/dev/net/ns_gige_reg.h rename from src/dev/ns_gige_reg.h rename to src/dev/net/ns_gige_reg.h diff --git a/src/dev/pktfifo.hh b/src/dev/net/pktfifo.hh rename from src/dev/pktfifo.hh rename to src/dev/net/pktfifo.hh --- a/src/dev/pktfifo.hh +++ b/src/dev/net/pktfifo.hh @@ -28,14 +28,15 @@ * Authors: Nathan Binkert */ -#ifndef __DEV_PKTFIFO_HH__ -#define __DEV_PKTFIFO_HH__ +#ifndef __DEV_NET_PKTFIFO_HH__ +#define __DEV_NET_PKTFIFO_HH__ #include #include #include -#include "dev/etherpkt.hh" +#include "base/misc.hh" +#include "dev/net/etherpkt.hh" #include "sim/serialize.hh" class Checkpoint; @@ -208,4 +209,4 @@ void unserialize(const std::string &base, CheckpointIn &cp); }; -#endif // __DEV_PKTFIFO_HH__ +#endif // __DEV_NET_PKTFIFO_HH__ diff --git a/src/dev/pktfifo.cc b/src/dev/net/pktfifo.cc rename from src/dev/pktfifo.cc rename to src/dev/net/pktfifo.cc --- a/src/dev/pktfifo.cc +++ b/src/dev/net/pktfifo.cc @@ -28,8 +28,9 @@ * Authors: Nathan Binkert */ +#include "dev/net/pktfifo.hh" + #include "base/misc.hh" -#include "dev/pktfifo.hh" using namespace std; diff --git a/src/dev/sinic.hh b/src/dev/net/sinic.hh rename from src/dev/sinic.hh rename to src/dev/net/sinic.hh --- a/src/dev/sinic.hh +++ b/src/dev/net/sinic.hh @@ -28,18 +28,18 @@ * Authors: Nathan Binkert */ -#ifndef __DEV_SINIC_HH__ -#define __DEV_SINIC_HH__ +#ifndef __DEV_NET_SINIC_HH__ +#define __DEV_NET_SINIC_HH__ #include "base/inet.hh" #include "base/statistics.hh" -#include "dev/etherdevice.hh" -#include "dev/etherint.hh" -#include "dev/etherpkt.hh" #include "dev/io_device.hh" +#include "dev/net/etherdevice.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" +#include "dev/net/pktfifo.hh" +#include "dev/net/sinicreg.hh" #include "dev/pci/device.hh" -#include "dev/pktfifo.hh" -#include "dev/sinicreg.hh" #include "params/Sinic.hh" #include "sim/eventq.hh" @@ -324,4 +324,4 @@ } // namespace Sinic -#endif // __DEV_SINIC_HH__ +#endif // __DEV_NET_SINIC_HH__ diff --git a/src/dev/sinic.cc b/src/dev/net/sinic.cc rename from src/dev/sinic.cc rename to src/dev/net/sinic.cc --- a/src/dev/sinic.cc +++ b/src/dev/net/sinic.cc @@ -28,12 +28,15 @@ * Authors: Nathan Binkert */ +#include "dev/net/sinic.hh" + #include #include #include #ifdef SINIC_VTOPHYS #include "arch/vtophys.hh" + #endif #include "base/compiler.hh" #include "base/debug.hh" @@ -41,8 +44,7 @@ #include "base/types.hh" #include "config/the_isa.hh" #include "debug/EthernetAll.hh" -#include "dev/etherlink.hh" -#include "dev/sinic.hh" +#include "dev/net/etherlink.hh" #include "mem/packet.hh" #include "mem/packet_access.hh" #include "sim/eventq.hh" diff --git a/src/dev/sinicreg.hh b/src/dev/net/sinicreg.hh rename from src/dev/sinicreg.hh rename to src/dev/net/sinicreg.hh --- a/src/dev/sinicreg.hh +++ b/src/dev/net/sinicreg.hh @@ -28,8 +28,8 @@ * Authors: Nathan Binkert */ -#ifndef __DEV_SINICREG_HH__ -#define __DEV_SINICREG_HH__ +#ifndef __DEV_NET_SINICREG_HH__ +#define __DEV_NET_SINICREG_HH__ #define __SINIC_REG32(NAME, VAL) static const uint32_t NAME = (VAL); #define __SINIC_REG64(NAME, VAL) static const uint64_t NAME = (VAL); @@ -236,4 +236,4 @@ } // namespace Sinic -#endif // __DEV_SINICREG_HH__ +#endif // __DEV_NET_SINICREG_HH__ diff --git a/src/dev/tcp_iface.hh b/src/dev/net/tcp_iface.hh rename from src/dev/tcp_iface.hh rename to src/dev/net/tcp_iface.hh --- a/src/dev/tcp_iface.hh +++ b/src/dev/net/tcp_iface.hh @@ -49,13 +49,13 @@ * transfers messages and co-ordinates the synchronisation among the gem5 * peers. */ -#ifndef __DEV_TCP_IFACE_HH__ -#define __DEV_TCP_IFACE_HH__ +#ifndef __DEV_NET_TCP_IFACE_HH__ +#define __DEV_NET_TCP_IFACE_HH__ #include -#include "dev/multi_iface.hh" +#include "dev/net/multi_iface.hh" class EventManager; @@ -130,4 +130,4 @@ ~TCPIface() override; }; -#endif +#endif // __DEV_NET_TCP_IFACE_HH__ diff --git a/src/dev/tcp_iface.cc b/src/dev/net/tcp_iface.cc rename from src/dev/tcp_iface.cc rename to src/dev/net/tcp_iface.cc --- a/src/dev/tcp_iface.cc +++ b/src/dev/net/tcp_iface.cc @@ -41,7 +41,7 @@ * TCP stream socket based interface class implementation for multi gem5 runs. */ -#include "dev/tcp_iface.hh" +#include "dev/net/tcp_iface.hh" #include #include diff --git a/src/python/swig/pyobject.hh b/src/python/swig/pyobject.hh --- a/src/python/swig/pyobject.hh +++ b/src/python/swig/pyobject.hh @@ -31,7 +31,7 @@ #include #include "base/types.hh" -#include "dev/etherint.hh" +#include "dev/net/etherint.hh" #include "sim/serialize.hh" #include "sim/sim_object.hh" diff --git a/src/python/swig/pyobject.cc b/src/python/swig/pyobject.cc --- a/src/python/swig/pyobject.cc +++ b/src/python/swig/pyobject.cc @@ -36,8 +36,8 @@ #include "base/output.hh" #include "config/the_isa.hh" #if THE_ISA != NULL_ISA -#include "dev/etherdevice.hh" -#include "dev/etherobject.hh" +#include "dev/net/etherdevice.hh" +#include "dev/net/etherobject.hh" #endif #include "mem/ruby/slicc_interface/AbstractController.hh" #include "mem/mem_object.hh" diff --git a/src/dev/multi_packet.hh b/src/dev/net/multi_packet.hh rename from src/dev/multi_packet.hh rename to src/dev/net/multi_packet.hh --- a/src/dev/multi_packet.hh +++ b/src/dev/net/multi_packet.hh @@ -50,8 +50,8 @@ * data packet description, the corresponding data packet always follows * the header packet back-to-back. */ -#ifndef __DEV_MULTI_PACKET_HH__ -#define __DEV_MULTI_PACKET_HH__ +#ifndef __DEV_NET_MULTI_PACKET_HH__ +#define __DEV_NET_MULTI_PACKET_HH__ #include @@ -127,4 +127,4 @@ static bool isBroadcastAddress(const AddressType &addr); }; -#endif +#endif // __DEV_NET_MULTI_PACKET_HH__ diff --git a/src/dev/multi_packet.cc b/src/dev/net/multi_packet.cc rename from src/dev/multi_packet.cc rename to src/dev/net/multi_packet.cc --- a/src/dev/multi_packet.cc +++ b/src/dev/net/multi_packet.cc @@ -42,7 +42,7 @@ * */ -#include "dev/multi_packet.hh" +#include "dev/net/multi_packet.hh" #include #include diff --git a/src/dev/net/SConscript b/src/dev/net/SConscript new file mode 100644 --- /dev/null +++ b/src/dev/net/SConscript @@ -0,0 +1,94 @@ +# -*- mode:python -*- + +# Copyright (c) 2015 ARM Limited +# All rights reserved. +# +# The license below extends only to copyright in the software and shall +# not be construed as granting a license to any other intellectual +# property including but not limited to intellectual property relating +# to a hardware implementation of the functionality of the software +# licensed hereunder. You may use the software subject to the license +# terms below provided that you ensure that this notice is replicated +# unmodified and in its entirety in all distributions of the software, +# modified or unmodified, in source code or in binary form. +# +# Copyright (c) 2006 The Regents of The University of Michigan +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: Steve Reinhardt +# Gabe Black +# Andreas Sandberg + +Import('*') + +if env['TARGET_ISA'] == 'null': + Return() + +SimObject('Ethernet.py') + +# Basic Ethernet infrastructure +Source('etherbus.cc') +Source('etherdevice.cc') +Source('etherdump.cc') +Source('etherint.cc') +Source('etherlink.cc') +Source('etherpkt.cc') +Source('ethertap.cc') + +Source('pktfifo.cc') + +DebugFlag('Ethernet') +DebugFlag('EthernetCksum') +DebugFlag('EthernetDMA') +DebugFlag('EthernetData') +DebugFlag('EthernetDesc') +DebugFlag('EthernetEEPROM') +DebugFlag('EthernetIntr') +DebugFlag('EthernetPIO') +DebugFlag('EthernetSM') + +# Multi gem5 +Source('multi_packet.cc') +Source('multi_iface.cc') +Source('multi_etherlink.cc') +Source('tcp_iface.cc') + +DebugFlag('MultiEthernet') +DebugFlag('MultiEthernetPkt') + +# Ethernet controllers +Source('i8254xGBe.cc') +Source('ns_gige.cc') +Source('sinic.cc') + + + +CompoundFlag('EthernetAll', [ 'Ethernet', 'EthernetPIO', 'EthernetDMA', + 'EthernetData' , 'EthernetDesc', 'EthernetIntr', 'EthernetSM', + 'EthernetCksum', 'EthernetEEPROM' ]) + +CompoundFlag('EthernetNoData', [ 'Ethernet', 'EthernetPIO', 'EthernetDesc', + 'EthernetIntr', 'EthernetSM', 'EthernetCksum' ]) diff --git a/src/dev/ns_gige.hh b/src/dev/net/ns_gige.hh rename from src/dev/ns_gige.hh rename to src/dev/net/ns_gige.hh --- a/src/dev/ns_gige.hh +++ b/src/dev/net/ns_gige.hh @@ -34,16 +34,16 @@ * DP83820 ethernet controller */ -#ifndef __DEV_NS_GIGE_HH__ -#define __DEV_NS_GIGE_HH__ +#ifndef __DEV_NET_NS_GIGE_HH__ +#define __DEV_NET_NS_GIGE_HH__ #include "base/inet.hh" -#include "dev/etherdevice.hh" -#include "dev/etherint.hh" -#include "dev/etherpkt.hh" #include "dev/io_device.hh" -#include "dev/ns_gige_reg.h" -#include "dev/pktfifo.hh" +#include "dev/net/etherdevice.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" +#include "dev/net/ns_gige_reg.h" +#include "dev/net/pktfifo.hh" #include "params/NSGigE.hh" #include "sim/eventq.hh" @@ -389,4 +389,4 @@ virtual void sendDone() { dev->transferDone(); } }; -#endif // __DEV_NS_GIGE_HH__ +#endif // __DEV_NET_NS_GIGE_HH__ diff --git a/src/dev/ns_gige.cc b/src/dev/net/ns_gige.cc rename from src/dev/ns_gige.cc rename to src/dev/net/ns_gige.cc --- a/src/dev/ns_gige.cc +++ b/src/dev/net/ns_gige.cc @@ -33,6 +33,9 @@ * Device module for modelling the National Semiconductor * DP83820 ethernet controller. Does not support priority queueing */ + +#include "dev/net/ns_gige.hh" + #include #include #include @@ -42,8 +45,7 @@ #include "base/types.hh" #include "config/the_isa.hh" #include "debug/EthernetAll.hh" -#include "dev/etherlink.hh" -#include "dev/ns_gige.hh" +#include "dev/net/etherlink.hh" #include "mem/packet.hh" #include "mem/packet_access.hh" #include "params/NSGigE.hh" diff --git a/src/dev/i8254xGBe.cc b/src/dev/net/i8254xGBe.cc rename from src/dev/i8254xGBe.cc rename to src/dev/net/i8254xGBe.cc --- a/src/dev/i8254xGBe.cc +++ b/src/dev/net/i8254xGBe.cc @@ -35,6 +35,7 @@ * other MACs with slight modifications. */ +#include "dev/net/i8254xGBe.hh" /* * @todo really there are multiple dma engines.. we should implement them. @@ -47,7 +48,6 @@ #include "base/trace.hh" #include "debug/Drain.hh" #include "debug/EthernetAll.hh" -#include "dev/i8254xGBe.hh" #include "mem/packet.hh" #include "mem/packet_access.hh" #include "params/IGbE.hh" diff --git a/src/dev/i8254xGBe_defs.hh b/src/dev/net/i8254xGBe_defs.hh rename from src/dev/i8254xGBe_defs.hh rename to src/dev/net/i8254xGBe_defs.hh diff --git a/src/dev/multi_etherlink.hh b/src/dev/net/multi_etherlink.hh rename from src/dev/multi_etherlink.hh rename to src/dev/net/multi_etherlink.hh --- a/src/dev/multi_etherlink.hh +++ b/src/dev/net/multi_etherlink.hh @@ -47,12 +47,12 @@ * multi gem5 runs. * */ -#ifndef __DEV_MULTIETHERLINK_HH__ -#define __DEV_MULTIETHERLINK_HH__ +#ifndef __DEV_NET_MULTIETHERLINK_HH__ +#define __DEV_NET_MULTIETHERLINK_HH__ #include -#include "dev/etherlink.hh" +#include "dev/net/etherlink.hh" #include "params/MultiEtherLink.hh" class MultiIface; @@ -232,4 +232,4 @@ void unserialize(CheckpointIn &cp) override; }; -#endif // __DEV_MULTIETHERLINK_HH__ +#endif // __DEV_NET_MULTIETHERLINK_HH__ diff --git a/src/dev/multi_etherlink.cc b/src/dev/net/multi_etherlink.cc rename from src/dev/multi_etherlink.cc rename to src/dev/net/multi_etherlink.cc --- a/src/dev/multi_etherlink.cc +++ b/src/dev/net/multi_etherlink.cc @@ -41,7 +41,7 @@ * Device module for a full duplex ethernet link for multi gem5 simulations. */ -#include "dev/multi_etherlink.hh" +#include "dev/net/multi_etherlink.hh" #include #include @@ -57,13 +57,13 @@ #include "debug/EthernetData.hh" #include "debug/MultiEthernet.hh" #include "debug/MultiEthernetPkt.hh" -#include "dev/etherdump.hh" -#include "dev/etherint.hh" -#include "dev/etherlink.hh" -#include "dev/etherobject.hh" -#include "dev/etherpkt.hh" -#include "dev/multi_iface.hh" -#include "dev/tcp_iface.hh" +#include "dev/net/etherdump.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherlink.hh" +#include "dev/net/etherobject.hh" +#include "dev/net/etherpkt.hh" +#include "dev/net/multi_iface.hh" +#include "dev/net/tcp_iface.hh" #include "params/EtherLink.hh" #include "sim/core.hh" #include "sim/serialize.hh" diff --git a/src/dev/multi_iface.hh b/src/dev/net/multi_iface.hh rename from src/dev/multi_iface.hh rename to src/dev/net/multi_iface.hh --- a/src/dev/multi_iface.hh +++ b/src/dev/net/multi_iface.hh @@ -75,8 +75,8 @@ * send/receive service implementations (e.g. TCP/IP, MPI,...). A TCP * stream socket version is implemented in dev/src/tcp_iface.[hh,cc]. */ -#ifndef __DEV_MULTI_IFACE_HH__ -#define __DEV_MULTI_IFACE_HH__ +#ifndef __DEV_NET_MULTI_IFACE_HH__ +#define __DEV_NET_MULTI_IFACE_HH__ #include #include @@ -84,8 +84,8 @@ #include #include -#include "dev/etherpkt.hh" -#include "dev/multi_packet.hh" +#include "dev/net/etherpkt.hh" +#include "dev/net/multi_packet.hh" #include "sim/core.hh" #include "sim/drain.hh" #include "sim/global_event.hh" @@ -489,4 +489,4 @@ }; -#endif +#endif // __DEV_NET_MULTI_IFACE_HH__ diff --git a/src/dev/multi_iface.cc b/src/dev/net/multi_iface.cc rename from src/dev/multi_iface.cc rename to src/dev/net/multi_iface.cc --- a/src/dev/multi_iface.cc +++ b/src/dev/net/multi_iface.cc @@ -41,7 +41,7 @@ * The interface class for multi gem5 simulations. */ -#include "dev/multi_iface.hh" +#include "dev/net/multi_iface.hh" #include #include @@ -50,7 +50,7 @@ #include "base/trace.hh" #include "debug/MultiEthernet.hh" #include "debug/MultiEthernetPkt.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherpkt.hh" #include "sim/sim_exit.hh" #include "sim/sim_object.hh" diff --git a/src/dev/etherlink.cc b/src/dev/net/etherlink.cc rename from src/dev/etherlink.cc rename to src/dev/net/etherlink.cc --- a/src/dev/etherlink.cc +++ b/src/dev/net/etherlink.cc @@ -45,6 +45,8 @@ * Device module for modelling a fixed bandwidth full duplex ethernet link */ +#include "dev/net/etherlink.hh" + #include #include #include @@ -54,10 +56,9 @@ #include "base/trace.hh" #include "debug/Ethernet.hh" #include "debug/EthernetData.hh" -#include "dev/etherdump.hh" -#include "dev/etherint.hh" -#include "dev/etherlink.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherdump.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherLink.hh" #include "sim/core.hh" #include "sim/serialize.hh" diff --git a/src/dev/etherobject.hh b/src/dev/net/etherobject.hh rename from src/dev/etherobject.hh rename to src/dev/net/etherobject.hh --- a/src/dev/etherobject.hh +++ b/src/dev/net/etherobject.hh @@ -33,8 +33,8 @@ * Base Ethernet Object declaration. */ -#ifndef __DEV_ETHEROBJECT_HH__ -#define __DEV_ETHEROBJECT_HH__ +#ifndef __DEV_NET_ETHEROBJECT_HH__ +#define __DEV_NET_ETHEROBJECT_HH__ #include "params/EtherObject.hh" #include "sim/sim_object.hh" @@ -64,4 +64,4 @@ }; -#endif //__MEM_MEM_OBJECT_HH__ +#endif // __DEV_NET_ETHEROBJECT_HH__ diff --git a/src/dev/etherpkt.hh b/src/dev/net/etherpkt.hh rename from src/dev/etherpkt.hh rename to src/dev/net/etherpkt.hh --- a/src/dev/etherpkt.hh +++ b/src/dev/net/etherpkt.hh @@ -33,8 +33,8 @@ * Reference counted class containing ethernet packet data */ -#ifndef __ETHERPKT_HH__ -#define __ETHERPKT_HH__ +#ifndef __DEV_NET_ETHERPKT_HH__ +#define __DEV_NET_ETHERPKT_HH__ #include #include @@ -92,4 +92,4 @@ typedef std::shared_ptr EthPacketPtr; -#endif // __ETHERPKT_HH__ +#endif // __DEV_NET_ETHERPKT_HH__ diff --git a/src/dev/etherpkt.cc b/src/dev/net/etherpkt.cc rename from src/dev/etherpkt.cc rename to src/dev/net/etherpkt.cc --- a/src/dev/etherpkt.cc +++ b/src/dev/net/etherpkt.cc @@ -28,11 +28,12 @@ * Authors: Nathan Binkert */ +#include "dev/net/etherpkt.hh" + #include +#include "base/inet.hh" #include "base/misc.hh" -#include "base/inet.hh" -#include "dev/etherpkt.hh" #include "sim/serialize.hh" using namespace std; diff --git a/src/dev/ethertap.hh b/src/dev/net/ethertap.hh rename from src/dev/ethertap.hh rename to src/dev/net/ethertap.hh --- a/src/dev/ethertap.hh +++ b/src/dev/net/ethertap.hh @@ -32,16 +32,16 @@ * Interface to connect a simulated ethernet device to the real world */ -#ifndef __ETHERTAP_HH__ -#define __ETHERTAP_HH__ +#ifndef __DEV_NET_ETHERTAP_HH__ +#define __DEV_NET_ETHERTAP_HH__ #include #include #include "base/pollevent.hh" -#include "dev/etherint.hh" -#include "dev/etherobject.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherobject.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherTap.hh" #include "sim/eventq.hh" #include "sim/sim_object.hh" @@ -133,4 +133,4 @@ }; -#endif // __ETHERTAP_HH__ +#endif // __DEV_NET_ETHERTAP_HH__ diff --git a/src/dev/ethertap.cc b/src/dev/net/ethertap.cc rename from src/dev/ethertap.cc rename to src/dev/net/ethertap.cc --- a/src/dev/ethertap.cc +++ b/src/dev/net/ethertap.cc @@ -32,8 +32,11 @@ * Interface to connect a simulated ethernet device to the real world */ +#include "dev/net/ethertap.hh" + #if defined(__OpenBSD__) || defined(__APPLE__) #include + #endif #include #include @@ -47,10 +50,9 @@ #include "base/trace.hh" #include "debug/Ethernet.hh" #include "debug/EthernetData.hh" -#include "dev/etherdump.hh" -#include "dev/etherint.hh" -#include "dev/etherpkt.hh" -#include "dev/ethertap.hh" +#include "dev/net/etherdump.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" using namespace std; diff --git a/src/dev/i8254xGBe.hh b/src/dev/net/i8254xGBe.hh rename from src/dev/i8254xGBe.hh rename to src/dev/net/i8254xGBe.hh --- a/src/dev/i8254xGBe.hh +++ b/src/dev/net/i8254xGBe.hh @@ -32,8 +32,8 @@ * Device model for Intel's 8254x line of gigabit ethernet controllers. */ -#ifndef __DEV_I8254XGBE_HH__ -#define __DEV_I8254XGBE_HH__ +#ifndef __DEV_NET_I8254XGBE_HH__ +#define __DEV_NET_I8254XGBE_HH__ #include #include @@ -42,12 +42,12 @@ #include "base/inet.hh" #include "debug/EthernetDesc.hh" #include "debug/EthernetIntr.hh" -#include "dev/etherdevice.hh" -#include "dev/etherint.hh" -#include "dev/etherpkt.hh" -#include "dev/i8254xGBe_defs.hh" +#include "dev/net/etherdevice.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherpkt.hh" +#include "dev/net/i8254xGBe_defs.hh" +#include "dev/net/pktfifo.hh" #include "dev/pci/device.hh" -#include "dev/pktfifo.hh" #include "params/IGbE.hh" #include "sim/eventq.hh" @@ -557,4 +557,4 @@ virtual void sendDone() { dev->ethTxDone(); } }; -#endif //__DEV_I8254XGBE_HH__ +#endif //__DEV_NET_I8254XGBE_HH__ diff --git a/src/dev/etherint.cc b/src/dev/net/etherint.cc rename from src/dev/etherint.cc rename to src/dev/net/etherint.cc --- a/src/dev/etherint.cc +++ b/src/dev/net/etherint.cc @@ -28,8 +28,9 @@ * Authors: Nathan Binkert */ +#include "dev/net/etherint.hh" + #include "base/misc.hh" -#include "dev/etherint.hh" #include "sim/sim_object.hh" void diff --git a/src/dev/etherlink.hh b/src/dev/net/etherlink.hh rename from src/dev/etherlink.hh rename to src/dev/net/etherlink.hh --- a/src/dev/etherlink.hh +++ b/src/dev/net/etherlink.hh @@ -44,15 +44,15 @@ * Device module for modelling a fixed bandwidth full duplex ethernet link */ -#ifndef __DEV_ETHERLINK_HH__ -#define __DEV_ETHERLINK_HH__ +#ifndef __DEV_NET_ETHERLINK_HH__ +#define __DEV_NET_ETHERLINK_HH__ #include #include "base/types.hh" -#include "dev/etherint.hh" -#include "dev/etherobject.hh" -#include "dev/etherpkt.hh" +#include "dev/net/etherint.hh" +#include "dev/net/etherobject.hh" +#include "dev/net/etherpkt.hh" #include "params/EtherLink.hh" #include "sim/eventq.hh" #include "sim/sim_object.hh" @@ -163,4 +163,4 @@ }; -#endif // __ETHERLINK_HH__ +#endif // __DEV_NET_ETHERLINK_HH__ diff --git a/src/dev/etherdump.cc b/src/dev/net/etherdump.cc rename from src/dev/etherdump.cc rename to src/dev/net/etherdump.cc --- a/src/dev/etherdump.cc +++ b/src/dev/net/etherdump.cc @@ -31,6 +31,7 @@ /* @file * Simple object for creating a simple pcap style packet trace */ +#include "dev/net/etherdump.hh" #include @@ -39,7 +40,6 @@ #include "base/misc.hh" #include "base/output.hh" -#include "dev/etherdump.hh" #include "sim/core.hh" using std::string; diff --git a/src/dev/etherint.hh b/src/dev/net/etherint.hh rename from src/dev/etherint.hh rename to src/dev/net/etherint.hh --- a/src/dev/etherint.hh +++ b/src/dev/net/etherint.hh @@ -33,12 +33,12 @@ * components. */ -#ifndef __DEV_ETHERINT_HH__ -#define __DEV_ETHERINT_HH__ +#ifndef __DEV_NET_ETHERINT_HH__ +#define __DEV_NET_ETHERINT_HH__ #include -#include "dev/etherpkt.hh" +#include "dev/net/etherpkt.hh" /* * Class representing the actual interface between two ethernet @@ -73,4 +73,4 @@ virtual bool isBusy() { return false; } }; -#endif // __DEV_ETHERINT_HH__ +#endif // __DEV_NET_ETHERINT_HH__