Index: trunk/src/VBox/Devices/Network/Dev3C501.cpp
===================================================================
--- trunk/src/VBox/Devices/Network/Dev3C501.cpp	(revision 107853)
+++ trunk/src/VBox/Devices/Network/Dev3C501.cpp	(revision 107859)
@@ -435,5 +435,5 @@
     uint32_t                            cMsLinkUpDelay;
     /** The device instance number (for logging). */
-    uint32_t                            iInstance;
+    int32_t                             iInstance;
 
     STAMCOUNTER                         StatReceiveBytes;
@@ -1362,5 +1362,5 @@
 }
 
-static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint32_t val)
+static int elIoWrite(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, uint8_t val)
 {
     int     reg = addr & 0xf;
@@ -1438,7 +1438,7 @@
 }
 
-static uint32_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC)
-{
-    uint32_t val = UINT32_MAX;
+static uint8_t elIoRead(PPDMDEVINS pDevIns, PELNKSTATE pThis, uint32_t addr, int *pRC)
+{
+    uint8_t val = UINT8_MAX;
 
     *pRC = VINF_SUCCESS;
@@ -1500,5 +1500,5 @@
     elnkUpdateIrq(pDevIns, pThis);
 
-    Log2Func(("#%d: addr=%#06x val=%#04x\n", pThis->iInstance, addr, val & 0xff));
+    Log2Func(("#%d: addr=%#06x val=%#02x\n", pThis->iInstance, addr, val));
     return val;
 }
@@ -1558,12 +1558,12 @@
     {
         case 1:
-            rc = elIoWrite(pDevIns, pThis, Port, RT_LOBYTE(u32));
+            rc = elIoWrite(pDevIns, pThis, Port, RT_LO_U8(RT_LO_U16(u32)));
             break;
         case 2:
             /* Manually split word access. */
-            rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LOBYTE(u32));
+            rc = elIoWrite(pDevIns, pThis, Port + 0, RT_LO_U8(RT_LO_U16(u32)));
             if (!RT_SUCCESS(rc))
                 break;
-            rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HIBYTE(u32));
+            rc = elIoWrite(pDevIns, pThis, Port + 1, RT_HI_U8(RT_LO_U16(u32)));
             break;
         default:
@@ -2485,5 +2485,5 @@
      * We use our own critical section (historical reasons).
      */
-    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#%u", iInstance);
+    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "3C501#%d", iInstance);
     AssertRCReturn(rc, rc);
     rc = PDMDevHlpSetDeviceCritSect(pDevIns, &pThis->CritSect);
@@ -2587,6 +2587,6 @@
      * Register statistics counters.
      */
-    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",                "/Public/Net/EtherLink%u/BytesReceived", iInstance);
-    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",             "/Public/Net/EtherLink%u/BytesTransmitted", iInstance);
+    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",                "/Public/Net/EtherLink%d/BytesReceived", iInstance);
+    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatTransmitBytes,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data transmitted",             "/Public/Net/EtherLink%d/BytesTransmitted", iInstance);
 
     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatReceiveBytes,       STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,          "Amount of data received",                "/Devices/EtherLink%d/ReceiveBytes", iInstance);
@@ -2612,5 +2612,5 @@
     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktZeroLen,     STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped zero length packet",             "/Devices/EtherLink%d/DropPktZeroLen", iInstance);
     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktVMNotRunning,STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped packet, VM not running",         "/Devices/EtherLink%d/DropPktVMNotRunning", iInstance);
-    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktNoLink,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped packet, no link", "/Devices/EtherLink%d/DropPktNoLink", iInstance);
+    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktNoLink,      STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped packet, no link",                "/Devices/EtherLink%d/DropPktNoLink", iInstance);
     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->StatDropPktStaleRcv,    STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES,     "Dropped packet, status register unread", "/Devices/EtherLink%d/DropPktStaleRcv", iInstance);
 #endif /* VBOX_WITH_STATISTICS */
