DM USB: introduce enum type usb_block_type

In the process of USB data transfer, there three kinds of data blocks:
a. Non data block, which contains some control information;
b. Partial data block, which contains part of a large data chunk;
c. Full data block, which contains a complete data chunk.

In previous implementation, the differences mentioned above are described
by the usb_block::chained. But the 'chained' is concept in the xHCI area
and should not appear in the USB layer. This patch introduces enum type
usb_block_type to replace the 'chained' field in struct usb_block.

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 11:23:03 +08:00
committed by wenlingz
parent 7445e404a8
commit 236c23e418
4 changed files with 45 additions and 22 deletions

View File

@@ -116,7 +116,7 @@ usb_block_append(struct usb_xfer *xfer, void *buf, int blen,
xb->ccs = ccs;
xb->stat = USB_BLOCK_FREE;
xb->bdone = 0;
xb->chained = 0;
xb->type = USB_DATA_NONE;
xfer->ndata++;
xfer->tail = (xfer->tail + 1) % USB_MAX_XFER_BLOCKS;
return xb;