Aleksey,

Unfortunately I found a problem with the WriteRDT part of my patch. Further testing with ETS showed that it didn't cover all cases. Here's an updated patch that fixes the WriteRDT problem with my previous patch, and also sets MDIC_ERROR as previously discussed.

Regards,

Jeff Westfahl

On Wed, 9 Apr 2014, Aleksey Ilyushin wrote:

Jeff,

No, there is no need. I’ll add MDIC_ERROR to the patch and will apply it.

Many thanks for the patch!

Regards,
Aleksey

On 07 Apr 2014, at 23:43, Jeff Westfahl <[email protected]> wrote:

Aleksey,

Yes, setting MDIC_ERROR in addition to MDIC_READY is probably better
behavior. I tested our drivers and they continue to work with both of
these bits set, so no complaints about that here.

Would you like me to resubmit the patch with this change?

Regards,

Jeff Westfahl

Aleksey Ilyushin <[email protected]> wrote on 04/07/2014
02:11:43 PM:

From: Aleksey Ilyushin <[email protected]>
To: [email protected],
Date: 04/07/2014 02:13 PM
Subject: Re: [vbox-dev] <PATCH> Minor changes to e1000 device to support
Phar Lap ETS

Jeff,

Are you sure there is no need to set MDIC.E bit to indicate an error
when the driver attempts to
read/write from non-existing (MDIC.PHYADD != 1) PHY? Your patch merely
sets MDIC.R as if the
operation was successful.

Regards,
Aleksey


On 06 Apr 2014, at 06:53, Jeff Westfahl <[email protected]> wrote:

Here's a patch to the e1000 emulated device that allows it to work
with drivers we've written
for Phar Lap ETS, an RTOS we use on some of our products. Please
consider this for inclusion in
VirtualBox. I won't claim to have done exhaustive regression testing,
but the e1000 driver for a
Windows 7 64-bit VM seems to run just fine with this patch applied. The
patch is against 4.3.8
OSE, but applied cleanly to public SVN.

Author: Jeff Westfahl <[email protected]>
License: Patch is under MIT license

Regards,

Jeff
Westfahl<e1000patch.diff>_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev


_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev



_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev
diff --git a/src/VBox/Devices/Network/DevE1000.cpp b/src/VBox/Devices/Network/DevE1000.cpp
index b8f9ebf..6c43bb2 100755
--- a/src/VBox/Devices/Network/DevE1000.cpp
+++ b/src/VBox/Devices/Network/DevE1000.cpp
@@ -2815,8 +2815,12 @@ static int e1kRegWriteMDIC(PE1KSTATE pThis, uint32_t offset, uint32_t index, uin
     }
     else if (GET_BITS_V(value, MDIC, PHY) != 1)
     {
-        E1kLog(("%s ERROR! Access to invalid PHY detected, phy=%d.\n",
-                pThis->szPrf, GET_BITS_V(value, MDIC, PHY)));
+        /* 
+         * Some drivers scan the MDIO bus for a PHY. We can work with these
+         * drivers if we set MDIC_READY and MDIC_ERROR when there isn't a PHY
+         * at the requested address.
+         */
+        MDIC = MDIC_READY | MDIC_ERROR;
     }
     else
     {
@@ -3090,6 +3094,19 @@ static int e1kRegWriteRDT(PE1KSTATE pThis, uint32_t offset, uint32_t index, uint
     if (RT_LIKELY(rc == VINF_SUCCESS))
     {
         E1kLog(("%s e1kRegWriteRDT\n",  pThis->szPrf));
+        /*
+         * Some drivers advance RDT too far, so that it equals RDH. This
+         * somehow manages to work with real hardware but not with this
+         * emulated device. We can work with these drivers if we just
+         * write 1 less when we see a driver writing RDT equal to RDH.
+         */
+        if (value == RDH)
+        {
+            if (RDH == 0)
+                value = (RDLEN / sizeof(E1KRXDESC)) - 1;
+            else
+                value = RDH - 1;
+        }
         rc = e1kRegWriteDefault(pThis, offset, index, value);
 #ifdef E1K_WITH_RXD_CACHE
         /*
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to