- The usual... fix some whitespace

svn path=/trunk/; revision=59006
This commit is contained in:
Thomas Faber 2013-05-12 16:59:26 +00:00
parent 9c5af92297
commit 1e777a48a7
2 changed files with 107 additions and 52 deletions

View file

@ -21,7 +21,7 @@ HidUsb_GetInputInterruptInterfaceHandle(
// //
ASSERT(InterfaceInformation->NumberOfPipes); ASSERT(InterfaceInformation->NumberOfPipes);
for(Index = 0; Index < InterfaceInformation->NumberOfPipes; Index++) for (Index = 0; Index < InterfaceInformation->NumberOfPipes; Index++)
{ {
//DPRINT1("[HIDUSB] EndpointAddress %x PipeType %x PipeHandle %x\n", InterfaceInformation->Pipes[Index].EndpointAddress, InterfaceInformation->Pipes[Index].PipeType, InterfaceInformation->Pipes[Index].PipeHandle); //DPRINT1("[HIDUSB] EndpointAddress %x PipeType %x PipeHandle %x\n", InterfaceInformation->Pipes[Index].EndpointAddress, InterfaceInformation->Pipes[Index].PipeType, InterfaceInformation->Pipes[Index].PipeHandle);
if (InterfaceInformation->Pipes[Index].PipeType == UsbdPipeTypeInterrupt && (InterfaceInformation->Pipes[Index].EndpointAddress & USB_ENDPOINT_DIRECTION_MASK)) if (InterfaceInformation->Pipes[Index].PipeType == UsbdPipeTypeInterrupt && (InterfaceInformation->Pipes[Index].EndpointAddress & USB_ENDPOINT_DIRECTION_MASK))
@ -69,7 +69,15 @@ HidUsb_GetPortStatus(
// //
// build irp // build irp
// //
Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_GET_PORT_STATUS, DeviceExtension->NextDeviceObject, NULL, 0, NULL, 0, TRUE, &Event, &IoStatus); Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_GET_PORT_STATUS,
DeviceExtension->NextDeviceObject,
NULL,
0,
NULL,
0,
TRUE,
&Event,
&IoStatus);
if (!Irp) if (!Irp)
{ {
// //
@ -249,7 +257,15 @@ HidUsb_ResetPort(
// //
// build irp // build irp
// //
Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_RESET_PORT, DeviceExtension->NextDeviceObject, NULL, 0, NULL, 0, TRUE, &Event, &IoStatusBlock); Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_RESET_PORT,
DeviceExtension->NextDeviceObject,
NULL,
0,
NULL,
0,
TRUE,
&Event,
&IoStatusBlock);
if (!Irp) if (!Irp)
{ {
// //
@ -646,7 +662,14 @@ HidUsb_GetReportDescriptor(
// FIXME: support old hid version // FIXME: support old hid version
// //
BufferLength = HidDeviceExtension->HidDescriptor->DescriptorList[0].wReportLength; BufferLength = HidDeviceExtension->HidDescriptor->DescriptorList[0].wReportLength;
Status = Hid_GetDescriptor(DeviceObject, URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), &Report, &BufferLength, HidDeviceExtension->HidDescriptor->DescriptorList[0].bReportType, 0, HidDeviceExtension->InterfaceInfo->InterfaceNumber); Status = Hid_GetDescriptor(DeviceObject,
URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
&Report,
&BufferLength,
HidDeviceExtension->HidDescriptor->DescriptorList[0].bReportType,
0,
HidDeviceExtension->InterfaceInfo->InterfaceNumber);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
// //
@ -654,7 +677,14 @@ HidUsb_GetReportDescriptor(
// try with old hid version // try with old hid version
// //
BufferLength = HidDeviceExtension->HidDescriptor->DescriptorList[0].wReportLength; BufferLength = HidDeviceExtension->HidDescriptor->DescriptorList[0].wReportLength;
Status = Hid_GetDescriptor(DeviceObject, URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), &Report, &BufferLength, HidDeviceExtension->HidDescriptor->DescriptorList[0].bReportType, 0, 0 /* FIXME*/); Status = Hid_GetDescriptor(DeviceObject,
URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
&Report,
&BufferLength,
HidDeviceExtension->HidDescriptor->DescriptorList[0].bReportType,
0,
0 /* FIXME*/);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("[HIDUSB] failed to get report descriptor with %x\n", Status); DPRINT("[HIDUSB] failed to get report descriptor with %x\n", Status);
@ -715,7 +745,7 @@ HidInternalDeviceControl(
// //
IoStack = IoGetCurrentIrpStackLocation(Irp); IoStack = IoGetCurrentIrpStackLocation(Irp);
switch(IoStack->Parameters.DeviceIoControl.IoControlCode) switch (IoStack->Parameters.DeviceIoControl.IoControlCode)
{ {
case IOCTL_HID_GET_DEVICE_ATTRIBUTES: case IOCTL_HID_GET_DEVICE_ATTRIBUTES:
{ {
@ -926,7 +956,6 @@ Hid_PnpCompletion(
return STATUS_MORE_PROCESSING_REQUIRED; return STATUS_MORE_PROCESSING_REQUIRED;
} }
NTSTATUS NTSTATUS
Hid_DispatchUrb( Hid_DispatchUrb(
IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_OBJECT DeviceObject,
@ -951,11 +980,18 @@ Hid_DispatchUrb(
DeviceExtension = (PHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension; DeviceExtension = (PHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
HidDeviceExtension = (PHID_USB_DEVICE_EXTENSION)DeviceExtension->MiniDeviceExtension; HidDeviceExtension = (PHID_USB_DEVICE_EXTENSION)DeviceExtension->MiniDeviceExtension;
// //
// build irp // build irp
// //
Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB, DeviceExtension->NextDeviceObject, NULL, 0, NULL, 0, TRUE, &Event, &IoStatus); Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB,
DeviceExtension->NextDeviceObject,
NULL,
0,
NULL,
0,
TRUE,
&Event,
&IoStatus);
if (!Irp) if (!Irp)
{ {
// //
@ -1333,7 +1369,6 @@ Hid_GetProtocol(
return; return;
} }
// //
// allocate urb // allocate urb
// //
@ -1414,7 +1449,14 @@ Hid_PnpStart(
// get device descriptor // get device descriptor
// //
DescriptorLength = sizeof(USB_DEVICE_DESCRIPTOR); DescriptorLength = sizeof(USB_DEVICE_DESCRIPTOR);
Status = Hid_GetDescriptor(DeviceObject, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), (PVOID*)&HidDeviceExtension->DeviceDescriptor, &DescriptorLength, USB_DEVICE_DESCRIPTOR_TYPE, 0, 0); Status = Hid_GetDescriptor(DeviceObject,
URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
(PVOID *)&HidDeviceExtension->DeviceDescriptor,
&DescriptorLength,
USB_DEVICE_DESCRIPTOR_TYPE,
0,
0);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
// //
@ -1428,7 +1470,14 @@ Hid_PnpStart(
// now get the configuration descriptor // now get the configuration descriptor
// //
DescriptorLength = sizeof(USB_CONFIGURATION_DESCRIPTOR); DescriptorLength = sizeof(USB_CONFIGURATION_DESCRIPTOR);
Status = Hid_GetDescriptor(DeviceObject, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), (PVOID*)&HidDeviceExtension->ConfigurationDescriptor, &DescriptorLength, USB_CONFIGURATION_DESCRIPTOR_TYPE, 0, 0); Status = Hid_GetDescriptor(DeviceObject,
URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
(PVOID *)&HidDeviceExtension->ConfigurationDescriptor,
&DescriptorLength,
USB_CONFIGURATION_DESCRIPTOR_TYPE,
0,
0);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
// //
@ -1459,7 +1508,14 @@ Hid_PnpStart(
// //
// get full configuration descriptor // get full configuration descriptor
// //
Status = Hid_GetDescriptor(DeviceObject, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST), (PVOID*)&HidDeviceExtension->ConfigurationDescriptor, &DescriptorLength, USB_CONFIGURATION_DESCRIPTOR_TYPE, 0, 0); Status = Hid_GetDescriptor(DeviceObject,
URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,
sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST),
(PVOID *)&HidDeviceExtension->ConfigurationDescriptor,
&DescriptorLength,
USB_CONFIGURATION_DESCRIPTOR_TYPE,
0,
0);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
// //
@ -1577,7 +1633,7 @@ HidPnp(
// //
// handle requests based on request type // handle requests based on request type
// //
switch(IoStack->MinorFunction) switch (IoStack->MinorFunction)
{ {
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {

View file

@ -46,7 +46,7 @@ typedef struct
// //
PHID_DESCRIPTOR HidDescriptor; PHID_DESCRIPTOR HidDescriptor;
}HID_USB_DEVICE_EXTENSION, *PHID_USB_DEVICE_EXTENSION; } HID_USB_DEVICE_EXTENSION, *PHID_USB_DEVICE_EXTENSION;
typedef struct typedef struct
{ {
@ -65,7 +65,7 @@ typedef struct
// //
PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT DeviceObject;
}HID_USB_RESET_CONTEXT, *PHID_USB_RESET_CONTEXT; } HID_USB_RESET_CONTEXT, *PHID_USB_RESET_CONTEXT;
NTSTATUS NTSTATUS
@ -86,4 +86,3 @@ Hid_DispatchUrb(
#define USB_SET_IDLE_REQUEST 0xA #define USB_SET_IDLE_REQUEST 0xA
#define USB_GET_PROTOCOL_REQUEST 0x3 #define USB_GET_PROTOCOL_REQUEST 0x3