xxxxx@gmail.com wrote:
I know that URB_SELECT_CONFIGURATION has a config and one or more USBD_INTERFACE_INFORMATION structures.
Do you mean to say that in a URB_SELECT_CONFIGURATION, if 3 alt settings come down in 3 USBD_INTERFACE_INFORMATION elements that the host controller driver will send a SET_CONFIGURATION packet followed by 3 SET_INTERFACE packets down to the device?
Exactly. The URB_SELECT_CONFIGURATION request should contain one entry
for each interface in the configuration, with the desired alternate
setting selected in each one. Most drivers do not deal with multiple
interfaces, so typically the request only contains one interface.
I see 3 alts coming down, and see the host controller driver sending a SET_CONFIGURATION and only one SET_INTERFACE down to the device. Also, one device gets alt 0 and another gets alt 1. How does the host controller driver know which alt to select?
Not sure what you mean by “I see 3 alts coming down”. If a device has
one interface with 3 alternate settings, the URB_SELECT_CONFIGURATION
request will only have one interface entry.
Is this a composite device? That throws a wrinkle into things. The
composite driver (usbccgp.sys) lies to the devices above it, so that
each one thinks it is talking to a single interface device. It then has
to translate what it gets into the proper form for a multi-interface
device.
If the first subdevice happens to pick alternate setting 1, usbccgp
needs to send a URB_SELECT_CONFIGURATION request that has alt setting 1
for that interface, but 0 for the others (which haven’t reported yet).
Is this an audio or video class device, where one interface is fake and
the other interface does all the work?
The fact of the matter is, that I am trying to write a driver that emulates what the host controller driver is doing.
That is a nearly hopeless task. Much of the interaction between the
host controller and the hub drivers is not documented.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.