summaryrefslogtreecommitdiff
path: root/src/dev/i8254xGBe.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-08-16 16:49:02 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-08-16 16:49:02 -0400
commit773cb77656174b221c1e51b92a8af7d8e268b733 (patch)
treec6358a24188fde67e0d0a2816f6b9e2b55d8c535 /src/dev/i8254xGBe.cc
parenta9e4daf574e265e419a0a4a6bcbd03edf3a3299f (diff)
downloadgem5-773cb77656174b221c1e51b92a8af7d8e268b733.tar.xz
Devices: Make EtherInts connect in the same way memory ports currently do.
--HG-- extra : convert_revision : 765b096785a77df9adc4791c9101b90696bd7be2
Diffstat (limited to 'src/dev/i8254xGBe.cc')
-rw-r--r--src/dev/i8254xGBe.cc32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/dev/i8254xGBe.cc b/src/dev/i8254xGBe.cc
index d75e37a8a..797f82c13 100644
--- a/src/dev/i8254xGBe.cc
+++ b/src/dev/i8254xGBe.cc
@@ -48,21 +48,22 @@
#include "mem/packet.hh"
#include "mem/packet_access.hh"
#include "params/IGbE.hh"
-#include "params/IGbEInt.hh"
#include "sim/stats.hh"
#include "sim/system.hh"
using namespace iGbReg;
using namespace Net;
-IGbE::IGbE(Params *p)
- : PciDev(p), etherInt(NULL), drainEvent(NULL), useFlowControl(p->use_flow_control),
+IGbE::IGbE(const Params *p)
+ : EtherDevice(p), etherInt(NULL), drainEvent(NULL), useFlowControl(p->use_flow_control),
rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size), rxTick(false),
txTick(false), txFifoTick(false), rdtrEvent(this), radvEvent(this),
tadvEvent(this), tidvEvent(this), tickEvent(this), interEvent(this),
rxDescCache(this, name()+".RxDesc", p->rx_desc_cache_size),
txDescCache(this, name()+".TxDesc", p->tx_desc_cache_size), clock(p->clock)
{
+ etherInt = new IGbEInt(name() + ".int", this);
+
// Initialized internal registers per Intel documentation
// All registers intialized to 0 by per register constructor
regs.ctrl.fd(1);
@@ -108,6 +109,17 @@ IGbE::IGbE(Params *p)
txFifo.clear();
}
+EtherInt*
+IGbE::getEthPort(const std::string &if_name, int idx)
+{
+
+ if (if_name == "interface" && !etherInt) {
+ if (etherInt->getPeer())
+ panic("Port already connected to\n");
+ return etherInt;
+ }
+ return NULL;
+}
Tick
IGbE::writeConfig(PacketPtr pkt)
@@ -1447,20 +1459,6 @@ IGbE::unserialize(Checkpoint *cp, const std::string &section)
rxDescCache.unserialize(cp, csprintf("%s.RxDescCache", section));
}
-IGbEInt *
-IGbEIntParams::create()
-{
- IGbEInt *dev_int = new IGbEInt(name, device);
-
- EtherInt *p = (EtherInt *)peer;
- if (p) {
- dev_int->setPeer(p);
- p->setPeer(dev_int);
- }
-
- return dev_int;
-}
-
IGbE *
IGbEParams::create()
{