mirror of
https://github.com/reactos/reactos.git
synced 2025-05-18 00:31:27 +00:00
[USBPORT]
- Simplify some loops in USBPORT_OpenInterface. No logical changes svn path=/trunk/; revision=75907
This commit is contained in:
parent
f8f16e6698
commit
67b277f50f
1 changed files with 56 additions and 69 deletions
|
@ -304,17 +304,12 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
|
||||
RtlZeroMemory(InterfaceHandle, HandleLength);
|
||||
|
||||
if (NumEndpoints > 0)
|
||||
{
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[0];
|
||||
|
||||
for (ix = 0; ix < NumEndpoints; ++ix)
|
||||
{
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[ix];
|
||||
|
||||
PipeHandle->Flags = PIPE_HANDLE_FLAG_CLOSED;
|
||||
PipeHandle->Endpoint = NULL;
|
||||
|
||||
PipeHandle += 1;
|
||||
}
|
||||
}
|
||||
|
||||
IsAllocated = TRUE;
|
||||
|
@ -335,12 +330,10 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
Descriptor = (PUSB_ENDPOINT_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor +
|
||||
InterfaceDescriptor->bLength);
|
||||
|
||||
if (NumEndpoints)
|
||||
{
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[0];
|
||||
|
||||
for (ix = 0; ix < NumEndpoints; ++ix)
|
||||
{
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[ix];
|
||||
|
||||
while (Descriptor->bDescriptorType != USB_ENDPOINT_DESCRIPTOR_TYPE)
|
||||
{
|
||||
if (Descriptor->bLength == 0)
|
||||
|
@ -380,20 +373,15 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
|
||||
Descriptor = (PUSB_ENDPOINT_DESCRIPTOR)((ULONG_PTR)Descriptor +
|
||||
Descriptor->bLength);
|
||||
|
||||
PipeHandle += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (USBD_SUCCESS(USBDStatus))
|
||||
{
|
||||
if (NumEndpoints)
|
||||
{
|
||||
PipeInfo = &InterfaceInfo->Pipes[0];
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[0];
|
||||
|
||||
for (ix = 0; ix < NumEndpoints; ++ix)
|
||||
{
|
||||
PipeInfo = &InterfaceInfo->Pipes[ix];
|
||||
PipeHandle = &InterfaceHandle->PipeHandle[ix];
|
||||
|
||||
Status = USBPORT_OpenPipe(FdoDevice,
|
||||
DeviceHandle,
|
||||
PipeHandle,
|
||||
|
@ -403,11 +391,10 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
break;
|
||||
|
||||
PipeInfo->PipeHandle = PipeHandle;
|
||||
|
||||
PipeHandle += 1;
|
||||
PipeInfo += 1;
|
||||
}
|
||||
|
||||
if (NumEndpoints)
|
||||
{
|
||||
USBPORT_USBDStatusToNtStatus(Urb, USBDStatus);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue