DM USB: fix guest kernel short packets warning
There are many 'short packet' warnings in the UOS kernel dmesg output, which are result from bad short packet identification algorithm. This patch is used to fix it. Change-Id: Idfa0b87fc96893b80d5c9fe8dab4db35aa5bfe84 Tracked-On: Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Reviewed-by: Liang Yang <liang3.yang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
parent
7431a9021c
commit
8317dea64c
|
@ -106,6 +106,13 @@ usb_dev_comp_req(struct libusb_transfer *libusb_xfer)
|
|||
for (i = 0; i < req->blk_count; i++) {
|
||||
done = 0;
|
||||
block = &xfer->data[idx % USB_MAX_XFER_BLOCKS];
|
||||
|
||||
/* Link TRB need to be skipped */
|
||||
if (!block->buf || !block->blen) {
|
||||
idx = (idx + 1) % USB_MAX_XFER_BLOCKS;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (len > buf_idx) {
|
||||
done = block->blen;
|
||||
if (done > len - buf_idx) {
|
||||
|
@ -203,6 +210,7 @@ usb_dev_prepare_xfer(struct usb_data_xfer *xfer, int *count, int *size)
|
|||
|
||||
if (block->processed) {
|
||||
idx = (idx + 1) % USB_MAX_XFER_BLOCKS;
|
||||
c++;
|
||||
continue;
|
||||
}
|
||||
if (block->buf && block->blen > 0) {
|
||||
|
|
Loading…
Reference in New Issue