The RTL8136 varient of the RTL8139
Page 1 of 1

Author:  BenLunt [ Mon Jul 02, 2018 6:52 pm ]
Post subject:  The RTL8136 varient of the RTL8139


Here is one for you. I haven't been able to figure out why, so I thought I would ask here to see if anyone has come across this as well.

One of the laptops I have has a RTL8102E wired network card, which in my understanding, is RTL8139 compatible. However, my RTL8139 driver doesn't work with it. After a little debugging, come to find out when writing a 32-bit physical address to the RBSTART register, only the bottom 16 bits is written.

For example, if I do:
  outpd(base + RBSTART, 0x12345678);
  inpb(0x64); // pause and "clear" the IO Bus
  temp = inpd(base + RBSTART);

The variable "temp" is now only 0x0005678.

I thought maybe it was my outpd() or inpd() routines. Nope. I coded it in assembly just to be sure and I got the same result. This card has both PortIO and MemIO and can use either. The thing is, the exact thing happens when I use MemIO access. This tells me that it is the register. I also tried writing two 16-bit values, first to SBSTART and then to SBSTART + 2. Undefined results. The write must be a 32-bit write.

Come to find out, some of the other registers don't allow writes as one would expect of the RTL8139.

I can't find any documentation that says you have to do something different to the 8136 (RTL810xE) to be compatible with or allow to use as an RTL8139. About the only thing I found is that to use this specific card on a Linux machine, you have to update the cards firmware. This tells me that the error might be with the card itself. However, before the hard drive crashed on this particular laptop, this card was working just fine with WinXP.

Has anyone else (tried) to use the RTL8136 or know of any documentation for it?

Thank you,
- http://www.fysnet.net/osdesign_book_series.htm

Author:  simeonz [ Mon Jul 02, 2018 10:07 pm ]
Post subject:  Re: The RTL8136 varient of the RTL8139

This is not yet my turf, but I will educate myself when the opportunity arises. :)

Linux handles RTL8102E as RTL8169 variant. Considering that aside from the high level code, the kernel source is sprinkled with specific per-model cases, what this means is left to debate, but it uses the RTL8169 register interface.

Here are some references:
The wiki RTL8169 page (obviously, but still)
RTL8169 datasheet
RTL8169S-32/RTL8169S-64 datasheet (some minor differences; this is technically the newer document if anything)
Vendor and Device ID (linux source code, PCI config space detected values)
The adapter entry (linux source code, controller version enumerator to model name and features mapping)
Transmit Configuration register mapping (linux source code, hardware ids from the said register mapped to the version enumerator value above)

Author:  BenLunt [ Tue Jul 03, 2018 11:39 am ]
Post subject:  Re: The RTL8136 varient of the RTL8139

Thank you for the information. I will have a look and see what I can do.


Author:  BenLunt [ Mon Jul 09, 2018 2:12 pm ]
Post subject:  Re: The RTL8136 varient of the RTL8139

Just as a follow up, the card does have the register interface of the RTL8169. This explains quite a bit. The RTL8169 uses quite a different form of buffer transfer as well as the register set being a bit different.

Once I made a few tests to see if it responded to the alternate interface, it worked as expected.

Thanks for the info.

- http://www.fysnet.net/osdesign_book_series.htm

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group