WinUSB question

I try to use WinUSB to write a driver for the FT2232H device.

The question: How can I send URB_FUNCTION_VENDOR_DEVICE commands
using WinUSB? I tried WinUsb_ControlTransfer, but this only seems
to send URB_FUNCTION_CONTROL_TRANSFER data.

(30 minutes later): It seems that the chip interprets the commands
that I send correctly, however I am worried because the usb-analyzer
that I use displays URB_FUNCTION_CONTROL_TRANSFER instead of
URB_FUNCTION_VENDOR_DEVICE.

libftdi, using libusb-win32, displays URB_FUNCTION_VENDOR_DEVICE.

Thanks,
Thomas

URB_FUNCTION_VENDOR_DEVICE is a control URB after it is all said and done, it is just a shortcut for setting a bit or two.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Thomas Heller
Sent: Friday, July 20, 2012 10:26 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WinUSB question

I try to use WinUSB to write a driver for the FT2232H device.

The question: How can I send URB_FUNCTION_VENDOR_DEVICE commands using WinUSB? I tried WinUsb_ControlTransfer, but this only seems to send URB_FUNCTION_CONTROL_TRANSFER data.

(30 minutes later): It seems that the chip interprets the commands that I send correctly, however I am worried because the usb-analyzer that I use displays URB_FUNCTION_CONTROL_TRANSFER instead of URB_FUNCTION_VENDOR_DEVICE.

libftdi, using libusb-win32, displays URB_FUNCTION_VENDOR_DEVICE.

Thanks,
Thomas


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

Am 20.07.2012 19:28, schrieb Doron Holan:

URB_FUNCTION_VENDOR_DEVICE is a control URB after it is all said and done, it is just a shortcut for setting a bit or two.

Please help me to understand your answer correctly
(I’m not a native english speaker): So you mean
that it is ok what I’m doing?

The device doesn’t care whether it receives _FUNCTION_VENDOR_DEVICE or
_CONTROL_TRANSFER?

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Thomas Heller
Sent: Friday, July 20, 2012 10:26 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WinUSB question

I try to use WinUSB to write a driver for the FT2232H device.

The question: How can I send URB_FUNCTION_VENDOR_DEVICE commands using WinUSB? I tried WinUsb_ControlTransfer, but this only seems to send URB_FUNCTION_CONTROL_TRANSFER data.

(30 minutes later): It seems that the chip interprets the commands that I send correctly, however I am worried because the usb-analyzer that I use displays URB_FUNCTION_CONTROL_TRANSFER instead of URB_FUNCTION_VENDOR_DEVICE.

libftdi, using libusb-win32, displays URB_FUNCTION_VENDOR_DEVICE.

Thanks,
Thomas


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


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

Thomas Heller wrote:

I try to use WinUSB to write a driver for the FT2232H device.

The question: How can I send URB_FUNCTION_VENDOR_DEVICE commands
using WinUSB? I tried WinUsb_ControlTransfer, but this only seems
to send URB_FUNCTION_CONTROL_TRANSFER data.

(30 minutes later): It seems that the chip interprets the commands
that I send correctly, however I am worried because the usb-analyzer
that I use displays URB_FUNCTION_CONTROL_TRANSFER instead of
URB_FUNCTION_VENDOR_DEVICE.

All eight of these functions are just handy shortcuts:
URB_FUNCTION_VENDOR_DEVICE
URB_FUNCTION_VENDOR_INTERFACE
URB_FUNCTION_VENDOR_ENDPOINT
URB_FUNCTION_VENDOR_OTHER
URB_FUNCTION_CLASS_DEVICE
URB_FUNCTION_CLASS_INTERFACE
URB_FUNCTION_CLASS_ENDPOINT
URB_FUNCTION_CLASS_OTHER

In each case, the hub driver change them into
URB_FUNCTION_CONTROL_TRANSFER. The ONLY difference between these
requests is the value of the bmRequestType byte.

After all, when you get to the USB wire, there is no such thing as a
“vendor device” request. It’s just a control transfer.


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

Thomas Heller wrote:

Am 20.07.2012 19:28, schrieb Doron Holan:
> URB_FUNCTION_VENDOR_DEVICE is a control URB after it is all said and done, it is just a shortcut for setting a bit or two.
Please help me to understand your answer correctly
(I’m not a native english speaker): So you mean
that it is ok what I’m doing?

The device doesn’t care whether it receives _FUNCTION_VENDOR_DEVICE or
_CONTROL_TRANSFER?

The device never sees those URB_FUNCTION values. Those are all just
requests to the host controller driver. They are merely software. The
host controller then creates a packet and sends it to the control endpoint.

URB_FUNCTION_VENDOR_DEVICE is always converted to
URB_FUNCTION_CONTROL_TRANSFER before it gets to the host controller.
The only reason you are seeing any difference is that you are looking in
two different places.


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

Am 20.07.2012 19:50, schrieb Tim Roberts:

> The device doesn’t care whether it receives _FUNCTION_VENDOR_DEVICE or
> _CONTROL_TRANSFER?

The device never sees those URB_FUNCTION values. Those are all just
requests to the host controller driver. They are merely software. The
host controller then creates a packet and sends it to the control endpoint.

URB_FUNCTION_VENDOR_DEVICE is always converted to
URB_FUNCTION_CONTROL_TRANSFER before it gets to the host controller.
The only reason you are seeing any difference is that you are looking in
two different places.

Cool. I understand now. This allows me to continue…

Thanks,
Thomas