case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE:
case URB_FUNCTION_VENDOR_ENDPOINT:
+ case URB_FUNCTION_CLASS_DEVICE:
+ case URB_FUNCTION_CLASS_INTERFACE:
+ case URB_FUNCTION_CLASS_ENDPOINT:
{
libusb_device_handle *husb;
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *request =
unsigned char *req_buf = request->TransferBuffer;
ULONG size = request->TransferBufferLength;
- TRACE( "URB_FUNCTION_VENDOR_*\n" );
+ TRACE( "URB_FUNCTION_{VENDOR,CLASS}_*\n" );
if (req_buf == NULL && request->TransferBufferMDL != NULL)
req_buf = request->TransferBufferMDL->MappedSystemVa;
}
if (!libusb_open( inst->dev, &husb ))
{
- UCHAR req_type = request->RequestTypeReservedBits | (2 << 5);
+ UCHAR req_type = request->RequestTypeReservedBits;
unsigned char *buf;
int ret;
- if (urb->u.UrbHeader.Function == URB_FUNCTION_VENDOR_INTERFACE)
- req_type |= 1;
- else if (urb->u.UrbHeader.Function == URB_FUNCTION_VENDOR_ENDPOINT)
- req_type |= 2;
+ switch (urb->u.UrbHeader.Function)
+ {
+ case URB_FUNCTION_VENDOR_DEVICE: req_type |= 0x40; break;
+ case URB_FUNCTION_VENDOR_INTERFACE: req_type |= 0x41; break;
+ case URB_FUNCTION_VENDOR_ENDPOINT: req_type |= 0x42; break;
+ case URB_FUNCTION_CLASS_DEVICE: req_type |= 0x20; break;
+ case URB_FUNCTION_CLASS_INTERFACE: req_type |= 0x21; break;
+ case URB_FUNCTION_CLASS_ENDPOINT: req_type |= 0x22; break;
+ }
buf = HeapAlloc( GetProcessHeap(), 0, size );
if (buf != NULL)
{
case URB_FUNCTION_VENDOR_DEVICE:
case URB_FUNCTION_VENDOR_INTERFACE:
case URB_FUNCTION_VENDOR_ENDPOINT:
+ case URB_FUNCTION_CLASS_DEVICE:
+ case URB_FUNCTION_CLASS_INTERFACE:
+ case URB_FUNCTION_CLASS_ENDPOINT:
{
usb_dev_handle *husb;
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST *request =
unsigned char *req_buf = request->TransferBuffer;
ULONG size = request->TransferBufferLength;
- TRACE( "URB_FUNCTION_VENDOR_*\n" );
+ TRACE( "URB_FUNCTION_{VENDOR,CLASS}_*\n" );
if (req_buf == NULL && request->TransferBufferMDL != NULL)
req_buf = request->TransferBufferMDL->MappedSystemVa;
husb = usb_open( inst->dev );
if (husb)
{
- UCHAR req_type = request->RequestTypeReservedBits | (2 << 5);
+ UCHAR req_type = request->RequestTypeReservedBits;
char *buf;
int ret;
- if (urb->u.UrbHeader.Function == URB_FUNCTION_VENDOR_INTERFACE)
- req_type |= 1;
- else if (urb->u.UrbHeader.Function == URB_FUNCTION_VENDOR_ENDPOINT)
- req_type |= 2;
+ switch (urb->u.UrbHeader.Function)
+ {
+ case URB_FUNCTION_VENDOR_DEVICE: req_type |= 0x40; break;
+ case URB_FUNCTION_VENDOR_INTERFACE: req_type |= 0x41; break;
+ case URB_FUNCTION_VENDOR_ENDPOINT: req_type |= 0x42; break;
+ case URB_FUNCTION_CLASS_DEVICE: req_type |= 0x20; break;
+ case URB_FUNCTION_CLASS_INTERFACE: req_type |= 0x21; break;
+ case URB_FUNCTION_CLASS_ENDPOINT: req_type |= 0x22; break;
+ }
buf = HeapAlloc( GetProcessHeap(), 0, size );
if (buf != NULL)
{