Class-Specific OR Control Transfer ?

Hi,

For USB-Serial driver(WDF), we are using custom commands for handling ioctl set line control

This is how I am converting the urb and sending.

WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(...)
...
WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS(
&controlSetupPacket,
BmRequestHostToDevice,
BMREQUEST_TO_INTERFACE,
Request, //22
Value,
0);
...
WdfUsbTargetDeviceSendControlTransferSynchronously(...)

When seen from the device monitor /sniffer tools this request is appearing as:

Control Transfer (DOWN),
Pipe Handle: 0x0
Setup Packet
21 22 00 00 00 00 00 00
Recipient: Interface
Request Type: Class
Direction: Host->Device
Request: 0x22 (Unknown)
Value: 0x0
Index: 0x0
Length: 0x0

However, I also used the windows usbser driver, for the same IOCTL the sniffer tool gives o/p as..

Class-Specific Request (DOWN),
Destination: Interface, Index 0
Reserved Bits: 0
Request: 0x22
Value: 0x0
Send 0x0 bytes to the device

However for both the requests the response coming as
Control Transfer (UP),

From above two please let me know what URB format differences I am missing in the call to WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS?

For your info:
The intr EP is on bInterfaceNumber: 00
And the Bulk IN and OUT are on the bInterfaceNumber: 01

Hope I need not require to do any additional calls to select the interface and EPs (please clarify).

Thanks in adv.

xxxxx@gmail.com wrote:

For USB-Serial driver(WDF), we are using custom commands for handling ioctl set line control

When seen from the device monitor /sniffer tools this request is appearing as:

Control Transfer (DOWN),
Pipe Handle: 0x0
Setup Packet
21 22 00 00 00 00 00 00
Recipient: Interface
Request Type: Class
Direction: Host->Device
Request: 0x22 (Unknown)
Value: 0x0
Index: 0x0
Length: 0x0

However, I also used the windows usbser driver, for the same IOCTL the sniffer tool gives o/p as…

Class-Specific Request (DOWN),
Destination: Interface, Index 0
Reserved Bits: 0
Request: 0x22
Value: 0x0
Send 0x0 bytes to the device


>From above two please let me know what URB format differences I am missing in the call to WDF_USB_CONTROL_SETUP_PACKET_INIT_CLASS?

You aren’t missing anything. Those are just two different ways of
spelling the exact same request. I assume that output came from a
software sniffer. Is that right? The two requests are simply being
sent as two different URBs, but with the exact same effect. One is
using the “class-specific interface-specific request” URB, while one is
using the “general purpose control transfer” URB. If you had a hardware
sniffer, you would find that the bytes on the wire were exactly the same.


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

Thanks for clarification,

software sniffer. Is that right?
yes.

Both packets from different drivers.

We will continue with rest of the IOCTLs