DM USB: introduce struct xhci_block for xHCI emulation

In the struct usb_block, there are some fields such as 'ccs',
'streamid', which should not be seen in the USB layer. This
patch intruduces new struct xhci_block to include the variables
for xHCI emulation.

Tracked-On: #3628
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-09-09 16:14:30 +08:00
committed by wenlingz
parent 0110465416
commit 8949a5802a
3 changed files with 96 additions and 43 deletions

View File

@@ -101,19 +101,21 @@ usb_emu_finddev(char *name)
}
struct usb_block *
usb_block_append(struct usb_xfer *xfer, void *buf, int blen,
void *hci_data, int ccs)
usb_block_append(struct usb_xfer *xfer, void *buf, int blen, void *hcb,
int hcb_len)
{
struct usb_block *xb;
if (xfer->ndata >= USB_MAX_XFER_BLOCKS)
return NULL;
if (hcb == NULL)
return NULL;
xb = &xfer->data[xfer->tail];
xb->buf = buf;
xb->blen = blen;
xb->hci_data = hci_data;
xb->ccs = ccs;
memcpy(xb->hcb, hcb, hcb_len);
xb->stat = USB_BLOCK_FREE;
xb->bdone = 0;
xb->type = USB_DATA_NONE;