Page 1 of 1

Interrupts from PCI devices

Posted: Fri Dec 09, 2011 4:07 pm
by Bietje
Hi,

I have written a MSI setup, but I do not know how to test it. My test PC supports MSI for an ethernet controller (class code: 0x2 - subclass code 0x0). How can I let this PCI device trigger an interrupt using my MSI setup? I have no TCP stack or something.. If you need additional information/code; just ask for it!

Thanks in advance & greets,
Bietje

Re: Interrupts from PCI devices

Posted: Sat Dec 10, 2011 4:21 am
by Combuster
You can't quite make an ethernet card raise interrupts without having it do meaningful stuff first. Write an implementation of ARP for starters, and see if you can get a request and reply using a sniffer. Depending on the hardware card you may get an interrupt when the send buffer is empty or when a packet has arrived. When you actually have something that can reliably trigger an interrupt, you have a proper tool to implement MSI.

Re: Interrupts from PCI devices

Posted: Mon Dec 12, 2011 6:55 am
by Bietje
Hi,

That sounds as a good idea. Now I come with a second question.. I downloaded the specification of my NIC, so I know how I can send and receive ARP requests and sent replies. The specification says the following:
Realtek RTL8111B & RTL8168B Specification wrote:The RTL8111B/RTL8168B provide the following set of operational registers mapped into PCI memory
space and I/O space.
I guess that the base of the config space is defined in one of the PCI BAR's, but I couldn't find in which one I should look. So my question is, where can I find which BAR I should read?

Greets,
Bietje