_URB_SELECT_CONFIGURATION

Hi All,

I want to know how the _URB_SELECT_CONFIGURATION URB holds information about multiple interfaces ( for a composite device ). Because _URB_SELECT_CONFIGURATION can just hold one information about interface. Caller (USB client driver) gets back USBD_INTERFACE_INFORMATION with pipe information (to transfer data from endpoints).

For your reference here is _URB_SELECT_CONFIGURATION from usb.h…

struct _URB_SELECT_INTERFACE {
struct _URB_HEADER Hdr; // function code indicates get or set.
USBD_CONFIGURATION_HANDLE ConfigurationHandle;

// client must input AlternateSetting & Interface Number
// class driver returns interface and handle
// for new alternate setting
USBD_INTERFACE_INFORMATION Interface;
};


Thanks in advance.
Anand


Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 250MB of Email Storage.
Visit http://www.juno.com/value to sign up today!

You have to do pointer math. To create the config URB, you call
USBD_CreateConfigurationRequestEx with an array of
USBD_INTERFACE_LIST_ENTRY structures which describe each interface.

After you select the config, you must use pointer math to find the next
interface, this is how I iterate over the interfaces in KMDF
(abbreviated code)

PUCHAR pCur, pEnd;
ULONG intfIndex;
PUSBD_INTERFACE_INFORMATION pIface;

pCur = (PUCHAR) &Urb->UrbSelectConfiguration.Interface;
pEnd = ((PUCHAR) Urb) + Urb->UrbSelectConfiguration.Hdr.Length;
intfIndex =0;

for ( ; pCur < pEnd; pCur += pIface->Length, intfIndex++) {

pIface = (PUSBD_INTERFACE_INFORMATION) pCur;
ASSERT(pIface->NumberOfPipes <= 0xFF);

numPipes = (UCHAR) pIface->NumberOfPipes;

pCur += pIface->Length is what gets you the next interface in the loop
iteration.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@juno.com
Sent: Friday, July 29, 2005 4:45 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] _URB_SELECT_CONFIGURATION

Hi All,

I want to know how the _URB_SELECT_CONFIGURATION URB holds information
about multiple interfaces ( for a composite device ). Because
_URB_SELECT_CONFIGURATION can just hold one information about
interface. Caller (USB client driver) gets back
USBD_INTERFACE_INFORMATION with pipe information (to transfer data from
endpoints).

For your reference here is _URB_SELECT_CONFIGURATION from usb.h…

struct _URB_SELECT_INTERFACE {
struct _URB_HEADER Hdr; // function code indicates
get or set.
USBD_CONFIGURATION_HANDLE ConfigurationHandle;

// client must input AlternateSetting & Interface Number
// class driver returns interface and handle
// for new alternate setting
USBD_INTERFACE_INFORMATION Interface;
};


Thanks in advance.
Anand


Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 250MB of Email Storage.
Visit http://www.juno.com/value to sign up today!


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

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com