From 9d10efa2a01420efb5909dea80280f2a5802376a Mon Sep 17 00:00:00 2001 From: Daehwan Jung Date: Thu, 1 Apr 2021 15:25:20 +0900 Subject: [PATCH] ANDROID: usb: host: add max packet parameter on alloc_transfer_ring hook It needs to add max_packet parameter on alloc_transfer_ring. It's used for setting ring->bounce_buf_len. Bug: 183761108 Signed-off-by: Daehwan Jung Change-Id: I2bd3ded9edf31d20b5f05c41828d5d6ccf6864e0 --- drivers/usb/host/xhci-mem.c | 7 ++++--- drivers/usb/host/xhci.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index bdff9143141f..64f4cfbf6c57 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -384,13 +384,13 @@ static void xhci_vendor_alloc_container_ctx(struct xhci_hcd *xhci, struct xhci_c static struct xhci_ring *xhci_vendor_alloc_transfer_ring(struct xhci_hcd *xhci, u32 endpoint_type, enum xhci_ring_type ring_type, - gfp_t mem_flags) + unsigned int max_packet, gfp_t mem_flags) { struct xhci_vendor_ops *ops = xhci_vendor_get_ops(xhci); if (ops && ops->alloc_transfer_ring) return ops->alloc_transfer_ring(xhci, endpoint_type, ring_type, - mem_flags); + max_packet, mem_flags); return 0; } @@ -1558,7 +1558,8 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, if (xhci_vendor_is_usb_offload_enabled(xhci, virt_dev, ep_index) && usb_endpoint_xfer_isoc(&ep->desc)) { virt_dev->eps[ep_index].new_ring = - xhci_vendor_alloc_transfer_ring(xhci, endpoint_type, ring_type, mem_flags); + xhci_vendor_alloc_transfer_ring(xhci, endpoint_type, ring_type, + max_packet, mem_flags); } else { virt_dev->eps[ep_index].new_ring = xhci_ring_alloc(xhci, 2, 1, ring_type, max_packet, mem_flags); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ce9603d2dab4..a6dcc101eeb4 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -2239,7 +2239,7 @@ struct xhci_vendor_ops { struct xhci_ring *(*alloc_transfer_ring)(struct xhci_hcd *xhci, u32 endpoint_type, enum xhci_ring_type ring_type, - gfp_t mem_flags); + unsigned int max_packet, gfp_t mem_flags); void (*free_transfer_ring)(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, unsigned int ep_index); int (*sync_dev_ctx)(struct xhci_hcd *xhci, unsigned int slot_id);