Realtek RT8139 (onboard) - failed to receive packet in loopback mode

Andreas Braukmann braukmann at tse-online.de
Thu Jun 17 16:29:31 GMT 2004


Hi there,

I'm using a bunch of Portwell SBCs with five onboard Realtek
8139C+ NICs. Currently they're running 5.0 kernels from around
April, 2003 and the NICs are driven by rl(4). Since then the
8139C+ was moved to re(4). 

re(4) doesn't like the chips, though.

pciconf -lv output:
 
re0 at pci0:9:0:   class=0x020000 card=0x813910ec chip=0x813910ec rev=0x20 hdr=0x00
    vendor   = 'Realtek Semiconductor'
    device   = 'RT8139 (A/B/C/813x/C+) Fast Ethernet Adapter'
    class    = network
    subclass = ethernet

dmesg output:

re0: <RealTek 8139C+ 10/100BaseTX> port 0xdc00-0xdcff mem 0xe3400000-0xe34000ff irq 11 at device 9.0 on pci0
re0: Ethernet address: 00:90:fb:04:1b:31
re0: diagnostic failed, failed to receive packet in loopback mode
re0: attach aborted due to hardware diag failure
device_attach: re0 attach returned 5


It seems that the 8169-specific hardware diagnostic (re_diag(sc))
should only carried out for chips being identified as 8169 based.

I did this trivial patch (v 1.24):


gate# diff -C2 if_re.c.sav if_re.c
*** if_re.c.sav Thu Jun 17 17:08:48 2004
--- if_re.c     Thu Jun 17 17:09:58 2004
***************
*** 1277,1287 ****
  
        /* Perform hardware diagnostic. */
!       error = re_diag(sc);
  
!       if (error) {
!               printf("re%d: attach aborted due to hardware diag failure\n",
!                   unit);
!               ether_ifdetach(ifp);
!               goto fail;
        }
  
--- 1277,1289 ----
  
        /* Perform hardware diagnostic. */
!       if (sc->rl_type == RL_8169) {
!               error = re_diag(sc);
  
!               if (error) {
!                       printf("re%d: attach aborted due to hardware diag failure\n",
!                                       unit);
!                       ether_ifdetach(ifp);
!                       goto fail;
!               }
        }


The neat result:
gate# kldload ./if_re.ko

re0: <RealTek 8139C+ 10/100BaseTX> port 0xdc00-0xdcff mem 0xe3400000-0xe34000ff irq 11 at device 9.0 on pci0
re0: Ethernet address: 00:90:fb:04:1b:31
re0: [GIANT-LOCKED]
[... same for the other four nics ...]


I see no ill effects so far.


-Andreas




More information about the freebsd-current mailing list