From 1b255b7f51f0e18c0a96c7d1d9d59381f5c7f595 Mon Sep 17 00:00:00 2001 From: Liu Long Date: Fri, 5 Feb 2021 09:55:15 +0800 Subject: [PATCH] DM: xHCI: Fix the USB3.2 device recognition problem. The device descriptor describes general information about a device, the bcdUSB field contains a BCD version number. The version 3.2 is represented with value of 0x320H. Add the missed BCD version in the bcdUSB case statement. And modify the return value of address device command in case create device failed. Tracked-On: #5712 Signed-off-by: Liu Long Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 1 + devicemodel/hw/platform/usb_pmapper.c | 1 + 2 files changed, 2 insertions(+) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index 0f7b5a221..b9322d8b4 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -2088,6 +2088,7 @@ pci_xhci_cmd_address_device(struct pci_xhci_vdev *xdev, UPRINTF(LFTL, "fail to create device for %d-%s\r\n", di->path.bus, usb_dev_path(&di->path)); + cmderr = XHCI_TRB_ERROR_XACT; goto done; } diff --git a/devicemodel/hw/platform/usb_pmapper.c b/devicemodel/hw/platform/usb_pmapper.c index a18199bb8..96a98cb53 100644 --- a/devicemodel/hw/platform/usb_pmapper.c +++ b/devicemodel/hw/platform/usb_pmapper.c @@ -1067,6 +1067,7 @@ usb_dev_init(void *pdata, char *opt) goto errout; switch (desc.bcdUSB) { + case 0x320: case 0x310: case 0x300: ver = 3; break;