Merge gblack@m5.eecs.umich.edu:/bk/multiarch
[gem5.git] / dev / ethertap.cc
index 807765d91ac289e8703ee8878677827303f81dc5..7589991ef7fd3ec1ec84bda413e7bf63ddcddc87 100644 (file)
@@ -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 &section)
 {
     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);