public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls
@ 2021-01-20 15:58 Patrick Rudolph
  2021-01-20 15:59 ` [PATCH 2/2] MdeModulePkg/Usb/Keyboard.c: don't request protocol before setting Patrick Rudolph
  2021-01-22  1:17 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls Wu, Hao A
  0 siblings, 2 replies; 6+ messages in thread
From: Patrick Rudolph @ 2021-01-20 15:58 UTC (permalink / raw)
  To: devel; +Cc: jian.j.wang, hao.a.wu, ray.ni

From: Matt DeVillier <matt.devillier@gmail.com>

SetConfig is already called during device enumeration,
no need to do it again here.

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
---
 MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 37 --------------------
 1 file changed, 37 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
index 5faf82ea57..77e20b203f 100644
--- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
+++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c
@@ -801,10 +801,8 @@ InitUSBKeyboard (
   IN OUT USB_KB_DEV   *UsbKeyboardDevice
   )
 {
-  UINT16              ConfigValue;
   UINT8               Protocol;
   EFI_STATUS          Status;
-  UINT32              TransferResult;
 
   REPORT_STATUS_CODE_WITH_DEVICE_PATH (
     EFI_PROGRESS_CODE,
@@ -816,41 +814,6 @@ InitUSBKeyboard (
   InitQueue (&UsbKeyboardDevice->EfiKeyQueue, sizeof (EFI_KEY_DATA));
   InitQueue (&UsbKeyboardDevice->EfiKeyQueueForNotify, sizeof (EFI_KEY_DATA));
 
-  //
-  // Use the config out of the descriptor
-  // Assumed the first config is the correct one and this is not always the case
-  //
-  Status = UsbGetConfiguration (
-             UsbKeyboardDevice->UsbIo,
-             &ConfigValue,
-             &TransferResult
-             );
-  if (EFI_ERROR (Status)) {
-    ConfigValue = 0x01;
-    //
-    // Uses default configuration to configure the USB Keyboard device.
-    //
-    Status = UsbSetConfiguration (
-               UsbKeyboardDevice->UsbIo,
-               ConfigValue,
-               &TransferResult
-               );
-    if (EFI_ERROR (Status)) {
-      //
-      // If configuration could not be set here, it means
-      // the keyboard interface has some errors and could
-      // not be initialized
-      //
-      REPORT_STATUS_CODE_WITH_DEVICE_PATH (
-        EFI_ERROR_CODE | EFI_ERROR_MINOR,
-        (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR),
-        UsbKeyboardDevice->DevicePath
-        );
-
-      return EFI_DEVICE_ERROR;
-    }
-  }
-
   UsbGetProtocolRequest (
     UsbKeyboardDevice->UsbIo,
     UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-28  7:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-20 15:58 [PATCH 1/2] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls Patrick Rudolph
2021-01-20 15:59 ` [PATCH 2/2] MdeModulePkg/Usb/Keyboard.c: don't request protocol before setting Patrick Rudolph
2021-01-28  2:14   ` Wu, Hao A
2021-01-28  7:31     ` Patrick Rudolph
2021-01-22  1:17 ` [edk2-devel] [PATCH 1/2] MdeModulePkg/Usb/Keyboard.c: remove Get/SetConfig calls Wu, Hao A
2021-01-28  2:14   ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox