mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
[USB]
- Add interface function to IUSBHardwareDevice, which returns the USB controller type - The controller type is used for debugging in the common usb library (libusb) svn path=/trunk/; revision=58268
This commit is contained in:
parent
e1fa66b4e2
commit
b60486430f
9 changed files with 150 additions and 116 deletions
|
@ -127,6 +127,13 @@ CUSBHardwareDevice::QueryInterface(
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LPCWSTR
|
||||||
|
STDMETHODCALLTYPE
|
||||||
|
CUSBHardwareDevice::GetUSBType()
|
||||||
|
{
|
||||||
|
return L"USBEHCI";
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
STDMETHODCALLTYPE
|
||||||
CUSBHardwareDevice::Initialize(
|
CUSBHardwareDevice::Initialize(
|
||||||
|
|
|
@ -280,7 +280,7 @@ USBHUB_PdoHandleInternalDeviceControl(
|
||||||
DPRINT1("URB_FUNCTION_CLASS_INTERFACE\n");
|
DPRINT1("URB_FUNCTION_CLASS_INTERFACE\n");
|
||||||
break;
|
break;
|
||||||
case URB_FUNCTION_VENDOR_DEVICE:
|
case URB_FUNCTION_VENDOR_DEVICE:
|
||||||
DPRINT1("URB_FUNCTION_VENDOR_DEVICE\n");
|
DPRINT("URB_FUNCTION_VENDOR_DEVICE\n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DPRINT1("IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", Urb->UrbHeader.Function);
|
DPRINT1("IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", Urb->UrbHeader.Function);
|
||||||
|
|
|
@ -124,6 +124,14 @@ CUSBHardwareDevice::QueryInterface(
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LPCWSTR
|
||||||
|
STDMETHODCALLTYPE
|
||||||
|
CUSBHardwareDevice::GetUSBType()
|
||||||
|
{
|
||||||
|
return L"USBOHCI";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
STDMETHODCALLTYPE
|
STDMETHODCALLTYPE
|
||||||
CUSBHardwareDevice::Initialize(
|
CUSBHardwareDevice::Initialize(
|
||||||
|
|
|
@ -145,6 +145,14 @@ CUSBHardwareDevice::QueryInterface(
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LPCWSTR
|
||||||
|
STDMETHODCALLTYPE
|
||||||
|
CUSBHardwareDevice::GetUSBType()
|
||||||
|
{
|
||||||
|
return L"USBUHCI";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
CUSBHardwareDevice::Initialize(
|
CUSBHardwareDevice::Initialize(
|
||||||
PDRIVER_OBJECT DriverObject,
|
PDRIVER_OBJECT DriverObject,
|
||||||
|
|
|
@ -182,7 +182,9 @@ struct IUSBQueue;
|
||||||
\
|
\
|
||||||
STDMETHOD_(VOID, SetStatusChangeEndpointCallBack)( THIS_ \
|
STDMETHOD_(VOID, SetStatusChangeEndpointCallBack)( THIS_ \
|
||||||
IN PVOID CallBack, \
|
IN PVOID CallBack, \
|
||||||
IN PVOID Context) PURE;
|
IN PVOID Context) PURE; \
|
||||||
|
\
|
||||||
|
STDMETHOD_(LPCWSTR, GetUSBType)(THIS) PURE;
|
||||||
|
|
||||||
|
|
||||||
#define IMP_IUSBHARDWAREDEVICE \
|
#define IMP_IUSBHARDWAREDEVICE \
|
||||||
|
@ -228,7 +230,9 @@ struct IUSBQueue;
|
||||||
\
|
\
|
||||||
STDMETHODIMP_(VOID) SetStatusChangeEndpointCallBack( \
|
STDMETHODIMP_(VOID) SetStatusChangeEndpointCallBack( \
|
||||||
IN PVOID CallBack, \
|
IN PVOID CallBack, \
|
||||||
IN PVOID Context);
|
IN PVOID Context); \
|
||||||
|
\
|
||||||
|
STDMETHODIMP_(LPCWSTR) GetUSBType();
|
||||||
|
|
||||||
DECLARE_INTERFACE_(IUSBHardwareDevice, IUnknown)
|
DECLARE_INTERFACE_(IUSBHardwareDevice, IUnknown)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ protected:
|
||||||
PUSBHARDWAREDEVICE m_Hardware;
|
PUSBHARDWAREDEVICE m_Hardware;
|
||||||
PHUBCONTROLLER m_HubController;
|
PHUBCONTROLLER m_HubController;
|
||||||
ULONG m_FDODeviceNumber;
|
ULONG m_FDODeviceNumber;
|
||||||
|
LPCWSTR m_USBType;
|
||||||
};
|
};
|
||||||
|
|
||||||
//=================================================================================================
|
//=================================================================================================
|
||||||
|
@ -93,7 +94,7 @@ CHCDController::Initialize(
|
||||||
//
|
//
|
||||||
// failed to create hardware object
|
// failed to create hardware object
|
||||||
//
|
//
|
||||||
DPRINT1("[USBLIB] Failed to create hardware object\n");
|
DPRINT1("Failed to create hardware object\n");
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +138,7 @@ CHCDController::Initialize(
|
||||||
Status = m_Hardware->Initialize(m_DriverObject, m_FunctionalDeviceObject, m_PhysicalDeviceObject, m_NextDeviceObject);
|
Status = m_Hardware->Initialize(m_DriverObject, m_FunctionalDeviceObject, m_PhysicalDeviceObject, m_NextDeviceObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] Failed to initialize hardware object %x\n", Status);
|
DPRINT1("[%S] Failed to initialize hardware object %x\n", Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// failed to initialize hardware object, detach from device stack
|
// failed to initialize hardware object, detach from device stack
|
||||||
|
@ -158,6 +159,11 @@ CHCDController::Initialize(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// get usb controller type
|
||||||
|
//
|
||||||
|
m_USBType = m_Hardware->GetUSBType();
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// set device flags
|
// set device flags
|
||||||
|
@ -234,7 +240,7 @@ CHCDController::HandleDeviceControl(
|
||||||
//
|
//
|
||||||
PC_ASSERT(DeviceExtension->IsFDO);
|
PC_ASSERT(DeviceExtension->IsFDO);
|
||||||
|
|
||||||
DPRINT1("[USBLIB] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu\n",
|
DPRINT1("[%S] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu\n", m_USBType,
|
||||||
IoStack->Parameters.DeviceIoControl.IoControlCode,
|
IoStack->Parameters.DeviceIoControl.IoControlCode,
|
||||||
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
||||||
|
@ -279,7 +285,7 @@ CHCDController::HandleDeviceControl(
|
||||||
//
|
//
|
||||||
// informal debug print
|
// informal debug print
|
||||||
//
|
//
|
||||||
DPRINT1("[USBLIB] Result %S\n", DriverKey->DriverKeyName);
|
DPRINT1("[%S] Result %S\n", m_USBType, DriverKey->DriverKeyName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +337,7 @@ CHCDController::HandleDeviceControl(
|
||||||
PC_ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength - sizeof(ULONG) - sizeof(WCHAR) >= ResultLength);
|
PC_ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength - sizeof(ULONG) - sizeof(WCHAR) >= ResultLength);
|
||||||
|
|
||||||
DriverKey->DriverKeyName[ResultLength / sizeof(WCHAR)] = L'\0';
|
DriverKey->DriverKeyName[ResultLength / sizeof(WCHAR)] = L'\0';
|
||||||
DPRINT1("[USBLIB] Result %S\n", DriverKey->DriverKeyName);
|
DPRINT1("[%S] Result %S\n", m_USBType, DriverKey->DriverKeyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -394,7 +400,7 @@ CHCDController::HandlePnp(
|
||||||
{
|
{
|
||||||
case IRP_MN_START_DEVICE:
|
case IRP_MN_START_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_START FDO\n");
|
DPRINT("[%S] HandlePnp IRP_MN_START FDO\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// first start lower device object
|
// first start lower device object
|
||||||
|
@ -423,12 +429,12 @@ CHCDController::HandlePnp(
|
||||||
Status = SetSymbolicLink(TRUE);
|
Status = SetSymbolicLink(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_START FDO: Status %x\n", Status);
|
DPRINT("[%S] HandlePnp IRP_MN_START FDO: Status %x\n", m_USBType ,Status);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %lx\n", IoStack->Parameters.QueryDeviceRelations.Type);
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %lx\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
|
||||||
|
|
||||||
if (m_HubController == NULL)
|
if (m_HubController == NULL)
|
||||||
{
|
{
|
||||||
|
@ -508,7 +514,7 @@ CHCDController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_STOP_DEVICE:
|
case IRP_MN_STOP_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_STOP_DEVICE\n");
|
DPRINT("[%S] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
|
||||||
|
|
||||||
if (m_Hardware)
|
if (m_Hardware)
|
||||||
{
|
{
|
||||||
|
@ -549,7 +555,7 @@ CHCDController::HandlePnp(
|
||||||
IoSkipCurrentIrpStackLocation(Irp);
|
IoSkipCurrentIrpStackLocation(Irp);
|
||||||
return IoCallDriver(m_NextDeviceObject, Irp);
|
return IoCallDriver(m_NextDeviceObject, Irp);
|
||||||
#else
|
#else
|
||||||
DPRINT1("[USBLIB] Denying controller removal due to reinitialization bugs\n");
|
DPRINT1("[%S] Denying controller removal due to reinitialization bugs\n", m_USBType);
|
||||||
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
@ -557,7 +563,7 @@ CHCDController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_REMOVE_DEVICE:
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_REMOVE_DEVICE FDO\n");
|
DPRINT("[%S] HandlePnp IRP_MN_REMOVE_DEVICE FDO\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// delete the symbolic link
|
// delete the symbolic link
|
||||||
|
@ -670,7 +676,7 @@ CHCDController::CreateFDO(
|
||||||
//
|
//
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] CreateFDO: Failed to create %wZ, Status %x\n", &DeviceName, Status);
|
DPRINT1("[%S] CreateFDO: Failed to create %wZ, Status %x\n", m_USBType, &DeviceName, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -680,7 +686,7 @@ CHCDController::CreateFDO(
|
||||||
//
|
//
|
||||||
m_FDODeviceNumber = UsbDeviceNumber;
|
m_FDODeviceNumber = UsbDeviceNumber;
|
||||||
|
|
||||||
DPRINT("[USBLIB] CreateFDO: DeviceName %wZ\n", &DeviceName);
|
DPRINT("[%S] CreateFDO: DeviceName %wZ\n", m_USBType, &DeviceName);
|
||||||
|
|
||||||
/* done */
|
/* done */
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -105,6 +105,8 @@ protected:
|
||||||
PULONG m_DeviceAddressBitmapBuffer;
|
PULONG m_DeviceAddressBitmapBuffer;
|
||||||
LIST_ENTRY m_UsbDeviceList;
|
LIST_ENTRY m_UsbDeviceList;
|
||||||
PIRP m_PendingSCEIrp;
|
PIRP m_PendingSCEIrp;
|
||||||
|
LPCWSTR m_USBType;
|
||||||
|
|
||||||
|
|
||||||
//Internal Functions
|
//Internal Functions
|
||||||
BOOLEAN QueryStatusChageEndpoint(PIRP Irp);
|
BOOLEAN QueryStatusChageEndpoint(PIRP Irp);
|
||||||
|
@ -195,8 +197,6 @@ CHubController::Initialize(
|
||||||
USHORT VendorID, DeviceID;
|
USHORT VendorID, DeviceID;
|
||||||
ULONG Dummy1;
|
ULONG Dummy1;
|
||||||
|
|
||||||
DPRINT1("CHubController::Initialize\n");
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// initialize members
|
// initialize members
|
||||||
//
|
//
|
||||||
|
@ -205,6 +205,7 @@ CHubController::Initialize(
|
||||||
m_IsRootHubDevice = IsRootHubDevice;
|
m_IsRootHubDevice = IsRootHubDevice;
|
||||||
m_DeviceAddress = DeviceAddress;
|
m_DeviceAddress = DeviceAddress;
|
||||||
m_DriverObject = DriverObject;
|
m_DriverObject = DriverObject;
|
||||||
|
m_USBType = m_Hardware->GetUSBType();
|
||||||
KeInitializeSpinLock(&m_Lock);
|
KeInitializeSpinLock(&m_Lock);
|
||||||
InitializeListHead(&m_UsbDeviceList);
|
InitializeListHead(&m_UsbDeviceList);
|
||||||
|
|
||||||
|
@ -226,7 +227,6 @@ CHubController::Initialize(
|
||||||
RtlInitializeBitMap(&m_DeviceAddressBitmap, m_DeviceAddressBitmapBuffer, 128);
|
RtlInitializeBitMap(&m_DeviceAddressBitmap, m_DeviceAddressBitmapBuffer, 128);
|
||||||
RtlClearAllBits(&m_DeviceAddressBitmap);
|
RtlClearAllBits(&m_DeviceAddressBitmap);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// create PDO
|
// create PDO
|
||||||
//
|
//
|
||||||
|
@ -310,7 +310,7 @@ CHubController::QueryStatusChageEndpoint(
|
||||||
// Get the number of ports and check each one for device connected
|
// Get the number of ports and check each one for device connected
|
||||||
//
|
//
|
||||||
m_Hardware->GetDeviceDetails(NULL, NULL, &PortCount, NULL);
|
m_Hardware->GetDeviceDetails(NULL, NULL, &PortCount, NULL);
|
||||||
DPRINT1("[USBLIB] SCE Request %p TransferBufferLength %lu Flags %x MDL %p\n", Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength, Urb->UrbBulkOrInterruptTransfer.TransferFlags, Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
|
DPRINT1("[%S] SCE Request %p TransferBufferLength %lu Flags %x MDL %p\n", m_USBType, Urb->UrbBulkOrInterruptTransfer.TransferBuffer, Urb->UrbBulkOrInterruptTransfer.TransferBufferLength, Urb->UrbBulkOrInterruptTransfer.TransferFlags, Urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
|
||||||
|
|
||||||
TransferBuffer = (PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer;
|
TransferBuffer = (PUCHAR)Urb->UrbBulkOrInterruptTransfer.TransferBuffer;
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ CHubController::QueryStatusChageEndpoint(
|
||||||
{
|
{
|
||||||
m_Hardware->GetPortStatus(PortId, &PortStatus, &PortChange);
|
m_Hardware->GetPortStatus(PortId, &PortStatus, &PortChange);
|
||||||
|
|
||||||
DPRINT1("[USBLIB] Port %d: Status %x, Change %x\n", PortId, PortStatus, PortChange);
|
DPRINT1("[%S] Port %d: Status %x, Change %x\n", m_USBType, PortId, PortStatus, PortChange);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -329,7 +329,7 @@ CHubController::QueryStatusChageEndpoint(
|
||||||
//
|
//
|
||||||
if (PortChange != 0)
|
if (PortChange != 0)
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] Change state on port %d\n", PortId);
|
DPRINT1("[%S] Change state on port %d\n", m_USBType, PortId);
|
||||||
// Set the value for the port number
|
// Set the value for the port number
|
||||||
*TransferBuffer = 1 << ((PortId + 1) & 7);
|
*TransferBuffer = 1 << ((PortId + 1) & 7);
|
||||||
Changed = TRUE;
|
Changed = TRUE;
|
||||||
|
@ -432,7 +432,7 @@ CHubController::HandlePnp(
|
||||||
{
|
{
|
||||||
case IRP_MN_START_DEVICE:
|
case IRP_MN_START_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_START_DEVICE\n");
|
DPRINT("[%S] HandlePnp IRP_MN_START_DEVICE\n", m_USBType);
|
||||||
//
|
//
|
||||||
// register device interface
|
// register device interface
|
||||||
//
|
//
|
||||||
|
@ -450,7 +450,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_ID:
|
case IRP_MN_QUERY_ID:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_ID Type %x\n", IoStack->Parameters.QueryId.IdType);
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_ID Type %x\n", m_USBType, IoStack->Parameters.QueryId.IdType);
|
||||||
|
|
||||||
if (IoStack->Parameters.QueryId.IdType == BusQueryDeviceID)
|
if (IoStack->Parameters.QueryId.IdType == BusQueryDeviceID)
|
||||||
{
|
{
|
||||||
|
@ -525,7 +525,7 @@ CHubController::HandlePnp(
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandlePnp> failed to get hardware id %x\n", Status);
|
DPRINT1("[%S] HandlePnp> failed to get hardware id %x\n", m_USBType, Status);
|
||||||
VendorID = 0x8086;
|
VendorID = 0x8086;
|
||||||
DeviceID = 0x3A37;
|
DeviceID = 0x3A37;
|
||||||
}
|
}
|
||||||
|
@ -553,7 +553,7 @@ CHubController::HandlePnp(
|
||||||
Index++;
|
Index++;
|
||||||
|
|
||||||
|
|
||||||
DPRINT1("[USBLIB] Name %S\n", Buffer);
|
DPRINT1("[%S] Name %S\n", m_USBType, Buffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
// allocate buffer
|
// allocate buffer
|
||||||
|
@ -587,7 +587,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_CAPABILITIES:
|
case IRP_MN_QUERY_CAPABILITIES:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_CAPABILITIES\n");
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_CAPABILITIES\n", m_USBType);
|
||||||
|
|
||||||
DeviceCapabilities = (PDEVICE_CAPABILITIES)IoStack->Parameters.DeviceCapabilities.Capabilities;
|
DeviceCapabilities = (PDEVICE_CAPABILITIES)IoStack->Parameters.DeviceCapabilities.Capabilities;
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_INTERFACE:
|
case IRP_MN_QUERY_INTERFACE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_INTERFACE\n");
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_INTERFACE\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// handle device interface requests
|
// handle device interface requests
|
||||||
|
@ -629,7 +629,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_REMOVE_DEVICE:
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_REMOVE_DEVICE\n");
|
DPRINT("[%S] HandlePnp IRP_MN_REMOVE_DEVICE\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// deactivate device interface for BUS PDO
|
// deactivate device interface for BUS PDO
|
||||||
|
@ -659,7 +659,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %x\n", IoStack->Parameters.QueryDeviceRelations.Type);
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_DEVICE_RELATIONS Type %x\n", m_USBType, IoStack->Parameters.QueryDeviceRelations.Type);
|
||||||
|
|
||||||
if (IoStack->Parameters.QueryDeviceRelations.Type == TargetDeviceRelation)
|
if (IoStack->Parameters.QueryDeviceRelations.Type == TargetDeviceRelation)
|
||||||
{
|
{
|
||||||
|
@ -700,7 +700,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_QUERY_BUS_INFORMATION:
|
case IRP_MN_QUERY_BUS_INFORMATION:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_QUERY_BUS_INFORMATION\n");
|
DPRINT("[%S] HandlePnp IRP_MN_QUERY_BUS_INFORMATION\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// allocate buffer for bus information
|
// allocate buffer for bus information
|
||||||
|
@ -733,7 +733,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_STOP_DEVICE:
|
case IRP_MN_STOP_DEVICE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_STOP_DEVICE\n");
|
DPRINT("[%S] HandlePnp IRP_MN_STOP_DEVICE\n", m_USBType);
|
||||||
//
|
//
|
||||||
// stop device
|
// stop device
|
||||||
//
|
//
|
||||||
|
@ -742,7 +742,7 @@ CHubController::HandlePnp(
|
||||||
}
|
}
|
||||||
case IRP_MN_SURPRISE_REMOVAL:
|
case IRP_MN_SURPRISE_REMOVAL:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] HandlePnp IRP_MN_SURPRISE_REMOVAL\n");
|
DPRINT("[%S] HandlePnp IRP_MN_SURPRISE_REMOVAL\n", m_USBType);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -796,7 +796,7 @@ CHubController::HandleIsochronousTransfer(
|
||||||
|
|
||||||
if (!EndPointDesc)
|
if (!EndPointDesc)
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] Error No EndpointDesc\n");
|
DPRINT1("[%S] Error No EndpointDesc\n", m_USBType);
|
||||||
Urb->UrbIsochronousTransfer.Hdr.Status = USBD_STATUS_INVALID_PIPE_HANDLE;
|
Urb->UrbIsochronousTransfer.Hdr.Status = USBD_STATUS_INVALID_PIPE_HANDLE;
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -805,7 +805,7 @@ CHubController::HandleIsochronousTransfer(
|
||||||
// sanity checks
|
// sanity checks
|
||||||
//
|
//
|
||||||
ASSERT(EndPointDesc);
|
ASSERT(EndPointDesc);
|
||||||
DPRINT("HandleIsochronousTransfer EndPointDesc %p Address %x bmAttributes %x\n", EndPointDesc, EndPointDesc->bEndpointAddress, EndPointDesc->bmAttributes);
|
DPRINT("[%S] HandleIsochronousTransfer EndPointDesc %p Address %x bmAttributes %x\n", m_USBType, EndPointDesc, EndPointDesc->bEndpointAddress, EndPointDesc->bmAttributes);
|
||||||
ASSERT((EndPointDesc->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_ISOCHRONOUS);
|
ASSERT((EndPointDesc->bmAttributes & USB_ENDPOINT_TYPE_MASK) == USB_ENDPOINT_TYPE_ISOCHRONOUS);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -813,7 +813,7 @@ CHubController::HandleIsochronousTransfer(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleIsochronousTransfer invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleIsochronousTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -856,7 +856,7 @@ CHubController::HandleBulkOrInterruptTransfer(
|
||||||
//
|
//
|
||||||
// Else pend the IRP, to be completed when a device connects or disconnects.
|
// Else pend the IRP, to be completed when a device connects or disconnects.
|
||||||
//
|
//
|
||||||
DPRINT("[USBLIB] Pending SCE Irp\n");
|
DPRINT("[%S] Pending SCE Irp\n", m_USBType);
|
||||||
m_PendingSCEIrp = Irp;
|
m_PendingSCEIrp = Irp;
|
||||||
IoMarkIrpPending(Irp);
|
IoMarkIrpPending(Irp);
|
||||||
return STATUS_PENDING;
|
return STATUS_PENDING;
|
||||||
|
@ -878,7 +878,7 @@ CHubController::HandleBulkOrInterruptTransfer(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleBulkOrInterruptTransfer invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleBulkOrInterruptTransfer invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -905,7 +905,7 @@ CHubController::HandleClassOther(
|
||||||
ULONG NumPort;
|
ULONG NumPort;
|
||||||
ULONG PortId;
|
ULONG PortId;
|
||||||
|
|
||||||
DPRINT("[USBLIB] HandleClassOther> Request %x Value %x\n", Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value);
|
DPRINT("[%S] HandleClassOther> Request %x Value %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value);
|
||||||
|
|
||||||
//
|
//
|
||||||
// get number of ports available
|
// get number of ports available
|
||||||
|
@ -947,7 +947,7 @@ CHubController::HandleClassOther(
|
||||||
//
|
//
|
||||||
// request contains buffer of 2 ushort which are used from submitting port status and port change status
|
// request contains buffer of 2 ushort which are used from submitting port status and port change status
|
||||||
//
|
//
|
||||||
DPRINT("[USBLIB] PortId %x PortStatus %x PortChange %x\n", PortId, PortStatus, PortChange);
|
DPRINT("[%S] PortId %x PortStatus %x PortChange %x\n", m_USBType, PortId, PortStatus, PortChange);
|
||||||
Buffer = (PUSHORT)Urb->UrbControlVendorClassRequest.TransferBuffer;
|
Buffer = (PUSHORT)Urb->UrbControlVendorClassRequest.TransferBuffer;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -974,7 +974,7 @@ CHubController::HandleClassOther(
|
||||||
Status = m_Hardware->ClearPortStatus(PortId, C_PORT_RESET);
|
Status = m_Hardware->ClearPortStatus(PortId, C_PORT_RESET);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DPRINT("[USBLIB] Unknown Value for Clear Feature %x \n", Urb->UrbControlVendorClassRequest.Value);
|
DPRINT("[%S] Unknown Value for Clear Feature %x \n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1023,13 +1023,13 @@ CHubController::HandleClassOther(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("[USBLIB] Unsupported request id %x\n", Urb->UrbControlVendorClassRequest.Value);
|
DPRINT1("[%S] Unsupported request id %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Value);
|
||||||
PC_ASSERT(FALSE);
|
PC_ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("[USBLIB] HandleClassOther Unknown request code %x\n", Urb->UrbControlVendorClassRequest.Request);
|
DPRINT1("[%S] HandleClassOther Unknown request code %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request);
|
||||||
PC_ASSERT(0);
|
PC_ASSERT(0);
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
}
|
}
|
||||||
|
@ -1095,7 +1095,7 @@ CHubController::HandleSelectConfiguration(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleSelectConfiguration invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleSelectConfiguration invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1151,7 +1151,7 @@ CHubController::HandleSelectInterface(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleSelectInterface invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleSelectInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1208,7 +1208,7 @@ CHubController::HandleGetStatusFromDevice(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleGetStatusFromDevice invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleGetStatusFromDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1252,7 +1252,7 @@ CHubController::HandleGetStatusFromDevice(
|
||||||
//
|
//
|
||||||
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
|
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
|
||||||
ASSERT(Status == STATUS_SUCCESS);
|
ASSERT(Status == STATUS_SUCCESS);
|
||||||
DPRINT1("[USBLIB] HandleGetStatusFromDevice Status %x Length %lu DeviceStatus %x\n", Status, Urb->UrbControlDescriptorRequest.TransferBufferLength, *DeviceStatus);
|
DPRINT1("[%S] HandleGetStatusFromDevice Status %x Length %lu DeviceStatus %x\n", m_USBType, Status, Urb->UrbControlDescriptorRequest.TransferBufferLength, *DeviceStatus);
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
|
@ -1273,7 +1273,7 @@ CHubController::HandleClassDevice(
|
||||||
PUSBDEVICE UsbDevice;
|
PUSBDEVICE UsbDevice;
|
||||||
USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
|
USB_DEFAULT_PIPE_SETUP_PACKET CtrlSetup;
|
||||||
|
|
||||||
DPRINT("CHubController::HandleClassDevice Request %x Class %x\n", Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value >> 8);
|
DPRINT("[%S] HandleClassDevice Request %x Class %x\n", m_USBType, Urb->UrbControlVendorClassRequest.Request, Urb->UrbControlVendorClassRequest.Value >> 8);
|
||||||
|
|
||||||
//
|
//
|
||||||
// check class request type
|
// check class request type
|
||||||
|
@ -1287,7 +1287,7 @@ CHubController::HandleClassDevice(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("HandleClassDevice invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1371,7 +1371,7 @@ CHubController::HandleClassDevice(
|
||||||
{
|
{
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("HandleClassDevice invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
//
|
//
|
||||||
|
@ -1387,7 +1387,7 @@ CHubController::HandleClassDevice(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("[USBLIB] HandleClassDevice Class %x not implemented\n", Urb->UrbControlVendorClassRequest.Value >> 8);
|
DPRINT1("[%S] HandleClassDevice Class %x not implemented\n", m_USBType, Urb->UrbControlVendorClassRequest.Value >> 8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1399,7 +1399,7 @@ CHubController::HandleClassDevice(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("HandleClassDevice invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClassDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1465,7 +1465,7 @@ CHubController::HandleGetDescriptorFromInterface(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleGetDescriptorFromInterface invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleGetDescriptorFromInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1494,7 +1494,7 @@ CHubController::HandleGetDescriptorFromInterface(
|
||||||
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
|
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, Urb->UrbControlDescriptorRequest.TransferBufferLength, Urb->UrbControlDescriptorRequest.TransferBuffer);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleGetDescriptorFromInterface failed with %x\n", Status);
|
DPRINT1("[%S] HandleGetDescriptorFromInterface failed with %x\n", m_USBType, Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1515,7 +1515,7 @@ CHubController::HandleGetDescriptor(
|
||||||
PUSBDEVICE UsbDevice;
|
PUSBDEVICE UsbDevice;
|
||||||
ULONG Length, BufferLength;
|
ULONG Length, BufferLength;
|
||||||
|
|
||||||
DPRINT("[USBLIB] HandleGetDescriptor Type %x\n", Urb->UrbControlDescriptorRequest.DescriptorType);
|
DPRINT("[%S] HandleGetDescriptor Type %x\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// check descriptor type
|
// check descriptor type
|
||||||
|
@ -1547,7 +1547,7 @@ CHubController::HandleGetDescriptor(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleGetDescriptor invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleGetDescriptor invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1654,7 +1654,7 @@ CHubController::HandleGetDescriptor(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] USB_CONFIGURATION_DESCRIPTOR_TYPE invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] USB_CONFIGURATION_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1719,7 +1719,7 @@ CHubController::HandleGetDescriptor(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] USB_STRING_DESCRIPTOR_TYPE invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] USB_STRING_DESCRIPTOR_TYPE invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1749,7 +1749,7 @@ CHubController::HandleGetDescriptor(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DPRINT1("[USBLIB] CHubController::HandleGetDescriptor DescriptorType %x unimplemented\n", Urb->UrbControlDescriptorRequest.DescriptorType);
|
DPRINT1("[%S] CHubController::HandleGetDescriptor DescriptorType %x unimplemented\n", m_USBType, Urb->UrbControlDescriptorRequest.DescriptorType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1781,7 +1781,7 @@ CHubController::HandleClassEndpoint(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleClassEndpoint invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClassEndpoint invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1862,7 +1862,7 @@ CHubController::HandleVendorDevice(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleVendorDevice invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleVendorDevice invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1930,7 +1930,7 @@ CHubController::HandleSyncResetAndClearStall(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleSyncResetAndClearStall invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleSyncResetAndClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -1947,7 +1947,7 @@ CHubController::HandleSyncResetAndClearStall(
|
||||||
//
|
//
|
||||||
// failed
|
// failed
|
||||||
//
|
//
|
||||||
DPRINT1("[USBLIB] failed to reset pipe %x\n", Status);
|
DPRINT1("[%S] failed to reset pipe %x\n", m_USBType, Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1967,7 +1967,7 @@ CHubController::HandleSyncResetAndClearStall(
|
||||||
//
|
//
|
||||||
Status = HandleClearStall(Irp, Urb);
|
Status = HandleClearStall(Irp, Urb);
|
||||||
}
|
}
|
||||||
DPRINT1("[USBLIB] URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL Status %x\n", Status);
|
DPRINT1("[%S] URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL Status %x\n", m_USBType, Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// reset data toggle
|
// reset data toggle
|
||||||
|
@ -2003,7 +2003,7 @@ CHubController::HandleAbortPipe(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleAbortPipe invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleAbortPipe invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -2026,7 +2026,7 @@ CHubController::HandleAbortPipe(
|
||||||
// issue request
|
// issue request
|
||||||
//
|
//
|
||||||
Status = UsbDevice->AbortPipe(EndpointDescriptor);
|
Status = UsbDevice->AbortPipe(EndpointDescriptor);
|
||||||
DPRINT1("[USBLIB] URB_FUNCTION_ABORT_PIPE Status %x\n", Status);
|
DPRINT1("[%S] URB_FUNCTION_ABORT_PIPE Status %x\n", m_USBType, Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
|
@ -2059,7 +2059,7 @@ CHubController::HandleClearStall(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleClearStall invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClearStall invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -2076,7 +2076,7 @@ CHubController::HandleClearStall(
|
||||||
// get device
|
// get device
|
||||||
//
|
//
|
||||||
UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle);
|
UsbDevice = PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
DPRINT1("[USBLIB] URB_FUNCTION_SYNC_CLEAR_STALL\n");
|
DPRINT1("[%S] URB_FUNCTION_SYNC_CLEAR_STALL\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// initialize setup packet
|
// initialize setup packet
|
||||||
|
@ -2093,7 +2093,7 @@ CHubController::HandleClearStall(
|
||||||
//
|
//
|
||||||
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, 0, 0);
|
Status = UsbDevice->SubmitSetupPacket(&CtrlSetup, 0, 0);
|
||||||
|
|
||||||
DPRINT1("[USBLIB] URB_FUNCTION_CLEAR_STALL Status %x\n", Status);
|
DPRINT1("[%S] URB_FUNCTION_CLEAR_STALL Status %x\n", m_USBType, Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
|
@ -2124,7 +2124,7 @@ CHubController::HandleClassInterface(
|
||||||
//
|
//
|
||||||
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
if (!ValidateUsbDevice(PUSBDEVICE(Urb->UrbHeader.UsbdDeviceHandle)))
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleClassInterface invalid device handle %p\n", Urb->UrbHeader.UsbdDeviceHandle);
|
DPRINT1("[%S] HandleClassInterface invalid device handle %p\n", m_USBType, Urb->UrbHeader.UsbdDeviceHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
|
@ -2178,7 +2178,7 @@ CHubController::HandleClassInterface(
|
||||||
//
|
//
|
||||||
// display error
|
// display error
|
||||||
//
|
//
|
||||||
DPRINT1("URB_FUNCTION_CLASS_INTERFACE failed with Urb Status %x\n", Urb->UrbHeader.Status);
|
DPRINT1("[%S] URB_FUNCTION_CLASS_INTERFACE failed with Urb Status %x\n", m_USBType, Urb->UrbHeader.Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2272,7 +2272,7 @@ CHubController::HandleDeviceControl(
|
||||||
Status = HandleVendorDevice(Irp, Urb);
|
Status = HandleVendorDevice(Irp, Urb);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DPRINT1("[USBLIB] IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", Urb->UrbHeader.Function);
|
DPRINT1("[%S] IOCTL_INTERNAL_USB_SUBMIT_URB Function %x NOT IMPLEMENTED\n", m_USBType, Urb->UrbHeader.Function);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -2282,7 +2282,7 @@ CHubController::HandleDeviceControl(
|
||||||
}
|
}
|
||||||
case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE:
|
case IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE %p\n", this);
|
DPRINT("[%S] IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE %p\n", m_USBType, this);
|
||||||
|
|
||||||
if (IoStack->Parameters.Others.Argument1)
|
if (IoStack->Parameters.Others.Argument1)
|
||||||
{
|
{
|
||||||
|
@ -2307,7 +2307,7 @@ CHubController::HandleDeviceControl(
|
||||||
}
|
}
|
||||||
case IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO:
|
case IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO\n");
|
DPRINT("[%S] IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// this is the first request send, it delivers the PDO to the caller
|
// this is the first request send, it delivers the PDO to the caller
|
||||||
|
@ -2336,7 +2336,7 @@ CHubController::HandleDeviceControl(
|
||||||
}
|
}
|
||||||
case IOCTL_INTERNAL_USB_GET_HUB_COUNT:
|
case IOCTL_INTERNAL_USB_GET_HUB_COUNT:
|
||||||
{
|
{
|
||||||
DPRINT("[USBLIB] IOCTL_INTERNAL_USB_GET_HUB_COUNT\n");
|
DPRINT("[%S] IOCTL_INTERNAL_USB_GET_HUB_COUNT\n", m_USBType);
|
||||||
|
|
||||||
//
|
//
|
||||||
// after IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO is delivered, the usbhub driver
|
// after IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO is delivered, the usbhub driver
|
||||||
|
@ -2359,13 +2359,13 @@ CHubController::HandleDeviceControl(
|
||||||
}
|
}
|
||||||
case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION:
|
case IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION:
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION UNIMPLEMENTED\n");
|
DPRINT1("[%S] IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION UNIMPLEMENTED\n", m_USBType);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu NOT IMPLEMENTED\n",
|
DPRINT1("[%S] HandleDeviceControl>Type: IoCtl %x InputBufferLength %lu OutputBufferLength %lu NOT IMPLEMENTED\n", m_USBType,
|
||||||
IoStack->Parameters.DeviceIoControl.IoControlCode,
|
IoStack->Parameters.DeviceIoControl.IoControlCode,
|
||||||
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
IoStack->Parameters.DeviceIoControl.InputBufferLength,
|
||||||
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
||||||
|
@ -2797,7 +2797,7 @@ USBHI_InitializeUsbDevice(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG Index = 0;
|
ULONG Index = 0;
|
||||||
|
|
||||||
DPRINT1("USBHI_InitializeUsbDevice\n");
|
DPRINT("USBHI_InitializeUsbDevice\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// first get controller
|
// first get controller
|
||||||
|
@ -2893,7 +2893,7 @@ USBHI_GetUsbDescriptors(
|
||||||
PUSBDEVICE UsbDevice;
|
PUSBDEVICE UsbDevice;
|
||||||
CHubController * Controller;
|
CHubController * Controller;
|
||||||
|
|
||||||
DPRINT1("USBHI_GetUsbDescriptors\n");
|
DPRINT("USBHI_GetUsbDescriptors\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// sanity check
|
// sanity check
|
||||||
|
@ -2962,7 +2962,7 @@ USBHI_RemoveUsbDevice(
|
||||||
CHubController * Controller;
|
CHubController * Controller;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT1("USBHI_RemoveUsbDevice\n");
|
DPRINT("USBHI_RemoveUsbDevice\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// first get controller
|
// first get controller
|
||||||
|
@ -3010,7 +3010,6 @@ USBHI_RemoveUsbDevice(
|
||||||
// invalid device handle
|
// invalid device handle
|
||||||
//
|
//
|
||||||
DPRINT1("USBHI_RemoveUsbDevice Invalid device handle %p\n", UsbDevice);
|
DPRINT1("USBHI_RemoveUsbDevice Invalid device handle %p\n", UsbDevice);
|
||||||
PC_ASSERT(0);
|
|
||||||
return STATUS_DEVICE_NOT_CONNECTED;
|
return STATUS_DEVICE_NOT_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3035,7 +3034,7 @@ USBHI_RestoreUsbDevice(
|
||||||
PUSBDEVICE OldUsbDevice, NewUsbDevice;
|
PUSBDEVICE OldUsbDevice, NewUsbDevice;
|
||||||
CHubController * Controller;
|
CHubController * Controller;
|
||||||
|
|
||||||
DPRINT1("USBHI_RestoreUsbDevice\n");
|
DPRINT("USBHI_RestoreUsbDevice\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// first get controller
|
// first get controller
|
||||||
|
@ -3081,7 +3080,7 @@ USBHI_QueryDeviceInformation(
|
||||||
PUSBDEVICE UsbDevice;
|
PUSBDEVICE UsbDevice;
|
||||||
CHubController * Controller;
|
CHubController * Controller;
|
||||||
|
|
||||||
DPRINT1("USBHI_QueryDeviceInformation %p\n", BusContext);
|
DPRINT("USBHI_QueryDeviceInformation %p\n", BusContext);
|
||||||
|
|
||||||
//
|
//
|
||||||
// sanity check
|
// sanity check
|
||||||
|
@ -3203,7 +3202,7 @@ USBHI_GetControllerInformation(
|
||||||
{
|
{
|
||||||
PUSB_CONTROLLER_INFORMATION_0 ControllerInfo;
|
PUSB_CONTROLLER_INFORMATION_0 ControllerInfo;
|
||||||
|
|
||||||
DPRINT1("USBHI_GetControllerInformation\n");
|
DPRINT("USBHI_GetControllerInformation\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// sanity checks
|
// sanity checks
|
||||||
|
@ -3266,7 +3265,7 @@ USBHI_GetExtendedHubInformation(
|
||||||
USHORT Dummy1;
|
USHORT Dummy1;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT1("USBHI_GetExtendedHubInformation\n");
|
DPRINT("USBHI_GetExtendedHubInformation\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// sanity checks
|
// sanity checks
|
||||||
|
@ -3493,7 +3492,7 @@ USBDI_GetUSBDIVersion(
|
||||||
ULONG Speed, Dummy2;
|
ULONG Speed, Dummy2;
|
||||||
USHORT Dummy1;
|
USHORT Dummy1;
|
||||||
|
|
||||||
DPRINT1("USBDI_GetUSBDIVersion\n");
|
DPRINT("USBDI_GetUSBDIVersion\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// get controller
|
// get controller
|
||||||
|
@ -3573,7 +3572,7 @@ USBDI_IsDeviceHighSpeed(
|
||||||
ULONG Speed, Dummy2;
|
ULONG Speed, Dummy2;
|
||||||
USHORT Dummy1;
|
USHORT Dummy1;
|
||||||
|
|
||||||
DPRINT1("USBDI_IsDeviceHighSpeed\n");
|
DPRINT("USBDI_IsDeviceHighSpeed\n");
|
||||||
|
|
||||||
//
|
//
|
||||||
// get controller
|
// get controller
|
||||||
|
|
|
@ -28,7 +28,7 @@ USBLIB_AddDevice(
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PHCDCONTROLLER HcdController;
|
PHCDCONTROLLER HcdController;
|
||||||
|
|
||||||
DPRINT1("EHCI_AddDevice\n");
|
DPRINT1("USBLIB_AddDevice\n");
|
||||||
|
|
||||||
/* first create the controller object */
|
/* first create the controller object */
|
||||||
Status = CreateHCDController(&HcdController);
|
Status = CreateHCDController(&HcdController);
|
||||||
|
@ -114,7 +114,7 @@ USBLIB_Dispatch(
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
DPRINT1("EHCI_Dispatch> Major %lu Minor %lu unhandeled\n", IoStack->MajorFunction, IoStack->MinorFunction);
|
DPRINT1("USBLIB_Dispatch> Major %lu Minor %lu unhandeled\n", IoStack->MajorFunction, IoStack->MinorFunction);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@ protected:
|
||||||
ULONG m_PortStatus;
|
ULONG m_PortStatus;
|
||||||
PUSBQUEUE m_Queue;
|
PUSBQUEUE m_Queue;
|
||||||
PDMAMEMORYMANAGER m_DmaManager;
|
PDMAMEMORYMANAGER m_DmaManager;
|
||||||
|
LPCWSTR m_USBType;
|
||||||
|
|
||||||
PUSB_CONFIGURATION m_ConfigurationDescriptors;
|
PUSB_CONFIGURATION m_ConfigurationDescriptors;
|
||||||
};
|
};
|
||||||
|
@ -119,6 +120,7 @@ CUSBDevice::Initialize(
|
||||||
m_Parent = Parent;
|
m_Parent = Parent;
|
||||||
m_Port = Port;
|
m_Port = Port;
|
||||||
m_PortStatus = PortStatus;
|
m_PortStatus = PortStatus;
|
||||||
|
m_USBType = m_Device->GetUSBType();
|
||||||
|
|
||||||
//
|
//
|
||||||
// initialize device lock
|
// initialize device lock
|
||||||
|
@ -139,7 +141,7 @@ CUSBDevice::Initialize(
|
||||||
//
|
//
|
||||||
// failed to get usb queue
|
// failed to get usb queue
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::Initialize GetUsbQueue failed with %x\n", Status);
|
DPRINT1("[%S] GetUsbQueue failed with %x\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +154,7 @@ CUSBDevice::Initialize(
|
||||||
//
|
//
|
||||||
// failed to get dma manager
|
// failed to get dma manager
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::Initialize GetDMA failed with %x\n", Status);
|
DPRINT1("[%S] GetDMA failed with %x\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +172,7 @@ CUSBDevice::Initialize(
|
||||||
//
|
//
|
||||||
// failed to get device descriptor
|
// failed to get device descriptor
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::Initialize Failed to get device descriptor with %x\n", Status);
|
DPRINT1("[%S] Failed to get device descriptor with %x\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,7 +276,7 @@ CUSBDevice::GetType()
|
||||||
return Usb20Device;
|
return Usb20Device;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("CUSBDevice::GetType Unknown bcdUSB Type %x\n", m_DeviceDescriptor.bcdUSB);
|
DPRINT1("[%S] GetType Unknown bcdUSB Type %x\n", m_USBType, m_DeviceDescriptor.bcdUSB);
|
||||||
//PC_ASSERT(FALSE);
|
//PC_ASSERT(FALSE);
|
||||||
|
|
||||||
return Usb11Device;
|
return Usb11Device;
|
||||||
|
@ -309,7 +311,7 @@ CUSBDevice::SetDeviceAddress(
|
||||||
UCHAR OldAddress;
|
UCHAR OldAddress;
|
||||||
UCHAR Index;
|
UCHAR Index;
|
||||||
|
|
||||||
DPRINT1("CUSBDevice::SetDeviceAddress> Address %x\n", DeviceAddress);
|
DPRINT1("[%S] SetDeviceAddress> Address %x\n", m_USBType, DeviceAddress);
|
||||||
|
|
||||||
CtrlSetup = (PUSB_DEFAULT_PIPE_SETUP_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), TAG_USBLIB);
|
CtrlSetup = (PUSB_DEFAULT_PIPE_SETUP_PACKET)ExAllocatePoolWithTag(NonPagedPool, sizeof(USB_DEFAULT_PIPE_SETUP_PACKET), TAG_USBLIB);
|
||||||
if (!CtrlSetup)
|
if (!CtrlSetup)
|
||||||
|
@ -332,7 +334,7 @@ CUSBDevice::SetDeviceAddress(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
// failed to set device address
|
// failed to set device address
|
||||||
DPRINT1("CUSBDevice::SetDeviceAddress> failed to set device address with %lx Address %x\n", Status, DeviceAddress);
|
DPRINT1("[%S] SetDeviceAddress> failed to set device address with %lx Address %x\n", m_USBType, Status, DeviceAddress);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +351,7 @@ CUSBDevice::SetDeviceAddress(
|
||||||
Status = CreateDeviceDescriptor();
|
Status = CreateDeviceDescriptor();
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CUSBDevice::SetDeviceAddress> failed to retrieve device descriptor with device address set Error %lx\n", Status);
|
DPRINT1("[%S] SetDeviceAddress failed to retrieve device descriptor with device address set Error %lx\n", m_USBType, Status);
|
||||||
// return error status
|
// return error status
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -360,7 +362,7 @@ CUSBDevice::SetDeviceAddress(
|
||||||
m_DeviceDescriptor.bNumConfigurations == 0)
|
m_DeviceDescriptor.bNumConfigurations == 0)
|
||||||
{
|
{
|
||||||
// failed to retrieve device descriptor
|
// failed to retrieve device descriptor
|
||||||
DPRINT1("CUSBDevice::SetDeviceAddress> device returned bogus device descriptor\n");
|
DPRINT1("[%S] SetDeviceAddress> device returned bogus device descriptor\n", m_USBType);
|
||||||
DumpDeviceDescriptor(&m_DeviceDescriptor);
|
DumpDeviceDescriptor(&m_DeviceDescriptor);
|
||||||
|
|
||||||
// return error status
|
// return error status
|
||||||
|
@ -386,7 +388,7 @@ CUSBDevice::SetDeviceAddress(
|
||||||
Status = CreateConfigurationDescriptor(Index);
|
Status = CreateConfigurationDescriptor(Index);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("CUSBDevice::SetDeviceAddress> failed to retrieve configuration %lu\n", Index);
|
DPRINT1("[%S] SetDeviceAddress> failed to retrieve configuration %lu\n", m_USBType, Index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -429,7 +431,7 @@ CUSBDevice::CommitIrp(
|
||||||
//
|
//
|
||||||
// no queue, wtf?
|
// no queue, wtf?
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitIrp> no queue / dma !!!\n");
|
DPRINT1("[%S] CommitIrp> no queue / dma !!!\n", m_USBType);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +444,7 @@ CUSBDevice::CommitIrp(
|
||||||
//
|
//
|
||||||
// failed to build request
|
// failed to build request
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitIrp> CreateUSBRequest failed with %lx\n", Status);
|
DPRINT1("[%S] CommitIrp> CreateUSBRequest failed with %lx\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,7 +467,7 @@ CUSBDevice::CommitIrp(
|
||||||
//
|
//
|
||||||
// failed to add request
|
// failed to add request
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitIrp> failed add request to queue with %lx\n", Status);
|
DPRINT1("[%S] failed add request to queue with %lx\n", m_USBType, Status);
|
||||||
Request->Release();
|
Request->Release();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -518,7 +520,7 @@ CUSBDevice::CommitSetupPacket(
|
||||||
//
|
//
|
||||||
// no queue, wtf?
|
// no queue, wtf?
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitSetupPacket> no queue!!!\n");
|
DPRINT1("[%S] CommitSetupPacket> no queue!!!\n", m_USBType);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,7 +533,7 @@ CUSBDevice::CommitSetupPacket(
|
||||||
//
|
//
|
||||||
// failed to build request
|
// failed to build request
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitSetupPacket> CreateUSBRequest failed with %x\n", Status);
|
DPRINT1("[%S] CommitSetupPacket> CreateUSBRequest failed with %x\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +546,7 @@ CUSBDevice::CommitSetupPacket(
|
||||||
//
|
//
|
||||||
// failed to initialize request
|
// failed to initialize request
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitSetupPacket> failed to initialize usb request with %x\n", Status);
|
DPRINT1("[%S] CommitSetupPacket failed to initialize usb request with %x\n", m_USBType, Status);
|
||||||
Request->Release();
|
Request->Release();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -558,7 +560,7 @@ CUSBDevice::CommitSetupPacket(
|
||||||
//
|
//
|
||||||
// failed to add request
|
// failed to add request
|
||||||
//
|
//
|
||||||
DPRINT1("CUSBDevice::CommitSetupPacket> failed add request to queue with %x\n", Status);
|
DPRINT1("[%S] CommitSetupPacket> failed add request to queue with %x\n", m_USBType, Status);
|
||||||
Request->Release();
|
Request->Release();
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -759,7 +761,7 @@ CUSBDevice::CreateConfigurationDescriptor(
|
||||||
//
|
//
|
||||||
// failed to get partial configuration descriptor
|
// failed to get partial configuration descriptor
|
||||||
//
|
//
|
||||||
DPRINT1("[USBLIB] Failed to get partial configuration descriptor Status %x Index %x\n", Status, Index);
|
DPRINT1("[%S] Failed to get partial configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
|
||||||
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
|
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -773,7 +775,7 @@ CUSBDevice::CreateConfigurationDescriptor(
|
||||||
//
|
//
|
||||||
// failed to get full configuration descriptor
|
// failed to get full configuration descriptor
|
||||||
//
|
//
|
||||||
DPRINT1("[USBLIB] Failed to get full configuration descriptor Status %x Index %x\n", Status, Index);
|
DPRINT1("[%S] Failed to get full configuration descriptor Status %x Index %x\n", m_USBType, Status, Index);
|
||||||
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
|
ExFreePoolWithTag(ConfigurationDescriptor, TAG_USBLIB);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -968,7 +970,7 @@ CUSBDevice::BuildInterfaceDescriptor(
|
||||||
if (EndpointDescriptor->bLength == 0 || EndpointDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE)
|
if (EndpointDescriptor->bLength == 0 || EndpointDescriptor->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE)
|
||||||
{
|
{
|
||||||
// bogus configuration descriptor
|
// bogus configuration descriptor
|
||||||
DPRINT1("[USBLIB] Bogus descriptor found in InterfaceNumber %x Alternate %x EndpointIndex %x bLength %x bDescriptorType %x\n", InterfaceDescriptor->bInterfaceNumber, InterfaceDescriptor->bAlternateSetting, PipeIndex,
|
DPRINT1("[%S] Bogus descriptor found in InterfaceNumber %x Alternate %x EndpointIndex %x bLength %x bDescriptorType %x\n", m_USBType, InterfaceDescriptor->bInterfaceNumber, InterfaceDescriptor->bAlternateSetting, PipeIndex,
|
||||||
EndpointDescriptor->bLength, EndpointDescriptor->bDescriptorType);
|
EndpointDescriptor->bLength, EndpointDescriptor->bDescriptorType);
|
||||||
|
|
||||||
// failed
|
// failed
|
||||||
|
@ -1040,7 +1042,7 @@ CUSBDevice::SelectConfiguration(
|
||||||
|
|
||||||
if (!Found)
|
if (!Found)
|
||||||
{
|
{
|
||||||
DPRINT1("[USBLIB] invalid configuration value %u\n", ConfigurationDescriptor->bConfigurationValue);
|
DPRINT1("[%S] invalid configuration value %u\n", m_USBType, ConfigurationDescriptor->bConfigurationValue);
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1062,13 +1064,13 @@ CUSBDevice::SelectConfiguration(
|
||||||
if (!ConfigurationDescriptor)
|
if (!ConfigurationDescriptor)
|
||||||
{
|
{
|
||||||
// unconfigure request
|
// unconfigure request
|
||||||
DPRINT1("CUSBDevice::SelectConfiguration Unconfigure Request Status %lx\n", Status);
|
DPRINT1("[%S] SelectConfiguration Unconfigure Request Status %lx\n", m_USBType, Status);
|
||||||
m_ConfigurationIndex = 0;
|
m_ConfigurationIndex = 0;
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
// informal debug print
|
// informal debug print
|
||||||
DPRINT1("CUSBDevice::SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", ConfigurationIndex, m_ConfigurationIndex, Status);
|
DPRINT1("[%S] SelectConfiguration New Configuration %x Old Configuration %x Result %lx\n", m_USBType, ConfigurationIndex, m_ConfigurationIndex, Status);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -1123,7 +1125,7 @@ CUSBDevice::SelectConfiguration(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
// failed
|
// failed
|
||||||
DPRINT1("[LIBUSB] Failed to copy interface descriptor Index %lu InterfaceDescriptor %p InterfaceInfo %p\n", ConfigurationIndex, InterfaceDescriptor, InterfaceInfo);
|
DPRINT1("[%S] Failed to copy interface descriptor Index %lu InterfaceDescriptor %p InterfaceInfo %p\n", m_USBType, ConfigurationIndex, InterfaceDescriptor, InterfaceInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,7 +1167,7 @@ CUSBDevice::SelectInterface(
|
||||||
if (!Found)
|
if (!Found)
|
||||||
{
|
{
|
||||||
// invalid handle passed
|
// invalid handle passed
|
||||||
DPRINT1("[USBLIB] Invalid configuration handle passed %p\n", ConfigurationHandle);
|
DPRINT1("[%S] Invalid configuration handle passed %p\n", m_USBType, ConfigurationHandle);
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1180,7 +1182,7 @@ CUSBDevice::SelectInterface(
|
||||||
Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL);
|
Status = CommitSetupPacket(&CtrlSetup, NULL, 0, NULL);
|
||||||
|
|
||||||
// informal debug print
|
// informal debug print
|
||||||
DPRINT1("CUSBDevice::SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
|
DPRINT1("[%S] SelectInterface AlternateSetting %x InterfaceNumber %x Status %lx\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber, Status);
|
||||||
#if 0
|
#if 0
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -1216,7 +1218,7 @@ CUSBDevice::SelectInterface(
|
||||||
InterfaceDescriptor = USBD_ParseConfigurationDescriptor(m_ConfigurationDescriptors[ConfigurationIndex].ConfigurationDescriptor, InterfaceInfo->InterfaceNumber, InterfaceInfo->AlternateSetting);
|
InterfaceDescriptor = USBD_ParseConfigurationDescriptor(m_ConfigurationDescriptors[ConfigurationIndex].ConfigurationDescriptor, InterfaceInfo->InterfaceNumber, InterfaceInfo->AlternateSetting);
|
||||||
if (!InterfaceDescriptor)
|
if (!InterfaceDescriptor)
|
||||||
{
|
{
|
||||||
DPRINT1("[LIBUSB] No such interface Alternate %x InterfaceNumber %x\n", InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber);
|
DPRINT1("[%S] No such interface Alternate %x InterfaceNumber %x\n", m_USBType, InterfaceInfo->AlternateSetting, InterfaceInfo->InterfaceNumber);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1225,7 +1227,7 @@ CUSBDevice::SelectInterface(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
// failed
|
// failed
|
||||||
DPRINT1("[LIBUSB] Failed to build interface descriptor Status %x\n", Status);
|
DPRINT1("[%S] Failed to build interface descriptor Status %x\n", m_USBType, Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue