]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
MdeModulePkg/Usb/UsbMouse: Fix endpoint selection
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbMouseDxe / UsbMouse.c
index 677815a8ade3de3a298b8326679d1e65e8d0218a..143ff15eb034d2a0d320a7e1ae823641633a9901 100644 (file)
@@ -203,7 +203,7 @@ USBMouseDriverBindingStart (
   EndpointNumber = UsbMouseDevice->InterfaceDescriptor.NumEndpoints;\r
 \r
   //\r
-  // Traverse endpoints to find interrupt endpoint\r
+  // Traverse endpoints to find interrupt endpoint IN\r
   //\r
   Found = FALSE;\r
   for (Index = 0; Index < EndpointNumber; Index++) {\r
@@ -213,7 +213,8 @@ USBMouseDriverBindingStart (
              &EndpointDescriptor\r
              );\r
 \r
-    if ((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) {\r
+    if (((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) &&\r
+        ((EndpointDescriptor.EndpointAddress & USB_ENDPOINT_DIR_IN) != 0)) {\r
       //\r
       // We only care interrupt endpoint here\r
       //\r