Skip to content

Commit adaed5c

Browse files
xiaoguangwuacrnsi
authored andcommitted
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 <xiaoguang.wu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent f2e35ab commit adaed5c

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

devicemodel/hw/pci/xhci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,6 +2875,9 @@ pci_xhci_handle_transfer(struct pci_xhci_vdev *xdev,
28752875
XHCI_GADDR(xdev, trb->qwTrb0)),
28762876
trb->dwTrb2 & 0x1FFFF, (void *)addr,
28772877
ccs);
2878+
2879+
if (trb->dwTrb3 & XHCI_TRB_3_CHAIN_BIT)
2880+
xfer_block->chained = 1;
28782881
break;
28792882

28802883
case XHCI_TRB_TYPE_STATUS_STAGE:

devicemodel/hw/usb_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ usb_data_xfer_append(struct usb_data_xfer *xfer, void *buf, int blen,
117117
xb->ccs = ccs;
118118
xb->processed = USB_XFER_BLK_FREE;
119119
xb->bdone = 0;
120+
xb->chained = 0;
120121
xfer->ndata++;
121122
xfer->tail = (xfer->tail + 1) % USB_MAX_XFER_BLOCKS;
122123
return xb;

devicemodel/include/usb_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ struct usb_data_xfer_block {
155155
enum usb_xfer_blk_stat processed; /* processed status */
156156
void *hci_data; /* HCI private reference */
157157
int ccs;
158+
int chained;
158159
uint32_t streamid;
159160
uint64_t trbnext; /* next TRB guest address */
160161
};

0 commit comments

Comments
 (0)