The RTL8136 varient of the RTL8139

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

The RTL8136 varient of the RTL8139

Post by BenLunt »

Hi,

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:

Code: Select all

  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,
Ben
- http://www.fysnet.net/osdesign_book_series.htm
simeonz
Member
Member
Posts: 360
Joined: Fri Aug 19, 2016 10:28 pm

Re: The RTL8136 varient of the RTL8139

Post by simeonz »

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)
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: The RTL8136 varient of the RTL8139

Post by BenLunt »

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

Thanks,
Ben
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: The RTL8136 varient of the RTL8139

Post by BenLunt »

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.

Ben
- http://www.fysnet.net/osdesign_book_series.htm
Post Reply