mirror of
https://github.com/reactos/reactos.git
synced 2025-07-29 04:22:35 +00:00
[HIDUSB]
- The usual... fix some whitespace svn path=/trunk/; revision=59006
This commit is contained in:
parent
9c5af92297
commit
1e777a48a7
2 changed files with 107 additions and 52 deletions
|
@ -69,7 +69,15 @@ HidUsb_GetPortStatus(
|
|||
//
|
||||
// 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)
|
||||
{
|
||||
//
|
||||
|
@ -249,7 +257,15 @@ HidUsb_ResetPort(
|
|||
//
|
||||
// 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)
|
||||
{
|
||||
//
|
||||
|
@ -646,7 +662,14 @@ HidUsb_GetReportDescriptor(
|
|||
// FIXME: support old hid version
|
||||
//
|
||||
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))
|
||||
{
|
||||
//
|
||||
|
@ -654,7 +677,14 @@ HidUsb_GetReportDescriptor(
|
|||
// try with old hid version
|
||||
//
|
||||
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))
|
||||
{
|
||||
DPRINT("[HIDUSB] failed to get report descriptor with %x\n", Status);
|
||||
|
@ -926,7 +956,6 @@ Hid_PnpCompletion(
|
|||
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||
}
|
||||
|
||||
|
||||
NTSTATUS
|
||||
Hid_DispatchUrb(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
|
@ -951,11 +980,18 @@ Hid_DispatchUrb(
|
|||
DeviceExtension = (PHID_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
HidDeviceExtension = (PHID_USB_DEVICE_EXTENSION)DeviceExtension->MiniDeviceExtension;
|
||||
|
||||
|
||||
//
|
||||
// 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)
|
||||
{
|
||||
//
|
||||
|
@ -1333,7 +1369,6 @@ Hid_GetProtocol(
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// allocate urb
|
||||
//
|
||||
|
@ -1414,7 +1449,14 @@ Hid_PnpStart(
|
|||
// get 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))
|
||||
{
|
||||
//
|
||||
|
@ -1428,7 +1470,14 @@ Hid_PnpStart(
|
|||
// now get the 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))
|
||||
{
|
||||
//
|
||||
|
@ -1459,7 +1508,14 @@ Hid_PnpStart(
|
|||
//
|
||||
// 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))
|
||||
{
|
||||
//
|
||||
|
|
|
@ -86,4 +86,3 @@ Hid_DispatchUrb(
|
|||
|
||||
#define USB_SET_IDLE_REQUEST 0xA
|
||||
#define USB_GET_PROTOCOL_REQUEST 0x3
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue