OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:34 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 3:47 pm 
Offline
Member
Member

Joined: Fri Nov 01, 2019 1:17 am
Posts: 95
Hi, I am currently writing driver for e1000 nic. I can transmit packets. But the problem is, when I transmit packet it should fire an interrupt. I m using VBox for emulation, and I use pci express. No interruptLine is supported on pci express. So I search for msi, msi-x for e1000, no msi,msi-x. How can I setup interrupt for e1000? Since I need interrupt working for receiving packet.


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 3:58 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Since you talked about MSI, I suspect you are using the APIC. For this reason, its not easy.

To work on all machines, you must obtain the _PRT objects in ACPI. This requires an AML interpreter, which isn't a task for the faint of heart. If you feel up to the challenge, read through the ACPI spec to do it.
If you want ACPI, but don't want to write it, you Intel's ACPICA. Its well documented on the wiki.
Or, you could read the MP tables. That probably won't work on newer machines, as ACPI prevailed over MP / PnP / APM at the end of the 90's. But it will work on QEMU and Bochs.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 4:20 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Kamal123 wrote:
No interruptLine is supported on pci express.

Yes it is.


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 5:16 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Octocontrabass wrote:
Yes it is.

The OP made it sound like their using APIC, if I'm not mistaken.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 6:52 pm 
Offline
Member
Member

Joined: Sun Jun 23, 2019 5:36 pm
Posts: 618
Location: North Dakota, United States
At least Interrupt line, MSI or MSI-X must be supported for all devices (I believe this is mandated by both the PCI local bus spec and PCIe). You cannot (and should not) have a device that does not support at least one of these mechanisms. Are you sure your reading the PCIe configuration space correctly?


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sat Sep 04, 2021 7:41 pm 
Offline
Member
Member

Joined: Fri Nov 01, 2019 1:17 am
Posts: 95
I am using APIC and I am sure that my pcie config registers are correct. I need to go through acpica. But how to enable the msi or interrupt for any device through aml? Please provide the steps.


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sun Sep 05, 2021 4:17 am 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
You don't need ACPI for MSI. You only need ACPI for
non MSI devices with APIC. Simply follow the steps on the wiki PCI page for MSI.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: E1000 nic interrupt problem
PostPosted: Sun Sep 05, 2021 10:53 am 
Offline
Member
Member

Joined: Fri Nov 01, 2019 1:17 am
Posts: 95
nexos wrote:
You don't need ACPI for MSI. You only need ACPI for
non MSI devices with APIC. Simply follow the steps on the wiki PCI page for MSI.


Hi, thanks for reply. I have msi part working. But for non msi device, I need to handle interrupt.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 74 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group