Author: janderwald
Date: Fri Dec 7 08:18:45 2012
New Revision: 57811
URL:
http://svn.reactos.org/svn/reactos?rev=57811&view=rev
Log:
[LIBUSB]
- Set status and transferred byte length
- Display error msg when request fails
- Remove asserts
- CORE-6574 CORE-6676
Modified:
trunk/reactos/lib/drivers/libusb/hub_controller.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 08:18:45
2012
@@ -740,6 +740,12 @@
Status = STATUS_SUCCESS;
break;
}
+ case IRP_MN_SURPRISE_REMOVAL:
+ {
+ DPRINT("[USBLIB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n");
+ Status = STATUS_SUCCESS;
+ break;
+ }
default:
{
//
@@ -1479,7 +1485,10 @@
// submit setup packet
//
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup,
Urb->UrbControlDescriptorRequest.TransferBufferLength,
Urb->UrbControlDescriptorRequest.TransferBuffer);
- ASSERT(Status == STATUS_SUCCESS);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("[USBLIB] HandleGetDescriptorFromInterface failed with %x\n",
Status);
+ }
//
// done
@@ -1499,7 +1508,7 @@
PUSBDEVICE UsbDevice;
ULONG Length, BufferLength;
- DPRINT("[USBLIB] HandleGetDescriptor\n");
+ DPRINT("[USBLIB] HandleGetDescriptor Type %x\n",
Urb->UrbControlDescriptorRequest.DescriptorType);
//
// check descriptor type
@@ -1520,6 +1529,8 @@
// copy root hub device descriptor
//
RtlCopyMemory((PUCHAR)Urb->UrbControlDescriptorRequest.TransferBuffer,
&m_DeviceDescriptor, sizeof(USB_DEVICE_DESCRIPTOR));
+ Irp->IoStatus.Information = sizeof(USB_DEVICE_DESCRIPTOR);
+ Urb->UrbControlDescriptorRequest.Hdr.Status = USBD_STATUS_SUCCESS;
Status = STATUS_SUCCESS;
}
else
@@ -1546,6 +1557,8 @@
// retrieve device descriptor from device
//
UsbDevice->GetDeviceDescriptor((PUSB_DEVICE_DESCRIPTOR)Urb->UrbControlDescriptorRequest.TransferBuffer);
+ Irp->IoStatus.Information = sizeof(USB_DEVICE_DESCRIPTOR);
+ Urb->UrbControlDescriptorRequest.Hdr.Status = USBD_STATUS_SUCCESS;
Status = STATUS_SUCCESS;
}
break;
@@ -1678,7 +1691,9 @@
//
// store result size
//
+ Irp->IoStatus.Information = Length;
Urb->UrbControlDescriptorRequest.TransferBufferLength = Length;
+ Urb->UrbControlDescriptorRequest.Hdr.Status = USBD_STATUS_SUCCESS;
Status = STATUS_SUCCESS;
}
break;
@@ -1827,6 +1842,7 @@
NTSTATUS Status = STATUS_NOT_IMPLEMENTED;
PUSBDEVICE UsbDevice;
USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
+ PVOID TransferBuffer = NULL;
DPRINT("CHubController::HandleVendorDevice Request %x\n",
Urb->UrbControlVendorClassRequest.Request);
@@ -1876,7 +1892,6 @@
// issue request
//
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup,
Urb->UrbControlVendorClassRequest.TransferBufferLength,
Urb->UrbControlVendorClassRequest.TransferBuffer);
- PC_ASSERT(NT_SUCCESS(Status));
return Status;
}