Quick question r.e. RTL8139 chipsets
Quick question r.e. RTL8139 chipsets
I've got a seriously cheap (£2.50) network card in my testbed machine. It's got (I think) a RTL8139 -ish chip in it, but I can't get it to recieve DHCP ACKs in linux.
I assume the chances of me successfully writing a driver for my OS that makes it work is non-existent? Do people suggest I get a better NIC?
I assume the chances of me successfully writing a driver for my OS that makes it work is non-existent? Do people suggest I get a better NIC?
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
It's a widely documented chipset, but many implementations are buggy/flaky..
Here is a quotation from OpenBSD's manual page for Realtek 8139C+/8169/816xS/811xS/8101E cards:
Here is a quotation from OpenBSD's manual page for Realtek 8139C+/8169/816xS/811xS/8101E cards:
I'm lucky enough to own a few ASUS rebranded devices, they seem to work perfectly under OpenBSD.. but often manifest problems under FreeBSD.rl(4) wrote:Since outbound packets must be longword aligned, the transmit routine has to copy an unaligned packet into an mbuf cluster buffer before transmission. The driver abuses the fact that the cluster buffer pool is allocated at system startup time in a contiguous region starting at a page boundary. Since cluster buffers are 2048 bytes, they are longword aligned by definition. The driver probably should not be depending on this characteristic.
The Realtek data sheets are of especially poor quality: the grammar and spelling are awful and there is a lot of information missing, particularly concerning the receiver operation. One particularly important fact that the data sheets fail to mention relates to the way in which the chip fills in the receive buffer. When an interrupt is posted to signal that a frame has been received, it is possible that another frame might be in the process of being copied into the receive buffer while the driver is busy handling the first one. If the driver manages to finish processing the first frame before the chip is done DMAing the rest of the next frame, the driver may attempt to process the next frame in the buffer before the chip has had a chance to finish DMAing all of it.
The driver can check for an incomplete frame by inspecting the frame length in the header preceding the actual packet data: an incomplete frame will have the magic length of 0xFFF0. When the driver encounters this value, it knows that it has finished processing all currently available packets. Neither this magic value nor its significance are documented anywhere in the Realtek data sheets.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Yes, Manual pages can be viewed online... ![Cool 8)](./images/smilies/icon_cool.gif)
rl(4) - Realtek 8129/8139 10/100 Ethernet devices
re(4) - RealTek 8139C+/8169/816xS/811xS/8101E 10/100/Gigabit Ethernet devices
The source code is also documented quite well...
![Cool 8)](./images/smilies/icon_cool.gif)
rl(4) - Realtek 8129/8139 10/100 Ethernet devices
re(4) - RealTek 8139C+/8169/816xS/811xS/8101E 10/100/Gigabit Ethernet devices
The source code is also documented quite well...
manuals, free, with some limit # per day to download
http://www.datasheetarchive.com/search. ... 0&sub.y=14
http://www.datasheetarchive.com/search. ... 0&sub.y=14
look through the wiki!!!
I wrote a nice little how-to for programming the RTL8139.
I wrote a nice little how-to for programming the RTL8139.
Website: https://joscor.com
Yes, thanks for that, it's not as if I'd check the wiki first for a programming problem before posting... :S01000101 wrote:look through the wiki!!!
I wrote a nice little how-to for programming the RTL8139.
My question was not 'how to' program for the RTL chip, it was 'should I bother with this particular card, as linux seems to have a problem with it - therefore my chances of getting it working are next to NULL'.
I've tried it, as far as I can tell it doesn't work. The QEMU card acknowledges that it has a packet and does nothing, the real card (8139C+) says it's never received a packet. Neither has any incoming packets either.01000101 wrote:look through the wiki!!!
I wrote a nice little how-to for programming the RTL8139.
well, ive tried it on BOCHS, VPC, and real PC's and it works just fine.
The code doesn't show you how to handle the packet . It just shows you how to copy it into memory, then it is up to you what to do with it. Also, you must support IRQ handling as well, either that or poll the recieve buffer at a set interval to keep getting packets.
and if you have a problem with the code, fix it... that's the point of the wiki.
The code doesn't show you how to handle the packet . It just shows you how to copy it into memory, then it is up to you what to do with it. Also, you must support IRQ handling as well, either that or poll the recieve buffer at a set interval to keep getting packets.
and if you have a problem with the code, fix it... that's the point of the wiki.
Website: https://joscor.com