From adaed5c0e3c99a5074cf833266ffe58b8cb25fa6 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Mon, 29 Apr 2019 10:41:22 +0800 Subject: [PATCH] DM USB: xHCI: add 'chained' field in struct usb_data_xfer_block The chained field could help to describe the relationship of USB data blocks. Tracked-On: #3054 Signed-off-by: Xiaoguang Wu Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 3 +++ devicemodel/hw/usb_core.c | 1 + devicemodel/include/usb_core.h | 1 + 3 files changed, 5 insertions(+) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index b9cb05158..d75bb9bff 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -2875,6 +2875,9 @@ retry: XHCI_GADDR(xdev, trb->qwTrb0)), trb->dwTrb2 & 0x1FFFF, (void *)addr, ccs); + + if (trb->dwTrb3 & XHCI_TRB_3_CHAIN_BIT) + xfer_block->chained = 1; break; case XHCI_TRB_TYPE_STATUS_STAGE: diff --git a/devicemodel/hw/usb_core.c b/devicemodel/hw/usb_core.c index db86ec000..a18cda0e3 100644 --- a/devicemodel/hw/usb_core.c +++ b/devicemodel/hw/usb_core.c @@ -117,6 +117,7 @@ usb_data_xfer_append(struct usb_data_xfer *xfer, void *buf, int blen, xb->ccs = ccs; xb->processed = USB_XFER_BLK_FREE; xb->bdone = 0; + xb->chained = 0; xfer->ndata++; xfer->tail = (xfer->tail + 1) % USB_MAX_XFER_BLOCKS; return xb; diff --git a/devicemodel/include/usb_core.h b/devicemodel/include/usb_core.h index 6d663fa92..c3e101f06 100644 --- a/devicemodel/include/usb_core.h +++ b/devicemodel/include/usb_core.h @@ -155,6 +155,7 @@ struct usb_data_xfer_block { enum usb_xfer_blk_stat processed; /* processed status */ void *hci_data; /* HCI private reference */ int ccs; + int chained; uint32_t streamid; uint64_t trbnext; /* next TRB guest address */ };