From: "MrChromebox" <matt.devillier@gmail.com>
To: devel@edk2.groups.io
Cc: Matt DeVillier <matt.devillier@gmail.com>
Subject: [PATCH v3 2/3] MdeModulePkg/Usb/UsbMouse: Fix endpoint selection
Date: Sun, 5 Jan 2020 22:12:06 -0600 [thread overview]
Message-ID: <20200106041207.29728-3-matt.devillier@gmail.com> (raw)
In-Reply-To: <20200106041207.29728-1-matt.devillier@gmail.com>
The endpoint selected by the driver needs to not
only be an interrupt type, but have direction IN
as required to set up an asynchronous interrupt transfer.
Currently, the driver assumes that the first INT endpoint
will be of type IN, but that is not true of all devices,
and will silently fail on devices which have the OUT endpoint
before the IN. Adjust the endpoint selection loop to explictly
check for direction IN.
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
---
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
index 677815a8ad..143ff15eb0 100644
--- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
+++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
@@ -203,7 +203,7 @@ USBMouseDriverBindingStart (
EndpointNumber = UsbMouseDevice->InterfaceDescriptor.NumEndpoints;
//
- // Traverse endpoints to find interrupt endpoint
+ // Traverse endpoints to find interrupt endpoint IN
//
Found = FALSE;
for (Index = 0; Index < EndpointNumber; Index++) {
@@ -213,7 +213,8 @@ USBMouseDriverBindingStart (
&EndpointDescriptor
);
- if ((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) {
+ if (((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) &&
+ ((EndpointDescriptor.EndpointAddress & USB_ENDPOINT_DIR_IN) != 0)) {
//
// We only care interrupt endpoint here
//
--
2.20.1
next prev parent reply other threads:[~2020-01-06 4:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200106041207.29728-1-matt.devillier@gmail.com>
2020-01-06 4:12 ` [PATCH v3 1/3] MdeModulePkg/Usb/EfiKey: Fix endpoint selection MrChromebox
2020-01-06 5:31 ` [edk2-devel] " Wu, Hao A
2020-01-06 6:52 ` Wu, Hao A
2020-01-06 4:12 ` MrChromebox [this message]
2020-01-06 5:31 ` [edk2-devel] [PATCH v3 2/3] MdeModulePkg/Usb/UsbMouse: " Wu, Hao A
2020-01-06 4:12 ` [PATCH v3 3/3] MdeModulePkg/UsbMouseAbsolutePointer: " MrChromebox
2020-01-06 5:31 ` [edk2-devel] " Wu, Hao A
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200106041207.29728-3-matt.devillier@gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox