Page 1 of 1
How to handle interrupts in OHCI
Posted: Tue May 06, 2025 8:17 pm
by amosfuegel
Hello, I am implementing OHCI to support a basic USB device. When configuring interrupts, the endpoint does not appear in hcca.headDone and does not generate hardware interrupts. The simple drivers I have seen all check the entire interrupt_table periodically. Is it correct to check the table 1000 times/second, or am I missing some practical implementation? Does EHCI work similarly?
Thanks.
Re: How to handle interrupts in OHCI
Posted: Wed May 07, 2025 1:22 am
by rdos
In my experience, some OHCI implementations do not generate the expected interrupts, so I use a 1 ms timer as a backup strategy. In fact, I think it would be reasonable to always use a 1 ms timer and ignore the interrupts.
Re: How to handle interrupts in OHCI
Posted: Wed May 07, 2025 11:18 am
by nullplan
According to
the Linux source code, you should just read and handle the interrupt status register. However, the function just in front of the one I linked also exists to handle host controllers that don't update the done queue at all. So that seems to be a common problem.
Re: How to handle interrupts in OHCI
Posted: Thu May 08, 2025 5:51 pm
by BenLunt
It has been quite a while since I did anything with the OHCI, though I do remember something about some controllers not handling interrupts correctly, especially with the DoneQueue mechanism. I would have to find my notes to be more specific.
Have you tried
Bochs? Setting the config to write DEBUG lines to your log file, might help.
Ben
-
https://www.fysnet.net/the_universal_serial_bus.htm