File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -2173,10 +2173,19 @@ pci_xhci_xfer_complete(struct pci_xhci_vdev *xdev,
2173
2173
XHCI_ST_EPCTX_HALTED ;
2174
2174
err = XHCI_TRB_ERROR_STALL ;
2175
2175
break ;
2176
+ case USB_ERR_SHORT_XFER :
2177
+ err = XHCI_TRB_ERROR_SHORT_PKT ;
2178
+ break ;
2179
+ case USB_ERR_TIMEOUT :
2180
+ case USB_ERR_IOERROR :
2181
+ err = XHCI_TRB_ERROR_XACT ;
2182
+ break ;
2183
+ case USB_ERR_BAD_BUFSIZE :
2184
+ err = XHCI_TRB_ERROR_BABBLE ;
2185
+ break ;
2176
2186
case USB_ERR_NORMAL_COMPLETION :
2177
2187
break ;
2178
2188
default :
2179
- /* FIXME: should process other failures */
2180
2189
UPRINTF (LFTL , "unknown error %d\r\n" , xfer -> status );
2181
2190
}
2182
2191
Original file line number Diff line number Diff line change @@ -62,13 +62,21 @@ usb_dev_comp_req(struct libusb_transfer *libusb_xfer)
62
62
xfer -> status = USB_ERR_STALLED ;
63
63
goto out ;
64
64
case LIBUSB_TRANSFER_NO_DEVICE :
65
+ /* avoid short packet warnings when devices are plugged out. */
66
+ xfer -> status = USB_ERR_SHORT_XFER ;
67
+ goto out ;
65
68
case LIBUSB_TRANSFER_ERROR :
66
- case LIBUSB_TRANSFER_TIMED_OUT :
69
+ xfer -> status = USB_ERR_STALLED ;
70
+ goto out ;
67
71
case LIBUSB_TRANSFER_CANCELLED :
72
+ xfer -> status = USB_ERR_IOERROR ;
73
+ goto out ;
74
+ case LIBUSB_TRANSFER_TIMED_OUT :
75
+ xfer -> status = USB_ERR_TIMEOUT ;
76
+ goto out ;
68
77
case LIBUSB_TRANSFER_OVERFLOW :
69
- /* FIXME: should treat every failure properly */
70
- UPRINTF (LWRN , "failure: %x\r\n" , libusb_xfer -> status );
71
- break ;
78
+ xfer -> status = USB_ERR_BAD_BUFSIZE ;
79
+ goto out ;
72
80
case LIBUSB_TRANSFER_COMPLETED :
73
81
break ;
74
82
default :
You can’t perform that action at this time.
0 commit comments