RealTek 8139 driver
RealTek 8139 driver
So, I started a RTL8139 driver.
I've wrote routines for initializing(reset, flags to set, &co.) the NIC.
But i'm stuck: what I have is a "Hard To Understand" programming guide, the wiki article and a hackish linux-borrowed driver.
What I ask: I've got a Rx Buffer and a proper IRQ handler. What should I do when the IRQ is a Rx one, in order to receive the packet?
thanks, eddyb.
I've wrote routines for initializing(reset, flags to set, &co.) the NIC.
But i'm stuck: what I have is a "Hard To Understand" programming guide, the wiki article and a hackish linux-borrowed driver.
What I ask: I've got a Rx Buffer and a proper IRQ handler. What should I do when the IRQ is a Rx one, in order to receive the packet?
thanks, eddyb.
Last edited by eddyb on Mon Dec 08, 2008 12:33 pm, edited 1 time in total.
Re: RealTek 8139 driver
no one?
or at least some good documentation(not rubbish).
I'm going mad... why the hack there is no good docs for osdevers ?
or at least some good documentation(not rubbish).
I'm going mad... why the hack there is no good docs for osdevers ?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: RealTek 8139 driver
You have the specifications. Those things are good document to our standards.
Re: RealTek 8139 driver
if you'll tell me from where to get that, i thank you.Combuster wrote:You have the specifications. Those things are good document to our standards.
NOTE: RealTek.com ftp servers doesn't allow more than 0.5 simultaneous connections .
EDIT: So nice ...: they are down right now.
Last edited by eddyb on Thu Dec 04, 2008 11:43 am, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: RealTek 8139 driver
Like I said, you already had them.
The Wiki wrote: * http://www.datasheetarchive.com/pdf/rtl ... sheet.html, Datasheet for the RTL8139
* http://www.cs.usfca.edu/~cruse/cs326f04 ... sGuide.pdf, Programming guide for the RTL8139
Re: RealTek 8139 driver
Yes, I have them because i have read that in the wiki .Combuster wrote:Like I said, you already had them.The Wiki wrote: * http://www.datasheetarchive.com/pdf/rtl ... sheet.html, Datasheet for the RTL8139
* http://www.cs.usfca.edu/~cruse/cs326f04 ... sGuide.pdf, Programming guide for the RTL8139
- first link is outdated(just click on it and you'll see).
- the second is that "Hard To Understand"(if is not so, i'm ) programming guide.
EDIT: I've found it: http://www.magnesium.net/~wpaul/rt/spec-8139cp(150).pdf. I've added the link to wiki. Maybe i'll write the rlt8139 page(now it's not a quality one), when i'll understand it.
Re: RealTek 8139 driver
Q: Is there any way to link a real eth to a emulated [Qemu] NIC? I have the eth1 board(the main is eth0) for tests, and i want qemu, when it runs, to redirect ALL packages to the emulated NIC.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: RealTek 8139 driver
RTFM? Seriously, it's in the QEMU manual. Just read the thing and experiment.
Re: RealTek 8139 driver
-net user: gives you a host user network stack access(i think is like NAT).pcmattman wrote:RTFM? Seriously, it's in the QEMU manual. Just read the thing and experiment.
-net tun: i think is what i need... but i don't know how to use it(i must create some tunnel, but how? I've found vtund, but I'm not sure if it's what i want).
other options: are more like forwarding some of the packets, etc..
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: RealTek 8139 driver
Yes, tun is what you want - a tun/tap interface. I'm not 100% sure on the *nix method of creating and using such interfaces (tun0 for example).
You may also want to try passing an interface name to QEmu, though I'm not sure it creates the interface for you.
You may also want to try passing an interface name to QEmu, though I'm not sure it creates the interface for you.
Re: RealTek 8139 driver
You can take a look at DexOS driver (including full TCP/IP stack)
http://www.dex4u.com/Rtl8139.zip
Note: its users polling.
http://www.dex4u.com/Rtl8139.zip
Note: its users polling.
Re: RealTek 8139 driver
thanks.Dex wrote:You can take a look at DexOS driver (including full TCP/IP stack)
http://www.dex4u.com/Rtl8139.zip
Note: its users polling.
now i want to make qemu work.
also, the length/type field in net packet is length or type?
and i suppose the first packet is at rx_buffer_address+16 (some 16 byte header, but for what is it?)?
Re: RealTek 8139 driver
I've tried to dump first 80 (minimal size of eth frame + 16 bytes header -> What Is This Header?!) bytes of the Rx ring, but I've found only zeros(I've filled with zeros, at initialization, all the Rx ring to be sure there is nothing). so? i need to do something to make the NIC put there the packet? But I've set it to have no FIFO limit or something like that, just put there the packet it receives.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: RealTek 8139 driver
Have you made sure it actually received some packets on the line? If you use a switch it could've routed packets directly to where they should so your test PC can't have seen them.
Re: RealTek 8139 driver
I dump that on a Rx IRQ... and I've got a lot on my real PPoE connection(maybe from PPoE acces concentrator stuff & co).Combuster wrote:Have you made sure it actually received some packets on the line? If you use a switch it could've routed packets directly to where they should so your test PC can't have seen them.