public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/UsbBusDxe: Return error when the device is not present
@ 2019-07-31  6:25 Marcin Wojtas
  2019-07-31 11:37 ` Laszlo Ersek
  2019-07-31 16:51 ` Ni, Ray
  0 siblings, 2 replies; 7+ messages in thread
From: Marcin Wojtas @ 2019-07-31  6:25 UTC (permalink / raw)
  To: devel
  Cc: leif.lindholm, ard.biesheuvel, mw, jsd, jaz, feng.tian,
	michael.d.kinney, liming.gao, lersek

Until now, during the USB device enumeration when its PortState
USB_PORT_STAT_CONNECTION bit was not set, the stack was not informed
that the device is not present. Fix that by returning appropriate
error code.

Change-Id: I588f82b987993e9755f64ce76cde9eb690ef1d54
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
index be9d9bd..ab1db15 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
@@ -719,6 +719,7 @@ UsbEnumerateNewDev (
 
   if (!USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_CONNECTION)) {
     DEBUG ((EFI_D_ERROR, "UsbEnumerateNewDev: No device present at port %d\n", Port));
+    Status = EFI_NOT_FOUND;
     goto ON_ERROR;
   } else if (USB_BIT_IS_SET (PortState.PortStatus, USB_PORT_STAT_SUPER_SPEED)){
     Child->Speed      = EFI_USB_SPEED_SUPER;
-- 
2.7.4


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

end of thread, other threads:[~2019-08-05  1:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-31  6:25 [PATCH] MdeModulePkg/UsbBusDxe: Return error when the device is not present Marcin Wojtas
2019-07-31 11:37 ` Laszlo Ersek
2019-08-02  1:05   ` [edk2-devel] " Wu, Hao A
2019-07-31 16:51 ` Ni, Ray
2019-08-02  1:03   ` Wu, Hao A
2019-08-02  7:11     ` Marcin Wojtas
2019-08-05  1:37       ` 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