X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=dev%2Fethertap.cc;h=7589991ef7fd3ec1ec84bda413e7bf63ddcddc87;hb=466284b5d29ad0d44c1b020353cf7521be2b90de;hp=1603a9bd3a25f5a37cd59c6122a53630e3c56d9f;hpb=86836124ed272945e9d360c068728cd03917398d;p=gem5.git diff --git a/dev/ethertap.cc b/dev/ethertap.cc index 1603a9bd3..7589991ef 100644 --- a/dev/ethertap.cc +++ b/dev/ethertap.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 The Regents of The University of Michigan + * Copyright (c) 2003-2005 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -237,9 +237,10 @@ EtherTap::process(int revent) DPRINTF(Ethernet, "bus busy...buffer for retransmission\n"); packetBuffer.push(packet); if (!txEvent.scheduled()) - txEvent.schedule(curTick + 1000); - } else if (dump) + txEvent.schedule(curTick + retryTime); + } else if (dump) { dump->dump(packet); + } } } @@ -259,7 +260,7 @@ EtherTap::retransmit() } if (!packetBuffer.empty() && !txEvent.scheduled()) - txEvent.schedule(curTick + 1000); + txEvent.schedule(curTick + retryTime); } //===================================================================== @@ -269,7 +270,8 @@ EtherTap::serialize(ostream &os) { SERIALIZE_SCALAR(socket); SERIALIZE_SCALAR(buflen); - SERIALIZE_ARRAY((uint8_t *)buffer,buflen); + uint8_t *buffer = (uint8_t *)this->buffer; + SERIALIZE_ARRAY(buffer, buflen); SERIALIZE_SCALAR(buffer_offset); SERIALIZE_SCALAR(data_len); @@ -289,7 +291,8 @@ EtherTap::unserialize(Checkpoint *cp, const std::string §ion) { UNSERIALIZE_SCALAR(socket); UNSERIALIZE_SCALAR(buflen); - UNSERIALIZE_ARRAY((uint8_t *)buffer,buflen); + uint8_t *buffer = (uint8_t *)this->buffer; + UNSERIALIZE_ARRAY(buffer, buflen); UNSERIALIZE_SCALAR(buffer_offset); UNSERIALIZE_SCALAR(data_len); @@ -311,7 +314,7 @@ EtherTap::unserialize(Checkpoint *cp, const std::string §ion) BEGIN_DECLARE_SIM_OBJECT_PARAMS(EtherTap) SimObjectParam peer; - SimObjectParam packet_dump; + SimObjectParam dump; Param port; Param bufsz; @@ -320,7 +323,7 @@ END_DECLARE_SIM_OBJECT_PARAMS(EtherTap) BEGIN_INIT_SIM_OBJECT_PARAMS(EtherTap) INIT_PARAM_DFLT(peer, "peer interface", NULL), - INIT_PARAM_DFLT(packet_dump, "object to dump network packets to", NULL), + INIT_PARAM_DFLT(dump, "object to dump network packets to", NULL), INIT_PARAM_DFLT(port, "tap port", 3500), INIT_PARAM_DFLT(bufsz, "tap buffer size", 10000) @@ -329,7 +332,7 @@ END_INIT_SIM_OBJECT_PARAMS(EtherTap) CREATE_SIM_OBJECT(EtherTap) { - EtherTap *tap = new EtherTap(getInstanceName(), packet_dump, port, bufsz); + EtherTap *tap = new EtherTap(getInstanceName(), dump, port, bufsz); if (peer) { tap->setPeer(peer);