diff --git a/drivers/usb/usbport/device.c b/drivers/usb/usbport/device.c index 86765719856..dbabb3113b0 100644 --- a/drivers/usb/usbport/device.c +++ b/drivers/usb/usbport/device.c @@ -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) {