XHCI: Error when configuring endpoint
Posted: Wed Sep 28, 2022 5:45 am
Hello,
I'm building the a usb keyboard for my OS, but I've met some problem when configuring the endpoint.
Code: https://github.com/fslongjin/DragonOS/b ... ci.c#L1613
My procedures are:
1. Get device descriptor (Line 1613)
2. Get the interface descriptor (Line 1744)
3. Get endpoint descriptor (Line 1748)
4. Set configuration with the value I retrieved from the config descriptor. (Line 1751)
5. Initialize the input_ep1 and create the input context, issue a "Configure Endpoint" command. (Line 1755)
In the first four steps, QEMU does not report errors, and it can also run normally on the physical machine. But the QEMU generates a 'CC_TRB_ERROR' TRB in the fifth step.
I check the "Configure Endpoint" TRB carefully, but I can't find anything wrong. I think, may be there are something wrong in the input context. I already checked the xhci spec and usb3.2 spec, but I don't know how to solve the problem.
So, what's wrong with my code?
Thank you!!!
I'm building the a usb keyboard for my OS, but I've met some problem when configuring the endpoint.
Code: https://github.com/fslongjin/DragonOS/b ... ci.c#L1613
My procedures are:
1. Get device descriptor (Line 1613)
2. Get the interface descriptor (Line 1744)
3. Get endpoint descriptor (Line 1748)
4. Set configuration with the value I retrieved from the config descriptor. (Line 1751)
5. Initialize the input_ep1 and create the input context, issue a "Configure Endpoint" command. (Line 1755)
In the first four steps, QEMU does not report errors, and it can also run normally on the physical machine. But the QEMU generates a 'CC_TRB_ERROR' TRB in the fifth step.
I check the "Configure Endpoint" TRB carefully, but I can't find anything wrong. I think, may be there are something wrong in the input context. I already checked the xhci spec and usb3.2 spec, but I don't know how to solve the problem.
So, what's wrong with my code?
Thank you!!!