USB Select Configuration doughts ?

Dear Group,

I have some droughts regarding USB Client Driver Development.

  1. If a Device has 2 Interfaces and whenever it is attached to windows XP machine
    There will be two different client Drivers will be loaded to handle those 2 functionalities.
    (Say for example: In Lower Level Usbccgp.sys was loaded)
    Q: Now is it allowed to issue “USBD_CreateConfigurationRequestEx” from these two client drivers to the USB Stack?

  2. If a device has only one configuration and in that configuration only one interface is there and in that no endpoints are there only default control endpoint is available(This behavior we can see in USB-DFU devices).
    Q: Now, for this kind of devices should we call “USBD_CreateConfigurationRequestEx”?
    i.e we should issue a select configuration ?

  3. Q: When we should issue a select configuration to the USB stack ?
    Q: What are the compulsory criteria to call “USBD_CreateConfigurationRequestEx” ?
    Q: Is it compulsory to issue a select configuration from every USB Client driver even
    if the Device having only one configuration?
    Q: Do any of the other drivers in USB Driver Stack (other than Client Driver) will
    Select the configuration ?

Thanks,

Ravinder Are wrote:

Q: Now is it allowed to issue USBD_CreateConfigurationRequestEx from
these two client drivers to the USB Stack?

Of course it is. Think: the client drivers don’t know if they’re talking to the “real” USB stack, or just usbccgp.sys. usbccgp.sys will handle select-config and complete the request back to the child device.

  1. If a device has only one configuration and in that
    configuration only one interface is there and in that no
    endpoints are there only default control endpoint is
    available(This behavior we can see in USB-DFU devices).
    Q: Now, for this kind of devices should we call
    USBD_CreateConfigurationRequestEx?

It’s up to you, I suppose. Some operating systems (i.e. Linux) will send set-config automatically even if your driver is not loaded, so it’s probably best that you set up your device to accept set-config even if it is ignored.

Q: When we should issue a select configuration to the USB stack ?

When you want to select a configuration, of course. You won’t be able to do (say) bulk traffic without doing set-config, because the pipe handles are returned to you as part of that request.

Q: Do any of the other drivers in USB Driver Stack (other than
Client Driver) will Select the configuration ?

Well, in the example you gave, usbccgp.sys is really the one selecting your device’s configuration. The client drivers on the child devices also issue set-config, but they are completed by usbccgp.sys.

  1. yes. Typically a usb client driver does not know it is a part of a
    multi interface device so it will behave just like it is the only
    interface and select a config. The generic parent driver does a select
    config when it is loaded and may ignore the select config from the child
    driver if it matches the current setting for its interface. If it is a
    separate setting, the select config will be converted into a select
    interface setting

  2. if your config has zero endpoints, there is no need to select a
    configuration since there are no address endpoints that you need to
    create pipes on. I just wrote about this, perhaps this will clear up
    some confusion,
    http://blogs.msdn.com/doronh/archive/2007/07/10/of-pipes-and-endpoints.a
    spx

a) When you want to obtain pipe handles for a set of endpoints on your
device other then the default control endpoint which is always active.
b) see a). If you have an endpoint other then the default control
endpoint that you want to communicate with you must select a config or
interface alt setting
c) yes it is required for you to select a config, the usb core doesn’t
care about the number of configurations. The core doesn’t even care if
you select a configuration that the device does not expose. You could
manufacture your own config and select that without ever querying the
device for its reported configuration. What I am saying is that the usb
core does not do anything for you here, you must always select a config
if you have endpoints you want to talk to.
d) see c).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Thursday, July 12, 2007 7:37 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB Select Configuration doughts ?

Dear Group,

I have some droughts regarding USB Client Driver Development.

  1. If a Device has 2 Interfaces and whenever it is attached to windows
    XP machine
    There will be two different client Drivers will be loaded to handle
    those 2 functionalities.
    (Say for example: In Lower Level Usbccgp.sys was loaded)
    Q: Now is it allowed to issue “USBD_CreateConfigurationRequestEx” from
    these two client drivers to the USB Stack?

  2. If a device has only one configuration and in that configuration only
    one interface is there and in that no endpoints are there only default
    control endpoint is available(This behavior we can see in USB-DFU
    devices).
    Q: Now, for this kind of devices should we call
    “USBD_CreateConfigurationRequestEx”?
    i.e we should issue a select configuration ?

  3. Q: When we should issue a select configuration to the USB stack ?
    Q: What are the compulsory criteria to call
    “USBD_CreateConfigurationRequestEx” ?
    Q: Is it compulsory to issue a select configuration from every USB
    Client driver even
    if the Device having only one configuration?
    Q: Do any of the other drivers in USB Driver Stack (other than
    Client Driver) will
    Select the configuration ?

Thanks,


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thank you Chris and Doron,