Device enumeration on External EHCI Hubs
Posted: Tue Mar 30, 2021 8:15 pm
Hey everyone,
Hope youre all well.
I have a question purtaining to devices on (external) EHCI hubs (specifically in my case, the good ol' Intel Rate Matching Hub).
Ive got a really thin driver working (high speed msd and hub devices only), and can enumerate and communicate with the aforementioned classes of device if they are plugged into the root hub of an EHCI bus. However, im having trouble getting the driver working with devices on hubs, specifically detecting devices on hubs and then communicating with them.
I get the principle that once the port the device is in is reset the device appears on the bus with address 0 and we have to set it into the address and then configured state as normal.
However, I can barely get the configuration descriptors from msd devices attached to the Hub. Ive tried quite a bit to get this working and its starting to really annoy me, especially since this is being tested on real hardware without a protocol analyser (I use Bochs usually and it seems that Bochs doesnt have a high speed hub device. Perhaps I should look into qemu).
Anyway the current procedure is (in a poor and painful way, attempting to emulate a certain Microsoft blogpost on their EHCI enumeration procedure), as follows:
After powering the port and waiting 2*Power Good, I reset the port, pause for a long delay before clearing the reset, then pausing again before requesting the Config descriptor on address zero (which also fails 9/10 times on the first try, thereby entering a loop of resetting the port and requesting ithe configuration descriptor up to 10 times), after which I might get lucky and get the config descriptor (I should add, the Hub Port ALWAYS successfully returns that ive got a High speed device). However, afterwards, setting the address and all subsequent commands seems to always fail.
Fairly bloody annoying.
But alas, my main question is, does anyone have a sort of checklist of steps they take in those inital steps of their EHCI external hub enumeration procedure (including any delays, bits to poll etc) that they wouldnt mind sharing? Or any advice/help if ive misunderstood something. Ive been scouring over the documentation for a while now, but alongside my degree and work, its been a bit of a hassle and im sure ive missed something.
Thanks anyhoos.
Hope youre all well.
I have a question purtaining to devices on (external) EHCI hubs (specifically in my case, the good ol' Intel Rate Matching Hub).
Ive got a really thin driver working (high speed msd and hub devices only), and can enumerate and communicate with the aforementioned classes of device if they are plugged into the root hub of an EHCI bus. However, im having trouble getting the driver working with devices on hubs, specifically detecting devices on hubs and then communicating with them.
I get the principle that once the port the device is in is reset the device appears on the bus with address 0 and we have to set it into the address and then configured state as normal.
However, I can barely get the configuration descriptors from msd devices attached to the Hub. Ive tried quite a bit to get this working and its starting to really annoy me, especially since this is being tested on real hardware without a protocol analyser (I use Bochs usually and it seems that Bochs doesnt have a high speed hub device. Perhaps I should look into qemu).
Anyway the current procedure is (in a poor and painful way, attempting to emulate a certain Microsoft blogpost on their EHCI enumeration procedure), as follows:
After powering the port and waiting 2*Power Good, I reset the port, pause for a long delay before clearing the reset, then pausing again before requesting the Config descriptor on address zero (which also fails 9/10 times on the first try, thereby entering a loop of resetting the port and requesting ithe configuration descriptor up to 10 times), after which I might get lucky and get the config descriptor (I should add, the Hub Port ALWAYS successfully returns that ive got a High speed device). However, afterwards, setting the address and all subsequent commands seems to always fail.
Fairly bloody annoying.
But alas, my main question is, does anyone have a sort of checklist of steps they take in those inital steps of their EHCI external hub enumeration procedure (including any delays, bits to poll etc) that they wouldnt mind sharing? Or any advice/help if ive misunderstood something. Ive been scouring over the documentation for a while now, but alongside my degree and work, its been a bit of a hassle and im sure ive missed something.
Thanks anyhoos.