Author: janderwald
Date: Fri Dec 7 09:33:05 2012
New Revision: 57813
URL:
http://svn.reactos.org/svn/reactos?rev=57813&view=rev
Log:
[LIBUSB]
- Set USBD status when a device is successfully configured and transferred length for
vendor class requests
- Add error msg when copying of interface descriptor fails
Modified:
trunk/reactos/lib/drivers/libusb/hub_controller.cpp
trunk/reactos/lib/drivers/libusb/usb_device.cpp
Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Fri Dec 7 09:33:05
2012
@@ -1044,6 +1044,7 @@
{
PUSBDEVICE UsbDevice;
PUSBD_INTERFACE_INFORMATION InterfaceInfo;
+ NTSTATUS Status;
//
// is the request for the Root Hub
@@ -1110,7 +1111,13 @@
//
// select configuration
//
- return
UsbDevice->SelectConfiguration(Urb->UrbSelectConfiguration.ConfigurationDescriptor,
&Urb->UrbSelectConfiguration.Interface,
&Urb->UrbSelectConfiguration.ConfigurationHandle);
+ Status =
UsbDevice->SelectConfiguration(Urb->UrbSelectConfiguration.ConfigurationDescriptor,
&Urb->UrbSelectConfiguration.Interface,
&Urb->UrbSelectConfiguration.ConfigurationHandle);
+ if (NT_SUCCESS(Status))
+ {
+ // successfully configured device
+ Urb->UrbSelectConfiguration.Hdr.Status = USBD_STATUS_SUCCESS;
+ }
+ return Status;
}
}
@@ -1843,7 +1850,7 @@
PUSBDEVICE UsbDevice;
USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
- DPRINT("CHubController::HandleVendorDevice Request %x\n",
Urb->UrbControlVendorClassRequest.Request);
+ //DPRINT("CHubController::HandleVendorDevice Request %x\n",
Urb->UrbControlVendorClassRequest.Request);
//
// sanity check
@@ -1891,6 +1898,12 @@
// issue request
//
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup,
Urb->UrbControlVendorClassRequest.TransferBufferLength,
Urb->UrbControlVendorClassRequest.TransferBuffer);
+ if (NT_SUCCESS(Status))
+ {
+ // success
+ Urb->UrbControlVendorClassRequest.Hdr.Status = USBD_STATUS_SUCCESS;
+ Irp->IoStatus.Information =
Urb->UrbControlVendorClassRequest.TransferBufferLength;
+ }
return Status;
}
Modified: trunk/reactos/lib/drivers/libusb/usb_device.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/usb_dev…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/usb_device.cpp [iso-8859-1] Fri Dec 7 09:33:05 2012
@@ -1123,6 +1123,7 @@
if (!NT_SUCCESS(Status))
{
// failed
+ DPRINT1("[LIBUSB] Failed to copy interface descriptor Index %lu
InterfaceDescriptor %p InterfaceInfo %p\n", ConfigurationIndex, InterfaceDescriptor,
InterfaceInfo);
break;
}