rtl 8139 have a bug

Amiwell · 1542

Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
on: March 24, 2020, 08:26:41 AM
hello

i have this lan card owb on many site do not show the images for example ebay, again i have one rtl 8168 compatible card and all works well do not buy rtl 8139 card

all best



hean8209

  • Newbie
  • *
    • Posts: 6
    • Karma: +0/-0
Reply #1 on: March 24, 2020, 12:33:22 PM
I have a RTL 8139C and everything works, tried ebay and no issues loading images, could even load the large enhanced images to my surprise (didnt work last time I tried a few years ago, I dont use ebay typically)

I never could get my RTL8139D card to work though(at all), the C revision seems to work best with Aros
So exact model does matter, and there is no reason if the TCP/IP stack is working that the card should not load images,
but load other stuff.. sounds more like an OWB bug if thats the case, or a png/jpeg library mismatch or similar



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #2 on: March 24, 2020, 02:04:53 PM
I tried rtl8139D on two different computers, some sites like ebay do not show me the articles, I don't think it's an odyssey bug

hi
« Last Edit: March 27, 2020, 04:38:02 PM by salvo »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #3 on: March 27, 2020, 07:45:43 PM
now the card works properly on another computer, but on the other three that I tried, no, mystery



aros-sg

  • Newbie
  • *
    • Posts: 5
    • Karma: +0/-0
Reply #4 on: April 10, 2024, 09:57:03 AM
Tried rtl 8139 driver under QEmu and it worked but there were strange download pauses when trying to download something in OWB.
Source has a TODO comment about wrapped buffer/frame stuff. I did this change:

Code: [Select]
diff --git a/workbench/devs/networks/rtl8139/rtl8139.c b/workbench/devs/networks/rtl8139/rtl8139.c
index bee3096a8f..8fea0f31a6 100644
--- a/workbench/devs/networks/rtl8139/rtl8139.c
+++ b/workbench/devs/networks/rtl8139/rtl8139.c
@@ -554,7 +554,11 @@ static int rtl8139nic_open(struct net_device *unit)
 
        np->rx_buffer = HIDD_PCIDriver_AllocPCIMem(
                                                unit->rtl8139u_PCIDriver,
+#if 1 //stegerg: double size so wrapped-over data can be appended at end
+                                               (np->rx_buf_len * 2 + 16 + (TX_BUF_SIZE * NUM_TX_DESC))
+#else
                                                (np->rx_buf_len + 16 + (TX_BUF_SIZE * NUM_TX_DESC))
+#endif
                                        );
 
        if (np->rx_buffer != NULL)
diff --git a/workbench/devs/networks/rtl8139/unit.c b/workbench/devs/networks/rtl8139/unit.c
index a1a575b78b..78e933e267 100644
--- a/workbench/devs/networks/rtl8139/unit.c
+++ b/workbench/devs/networks/rtl8139/unit.c
@@ -212,8 +212,14 @@ RTLD(bug("[%s] RTL8139_RX_Process: frame @ %p, len=%d\n", unit->rtl8139u_name, f
                        {
                                overspill = (ring_offset + rx_size) - np->rx_buf_len;
 RTLD(bug("[%s] RTL8139_RX_Process: WRAPPED Frame! (%d bytes overspill)\n", unit->rtl8139u_name, overspill))
+#if 1
+                               CopyMem(np->rx_buffer, np->rx_buffer + np->rx_buf_len, overspill);
+#else
                                len = len - overspill;
+
 /* TODO: We need to copy the wrapped buffer into a temp buff to pass to listeners! */
+#endif
                        }
 
                        RTLD( int j;

and I'm not sure if this is how it should be done, but it seemed to help.




Amiwell

  • Legendary Member
  • *****
    • Posts: 2616
    • Karma: +35/-4
  • Peace
Reply #5 on: April 11, 2024, 08:34:38 AM
I don't know I have an 8169 on my desktop PC sometimes I can't see the pictures on the forums, with the acer aspire ZG5, which has the same card, I have no problems



AMIGASYSTEM

  • Global Moderator
  • Legendary Member
  • *****
    • Posts: 3744
    • Karma: +69/-2
  • AROS One
    • AROS One
Reply #6 on: April 11, 2024, 12:16:15 PM
Tried rtl 8139 driver under QEmu and it worked but there were strange download pauses when trying to download something in OWB.
Source has a TODO comment about wrapped buffer/frame stuff. I did this change:

On QEmu as on all Virtual Machines the Network Device to use is "pcnet32.device".

I did a test with AROS One 2.4 (C Library) with QEmu, tried OWB, AmiTube and listened to On-line Radio without experiencing any problem, see screenshot.



deadwood

  • AROS Developer
  • Legendary Member
  • *****
    • Posts: 1524
    • Karma: +118/-0
Reply #7 on: April 23, 2024, 03:39:13 AM

and I'm not sure if this is how it should be done, but it seemed to help.

@all

I integrated this change (untested) to ABIv0 - here is the compiled driver:
https://axrt.org/development/rtl8139.device.20240423.i386-aros.zip