From 7e231e2c92c43c111d33170f8b2d236fc88a01ff Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Thu, 29 Dec 2011 10:13:36 +0000 Subject: [PATCH] [USBOHCI] - Silence a few traces - Add a hack for handling URB_FUNCTION_CLASS_INTERFACE. The hid bus driver performs this request with zero buffer length, which is not valid. Needs more investigation svn path=/branches/usb-bringup/; revision=54777 --- drivers/usb/usbohci/hardware.cpp | 2 +- drivers/usb/usbohci/hub_controller.cpp | 6 ++++++ drivers/usb/usbohci/usb_queue.cpp | 2 +- drivers/usb/usbohci/usb_request.cpp | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbohci/hardware.cpp b/drivers/usb/usbohci/hardware.cpp index c21e4c95154..4e68d666997 100644 --- a/drivers/usb/usbohci/hardware.cpp +++ b/drivers/usb/usbohci/hardware.cpp @@ -1364,7 +1364,7 @@ InterruptServiceRoutine( // // defer processing // - DPRINT1("Status %x Acknowledge %x FrameNumber %x\n", Status, Acknowledge, This->m_HCCA->CurrentFrameNumber); + DPRINT("Status %x Acknowledge %x FrameNumber %x\n", Status, Acknowledge, This->m_HCCA->CurrentFrameNumber); KeInsertQueueDpc(&This->m_IntDpcObject, (PVOID)Status, (PVOID)(DoneHead & ~1)); // diff --git a/drivers/usb/usbohci/hub_controller.cpp b/drivers/usb/usbohci/hub_controller.cpp index 24e08a82c75..67761753312 100644 --- a/drivers/usb/usbohci/hub_controller.cpp +++ b/drivers/usb/usbohci/hub_controller.cpp @@ -1634,6 +1634,12 @@ CHubController::HandleClassInterface( DPRINT1("Value %x\n", Urb->UrbControlVendorClassRequest.Value); DPRINT1("Index %x\n", Urb->UrbControlVendorClassRequest.Index); + if (Urb->UrbControlVendorClassRequest.TransferBufferLength == 0) + { + DPRINT1("Invalid request length\n"); + return STATUS_SUCCESS; + } + // // initialize setup packet // diff --git a/drivers/usb/usbohci/usb_queue.cpp b/drivers/usb/usbohci/usb_queue.cpp index a2853fe072f..f3f993e7bee 100644 --- a/drivers/usb/usbohci/usb_queue.cpp +++ b/drivers/usb/usbohci/usb_queue.cpp @@ -620,7 +620,7 @@ CUSBQueue::TransferDescriptorCompletionCallback( POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, PreviousEndpointDescriptor; NTSTATUS Status; - DPRINT1("CUSBQueue::TransferDescriptorCompletionCallback transfer descriptor %x\n", TransferDescriptorLogicalAddress); + DPRINT("CUSBQueue::TransferDescriptorCompletionCallback transfer descriptor %x\n", TransferDescriptorLogicalAddress); // // find transfer descriptor in control list diff --git a/drivers/usb/usbohci/usb_request.cpp b/drivers/usb/usbohci/usb_request.cpp index f6762c079c1..8fe03208248 100644 --- a/drivers/usb/usbohci/usb_request.cpp +++ b/drivers/usb/usbohci/usb_request.cpp @@ -941,7 +941,7 @@ CUSBRequest::AllocateEndpointDescriptor( Descriptor->Flags |= OHCI_ENDPOINT_SET_ENDPOINT_NUMBER(GetEndpointAddress()); Descriptor->Flags |= OHCI_ENDPOINT_SET_MAX_PACKET_SIZE(GetMaxPacketSize()); - DPRINT1("Flags %x DeviceAddress %x EndpointAddress %x PacketSize %x\n", Descriptor->Flags, GetDeviceAddress(), GetEndpointAddress(), GetMaxPacketSize()); + DPRINT("Flags %x DeviceAddress %x EndpointAddress %x PacketSize %x\n", Descriptor->Flags, GetDeviceAddress(), GetEndpointAddress(), GetMaxPacketSize()); // // is there an endpoint descriptor