I’ve dealt with the opposite problem, giving one of several USB devices the
same identity regardless how it was plugged into the system.
It seems to me that if you were to give a USB device a name based on where
it was plugged in,
then you need to specify a “path” from the USB controller #x and your device
with all hub and port #s inbetween.
So a device connected to port #3 of a hub, connected to port #5 of a second
hub, connected to root hub port #2 of USB controller #1 would need the
following info
Cport #1,root hub port #2, hub port #5, hub port #3
USBView displays this view, however it obtains it by transversing the USB
like a tree, starting from the hub. Take a look at it, the sources are in
the DDK. It seems like the hardway to obtain the information you want, but I
think it will work.
Larry Harmon
-----Original Message-----
From: Linda Marcellus [mailto:xxxxx@novatel.ca]
Sent: Wednesday, September 10, 2003 6:30 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Re: Binding DeviceId to Usb Port
That’s correct. In your example, the com ports for the device plugged into
the 6th port of the hub plugged into the 3rd port of my PC would get
assigned COM7, COM8, and COM9.
My device does provide a serial number in the device descriptors.
Through trial and error, I’ve seen that the
DevicePropertyPhysicalDeviceObjectName is of the form \Device\USBPDO-n where
n seems to be unique to the hub. Maybe I could use that ‘n’ value and set
my device id string to something like UsbPort-nm, where n is the hub number
and m is the port number (address from the DEVICE_CAPABILITIES).
But will the n value be the same?
Or maybe I should use the PDO’s DevicePropertyAddress so that my device id
is something like UsbPort-E4FC3328_m.
I’m kind of leaning toward the latter.
Linda
“Harmon, Larry (CT)” wrote in message
news:xxxxx@ntdev…
>
> Lets see if I understand you correctly.
>
> If a PC has 4 USB ports and you plug your device into the 1st port you
want
> the virtual serial ports to be named COM1, COM2 & COM3.
>
> If your device is plugged into the 2nd you want the virtual serial ports
to
> be named COM4, COM5 & COM6.
>
> Now if a 6 port hub is plugged into the 3rd port and your device is
plugged
> into the hubs 6th port then ???
>
> It seems to me that you need to know the name of “parent port” your device
> is attached to then base the name off of that.
>
> Larry
>
> PS If your USB device DOES NOT provide a serial number via the device
> descriptor than the symbolic name generated by Windows will contain the
> parent port ID rather than serial # information.
>
> -----Original Message-----
> From: Linda Marcellus [mailto:xxxxx@novatel.ca]
> Sent: Wednesday, September 10, 2003 1:23 PM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Binding DeviceId to Usb Port
>
>
> Hi,
> I’ve written a driver for a usb device which provides three virtual serial
> ports. In my implementation I have two drivers: the driver for my usb
> device, which acts as a bus, and a driver for my virtual serial devices.
>
> I would like the same 3 com ports to be assigned to any device attached to
a
> particular usb port, regardless of which physical device is plugged in.
>
> In response to a IRP_MN_QUERY_ID BusQueryDeviceID request, I would like my
> PDO to return an id string uniquely identifying which usb port my device
is
> connected to. Currently, I use the Address field from the
> DEVICE_CAPABILITIES. However, this isn’t unique across all hubs.
>
> I’ve tried looking through the DDK, searching through Google, various user
> groups, and www.usb.org, but am not quite sure how to phrase the search
> request.
>
> Does anybody know what I should be using? I need a solution that works
for
> both W2K and XP.
>
> Thanks in advance,
> Linda
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@diebold.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@diebold.com
To unsubscribe send a blank email to xxxxx@lists.osr.com