mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[USBPORT] Implement interface setting in USBPORT_OpenInterface.
This commit is contained in:
parent
ac20ab031c
commit
026a12fe39
1 changed files with 25 additions and 4 deletions
|
@ -249,7 +249,7 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
IN PUSBPORT_CONFIGURATION_HANDLE ConfigHandle,
|
||||
IN PUSBD_INTERFACE_INFORMATION InterfaceInfo,
|
||||
IN OUT PUSBPORT_INTERFACE_HANDLE *iHandle,
|
||||
IN BOOLEAN IsSetInterface)
|
||||
IN BOOLEAN SendSetInterface)
|
||||
{
|
||||
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;
|
||||
PUSBPORT_INTERFACE_HANDLE InterfaceHandle = NULL;
|
||||
|
@ -259,6 +259,7 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
BOOLEAN HasAlternates;
|
||||
ULONG NumEndpoints;
|
||||
SIZE_T Length;
|
||||
USB_DEFAULT_PIPE_SETUP_PACKET SetupPacket;
|
||||
SIZE_T HandleLength;
|
||||
BOOLEAN IsAllocated = FALSE;
|
||||
USHORT MaxPacketSize;
|
||||
|
@ -279,9 +280,29 @@ USBPORT_OpenInterface(IN PURB Urb,
|
|||
Length = FIELD_OFFSET(USBD_INTERFACE_INFORMATION, Pipes) +
|
||||
NumEndpoints * sizeof(USBD_PIPE_INFORMATION);
|
||||
|
||||
if (HasAlternates && IsSetInterface)
|
||||
if (HasAlternates && SendSetInterface)
|
||||
{
|
||||
DPRINT1("USBPORT_OpenInterface: InterfaceInfo->AlternateSetting && IsSetInterface !\n");
|
||||
RtlZeroMemory(&SetupPacket, sizeof(SetupPacket));
|
||||
|
||||
SetupPacket.bmRequestType.Dir = BMREQUEST_HOST_TO_DEVICE;
|
||||
SetupPacket.bmRequestType.Type = BMREQUEST_STANDARD;
|
||||
SetupPacket.bmRequestType.Recipient = BMREQUEST_TO_INTERFACE;
|
||||
SetupPacket.bRequest = USB_REQUEST_SET_INTERFACE;
|
||||
SetupPacket.wValue.W = InterfaceInfo->AlternateSetting;
|
||||
SetupPacket.wIndex.W = InterfaceInfo->InterfaceNumber;
|
||||
SetupPacket.wLength = 0;
|
||||
|
||||
USBPORT_SendSetupPacket(DeviceHandle,
|
||||
FdoDevice,
|
||||
&SetupPacket,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
&USBDStatus);
|
||||
if (!USBD_SUCCESS(USBDStatus))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (*iHandle)
|
||||
|
@ -1533,7 +1554,7 @@ USBPORT_HandleSelectInterface(IN PDEVICE_OBJECT FdoDevice,
|
|||
ConfigurationHandle,
|
||||
Interface,
|
||||
&iHandle,
|
||||
1);
|
||||
TRUE);
|
||||
|
||||
if (USBDStatus)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue