Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help.Missing interrupt from rtl8139 network card.

22 views
Skip to first unread message

leilei

unread,
Nov 24, 2009, 9:11:09 PM11/24/09
to
Hi.
I am writting a small os base on x86 arch.
I have just written a rtl8139 driver for my os.the device's interrupt
vector is 11.
When I run my os, I can 'ping' it through windows for a while.
But after a few minutes, the rtl8139 network card has not produce any
interrupt.

I can assure the os is not dead.Because it can receive the interrupt
from PIT, and the Ticks in my os is increasing.
I also check the device's status, it also do not have any problem.

I have tried a lot of method, still can not solve this problem.

Please give me some help.
thanks.

Alexei A. Frounze

unread,
Nov 24, 2009, 10:18:18 PM11/24/09
to

Is it possible that you somehow disable interrupts from this device or
fail to acknowledge its interrupts (or other requests -- I'm not
familiar with network chips and I don't know what kind of protocols
they use) at some point? Or misconfigure it?

Alex

leilei

unread,
Nov 25, 2009, 1:35:30 AM11/25/09
to
On Nov 25, 11:18 am, "Alexei A. Frounze" <alexfrun...@gmail.com>
wrote:
> Alex- Hide quoted text -
>
> - Show quoted text -

It's very strange.
I only enabled the Rx Interrupt Bit in the Interrupt Mask Register.
But I have found that, the Tx Interrupt Bit, Rx Overflow Bit in the
Interrupt Status Register were set to 1 some times.
Especially, when the Rx Overflow bit in the Interrupt Status Register
was set to 1, the network card can not produce any other Interrupt.It
can not receive datas anymore.

James Harris

unread,
Nov 25, 2009, 2:02:26 AM11/25/09
to

Just a guess but network devices usually have a ring buffer for packet
receipt. As well as receiving the packet are you clearing the packet
from the incoming ring buffer?

James

James Harris

unread,
Nov 25, 2009, 2:30:57 AM11/25/09
to

Umm, on the rx overflow bit see my other post about the rx ring
buffer. It may be as simple a matter as properly acknowledging either
packet receipt or, since you are getting tx interrupts, perhaps even
packet transmission. Either ring buffer could fill up if its
interrupts are not acknowledged to the network card.

James

James Harris

unread,
Nov 28, 2009, 6:51:32 AM11/28/09
to

To the OP, did you get a fix? Or to anyone else who may be looking at
this thread later, it seems that to tell the 8139 which bytes your
driver has taken out of the rx ring buffer you need to advance the
8139's CAPR register - the current address of packet read - past the
packets you have processed. Are you already doing this?

Realtek have made an effort with providing the datasheet which is a
plus to them but it could be more informative. Try Googling for
something like

"current address of packet read"

There are lots of hits.

James

Jeroen van Bemmel

unread,
Nov 29, 2009, 6:47:31 AM11/29/09
to James Harris
Suggest to look at the Linux driver for RTL8139 (see
http://lxr.free-electrons.com/source/drivers/net/8139too.c)

Regards,
Jeroen

0 new messages