XHCI: EP ring 0 not working as I expected
Posted: Sat Feb 26, 2022 2:04 pm
Hello,
Since my XHCI code was not working at all on real hardware and it was quite messy, I decided to rewrite me whole XHCI code with the experience I got during the development on other drivers.
This time I was more successfull, but there are some things I cannot understand yet.
A) In the XHCI specification, it is stated in chapter 4.0.0 that you can get the portcount by reading the Structural Parameters 1 (HCSPARAMS1) and then read the Number of Ports (MaxPorts) field. On real hardware it works perfectly, on QEMU and VirtualBox they both give the value 1.
B) In the XHCI specification, it is stated in chapter 6.4.6 that the TRB types in the event ring, start with 3* but on real hardware, 30, is seen as 00, 31 is visible in real hardware as 01. Is this a known behavour?
C) In the event ring, you see events like port connection, enabled port, etcetra these give in the field TRB_pointer high and TRB_pointer low a address of the TRB element that caused the event. But when I use the transfer ring, the address is not defined in TRB_pointer.
D) When I push things on the transfer ring and ring the doorbell, I get a event_trb with the resultcode of 0 but I do not see any transfer on my buffer.
When I chance the value inside the commandpackage, it still succeed.
You have here the link of my XHCI file, I hope you can help me.
https://github.com/AdeRegt/SanderOSUSB/ ... dev/xhci.c
Since my XHCI code was not working at all on real hardware and it was quite messy, I decided to rewrite me whole XHCI code with the experience I got during the development on other drivers.
This time I was more successfull, but there are some things I cannot understand yet.
A) In the XHCI specification, it is stated in chapter 4.0.0 that you can get the portcount by reading the Structural Parameters 1 (HCSPARAMS1) and then read the Number of Ports (MaxPorts) field. On real hardware it works perfectly, on QEMU and VirtualBox they both give the value 1.
B) In the XHCI specification, it is stated in chapter 6.4.6 that the TRB types in the event ring, start with 3* but on real hardware, 30, is seen as 00, 31 is visible in real hardware as 01. Is this a known behavour?
C) In the event ring, you see events like port connection, enabled port, etcetra these give in the field TRB_pointer high and TRB_pointer low a address of the TRB element that caused the event. But when I use the transfer ring, the address is not defined in TRB_pointer.
D) When I push things on the transfer ring and ring the doorbell, I get a event_trb with the resultcode of 0 but I do not see any transfer on my buffer.
When I chance the value inside the commandpackage, it still succeed.
You have here the link of my XHCI file, I hope you can help me.
https://github.com/AdeRegt/SanderOSUSB/ ... dev/xhci.c