From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"matt.devillier@gmail.com" <matt.devillier@gmail.com>
Cc: "newexplorerj@gmail.com" <newexplorerj@gmail.com>
Subject: Re: [edk2-devel] [edk2] [PATCH 2/2] MdeModulePkg/Usb/UsbMouse: Fix endpoint selection
Date: Fri, 3 Jan 2020 02:53:49 +0000 [thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C98F51E@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <VIDc.1576179468956061797.i9pv@groups.io>
[-- Attachment #1: Type: text/plain, Size: 2487 bytes --]
Similar comments with PATCH 1, could you help to change the modified 'if'
statement to:
if (((EndpointDescriptor.Attributes & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) &&
((EndpointDescriptor.EndpointAddress & USB_ENDPOINT_DIR_IN) != 0)) {
so that the 2nd condition can be aligned with others.
With the above change
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of MrChromebox
Sent: Friday, December 13, 2019 3:38 AM
To: devel@edk2.groups.io
Subject: [edk2-devel] [edk2] [PATCH 2/2] MdeModulePkg/Usb/UsbMouse: Fix endpoint selection
From 2a8e343f8a5848825d3d12ba76df0fb4212ab5b8 Mon Sep 17 00:00:00 2001
From: Matt DeVillier <matt.devillier@gmail.com>
Date: Thu, 12 Dec 2019 12:54:14 -0600
Subject: [PATCH 2/2] MdeModulePkg/Usb/UsbMouse: Fix endpoint selection
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 f4448bffe6..e9f74cec60 100644
--- a/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
+++ b/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouse.c
@@ -209,7 +209,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++) {
@@ -219,7 +219,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) ) {
//
// We only care interrupt endpoint here
//
--
2.20.1
[-- Attachment #2: Type: text/html, Size: 30923 bytes --]
prev parent reply other threads:[~2020-01-03 2:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 19:37 [edk2] [PATCH 2/2] MdeModulePkg/Usb/UsbMouse: Fix endpoint selection MrChromebox
2019-12-30 6:05 ` [edk2-devel] " newexplorerj
2020-01-03 2:53 ` Wu, Hao A [this message]
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=B80AF82E9BFB8E4FBD8C89DA810C6A093C98F51E@SHSMSX104.ccr.corp.intel.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