DM USB: xHCI: refine the failure process logic of control transfer

The old logic to process control transfer failure only include two cases:
1 Short packet
2 Stall.
This patch includes all possible failures reported by Libusb and does
related emulation for UOS

Tracked-On: #2918
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Xiaoguang Wu
2019-03-18 10:24:00 +00:00
committed by Eddie Dong
parent 6915264740
commit 122685b7b9
2 changed files with 6 additions and 46 deletions

View File

@@ -428,9 +428,10 @@ usb_dev_err_convert(int err)
switch (err) {
case LIBUSB_ERROR_TIMEOUT: return USB_ERR_TIMEOUT;
case LIBUSB_ERROR_PIPE: return USB_ERR_STALLED;
case LIBUSB_ERROR_NO_DEVICE: return USB_ERR_INVAL;
case LIBUSB_ERROR_NO_DEVICE: return USB_ERR_IOERROR;
case LIBUSB_ERROR_BUSY: return USB_ERR_IN_USE;
case LIBUSB_ERROR_OVERFLOW: return USB_ERR_TOO_DEEP;
case LIBUSB_ERROR_OVERFLOW: return USB_ERR_BAD_BUFSIZE;
case LIBUSB_ERROR_IO: return USB_ERR_IOERROR;
default:
break; /* add more when required */
}