[USBPORT]

- Rename NumInterfaces to NumEndpoints in USBPORT_OpenInterface

svn path=/trunk/; revision=75906
This commit is contained in:
Thomas Faber 2017-09-18 11:50:42 +00:00
parent 194b4799ae
commit f8f16e6698

View file

@ -256,7 +256,7 @@ USBPORT_OpenInterface(IN PURB Urb,
PUSBPORT_PIPE_HANDLE PipeHandle; PUSBPORT_PIPE_HANDLE PipeHandle;
PUSB_ENDPOINT_DESCRIPTOR Descriptor; PUSB_ENDPOINT_DESCRIPTOR Descriptor;
PUSBD_PIPE_INFORMATION PipeInfo; PUSBD_PIPE_INFORMATION PipeInfo;
ULONG NumInterfaces; ULONG NumEndpoints;
SIZE_T Length; SIZE_T Length;
SIZE_T HandleLength; SIZE_T HandleLength;
BOOLEAN IsAllocated = FALSE; BOOLEAN IsAllocated = FALSE;
@ -273,10 +273,10 @@ USBPORT_OpenInterface(IN PURB Urb,
InterfaceInfo->AlternateSetting, InterfaceInfo->AlternateSetting,
&InterfaceInfo->AlternateSetting); &InterfaceInfo->AlternateSetting);
NumInterfaces = InterfaceDescriptor->bNumEndpoints; NumEndpoints = InterfaceDescriptor->bNumEndpoints;
Length = sizeof(USBD_INTERFACE_INFORMATION) + Length = sizeof(USBD_INTERFACE_INFORMATION) +
(NumInterfaces - 1) * sizeof(USBD_PIPE_INFORMATION); (NumEndpoints - 1) * sizeof(USBD_PIPE_INFORMATION);
if (InterfaceInfo->AlternateSetting && IsSetInterface) if (InterfaceInfo->AlternateSetting && IsSetInterface)
{ {
@ -290,7 +290,7 @@ USBPORT_OpenInterface(IN PURB Urb,
else else
{ {
HandleLength = sizeof(USBPORT_INTERFACE_HANDLE) + HandleLength = sizeof(USBPORT_INTERFACE_HANDLE) +
(NumInterfaces - 1) * sizeof(USBPORT_PIPE_HANDLE); (NumEndpoints - 1) * sizeof(USBPORT_PIPE_HANDLE);
InterfaceHandle = ExAllocatePoolWithTag(NonPagedPool, InterfaceHandle = ExAllocatePoolWithTag(NonPagedPool,
HandleLength, HandleLength,
@ -304,11 +304,11 @@ USBPORT_OpenInterface(IN PURB Urb,
RtlZeroMemory(InterfaceHandle, HandleLength); RtlZeroMemory(InterfaceHandle, HandleLength);
if (NumInterfaces > 0) if (NumEndpoints > 0)
{ {
PipeHandle = &InterfaceHandle->PipeHandle[0]; PipeHandle = &InterfaceHandle->PipeHandle[0];
for (ix = 0; ix < NumInterfaces; ++ix) for (ix = 0; ix < NumEndpoints; ++ix)
{ {
PipeHandle->Flags = PIPE_HANDLE_FLAG_CLOSED; PipeHandle->Flags = PIPE_HANDLE_FLAG_CLOSED;
PipeHandle->Endpoint = NULL; PipeHandle->Endpoint = NULL;
@ -335,11 +335,11 @@ USBPORT_OpenInterface(IN PURB Urb,
Descriptor = (PUSB_ENDPOINT_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor + Descriptor = (PUSB_ENDPOINT_DESCRIPTOR)((ULONG_PTR)InterfaceDescriptor +
InterfaceDescriptor->bLength); InterfaceDescriptor->bLength);
if (NumInterfaces) if (NumEndpoints)
{ {
PipeHandle = &InterfaceHandle->PipeHandle[0]; PipeHandle = &InterfaceHandle->PipeHandle[0];
for (ix = 0; ix < NumInterfaces; ++ix) for (ix = 0; ix < NumEndpoints; ++ix)
{ {
while (Descriptor->bDescriptorType != USB_ENDPOINT_DESCRIPTOR_TYPE) while (Descriptor->bDescriptorType != USB_ENDPOINT_DESCRIPTOR_TYPE)
{ {
@ -387,12 +387,12 @@ USBPORT_OpenInterface(IN PURB Urb,
if (USBD_SUCCESS(USBDStatus)) if (USBD_SUCCESS(USBDStatus))
{ {
if (NumInterfaces) if (NumEndpoints)
{ {
PipeInfo = &InterfaceInfo->Pipes[0]; PipeInfo = &InterfaceInfo->Pipes[0];
PipeHandle = &InterfaceHandle->PipeHandle[0]; PipeHandle = &InterfaceHandle->PipeHandle[0];
for (ix = 0; ix < NumInterfaces; ++ix) for (ix = 0; ix < NumEndpoints; ++ix)
{ {
Status = USBPORT_OpenPipe(FdoDevice, Status = USBPORT_OpenPipe(FdoDevice,
DeviceHandle, DeviceHandle,
@ -424,7 +424,7 @@ Exit:
{ {
if (InterfaceHandle) if (InterfaceHandle)
{ {
if (NumInterfaces) if (NumEndpoints)
{ {
DPRINT1("USBPORT_OpenInterface: USBDStatus - %lx\n", USBDStatus); DPRINT1("USBPORT_OpenInterface: USBDStatus - %lx\n", USBDStatus);
} }