DM USB: dynamically allocate block count for struct usb_xfer

The block count of the struct usb_xfer is hard coded by the macro
USB_MAX_XFER_BLOCKS (1024), it wastes memory if 1024 blocks are
allocated for low speed transfer such as control transfer or interrupt
transfer. This patch introduces a new method to allocate different
number of blocks according to different endpoint type.

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-08-27 22:28:18 +08:00
committed by wenlingz
parent f1b142e6e0
commit 06781b37e9
6 changed files with 95 additions and 42 deletions

View File

@@ -190,6 +190,15 @@ struct xhci_endp_ctx {
volatile uint32_t dwEpCtx7;
};
#define XHCI_EPTYPE_INVALID 0
#define XHCI_EPTYPE_ISOC_OUT 1
#define XHCI_EPTYPE_BULK_OUT 2
#define XHCI_EPTYPE_INT_OUT 3
#define XHCI_EPTYPE_CTRL 4
#define XHCI_EPTYPE_ISOC_IN 5
#define XHCI_EPTYPE_BULK_IN 6
#define XHCI_EPTYPE_INT_IN 7
struct xhci_input_ctx {
#define XHCI_INCTX_NON_CTRL_MASK 0xFFFFFFFCU
volatile uint32_t dwInCtx0;