RE: USB Device enumeration API

Hi

I’m just experimenting with USB on Windows and wanted to know if there’s any way to manually get/set the address number (i.e. is set to zero initially) the host designates to a USB device on enumeration using the DEVICE_OBJECT?

Thank you.

No, there is not. Why?

d

debt from my phone


From: xxxxx@klzlk.com
Sent: 12/30/2011 1:28 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] USB Device enumeration API

Hi

I’m just experimenting with USB on Windows and wanted to know if there’s any way to manually get/set the address number (i.e. is set to zero initially) the host designates to a USB device on enumeration using the DEVICE_OBJECT?

Thank you.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

xxxxx@klzlk.com wrote:

I’m just experimenting with USB on Windows and wanted to know if there’s any way to manually get/set the address number (i.e. is set to zero initially) the host designates to a USB device on enumeration using the DEVICE_OBJECT?

No. The entire enumeration process is a private exchange between the
host controller and the device. That’s all completely finished by the
time a driver gets loaded. Indeed, the device address is never exposed
outside of the host controller driver. You can’t influence it, and the
only way to see it is to use a hardware bus analyzer. But why would you
want to?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for the responses it was more for curiosity sake than anything else as I’m just starting out with learning about USB. I wanted to see where the abstraction from address to DEVICE_OBJECT occurs. Which driver manages this type of interaction i.e. production of the DEVICE_OBECT from the address?

Thanks again.

xxxxx@klzlk.com wrote:

Thanks for the responses it was more for curiosity sake than anything else as I’m just starting out with learning about USB. I wanted to see where the abstraction from address to DEVICE_OBJECT occurs. Which driver manages this type of interaction i.e. production of the DEVICE_OBECT from the address?

The mapping doesn’t go in that direction. Remember that USB is an
entirely host-driven bus; nothing happens on the bus unless the host
requests it, and the host controller driver will not set up a transfer
unless some client driver has submitted a request.

A client driver submits requests using a URB. One of the fields in the
URB header is a UsbdDeviceHandle. That handle is (probably) the address
of a private data structure allocated by the host controller driver
during enumeration. That private data structure includes, among other
things, the USB device address.

At the end of the frame, the host controller driver knows which URBs
completed. The URB is contained within an IRP, so the HCD just has to
complete the IRP. The I/O system will take care of notifying the
requesting driver as part of the normal completion process.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.