Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d1ca50 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

USB: f_mtp: Increase the IN endpoint buffer allocation



Some UDC may require allocation of some extra bytes for
TX buffer due to hardware requirement. Add necessary
changes for the same.

Change-Id: I7ebe4cfb1c1d6f4e6ab2914db5e7256003b4b638
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent 4753a250
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -515,6 +515,7 @@ static int mtp_create_bulk_endpoints(struct mtp_dev *dev,
	struct usb_composite_dev *cdev = dev->cdev;
	struct usb_request *req;
	struct usb_ep *ep;
	size_t extra_buf_alloc = cdev->gadget->extra_buf_alloc;
	int i;

	DBG(cdev, "create_bulk_endpoints dev: %p\n", dev);
@@ -552,7 +553,8 @@ retry_tx_alloc:

	/* now allocate requests for our endpoints */
	for (i = 0; i < mtp_tx_reqs; i++) {
		req = mtp_request_new(dev->ep_in, mtp_tx_req_len);
		req = mtp_request_new(dev->ep_in,
				mtp_tx_req_len + extra_buf_alloc);
		if (!req) {
			if (mtp_tx_req_len <= MTP_BULK_BUFFER_SIZE)
				goto fail;
@@ -590,7 +592,8 @@ retry_rx_alloc:
		dev->rx_req[i] = req;
	}
	for (i = 0; i < INTR_REQ_MAX; i++) {
		req = mtp_request_new(dev->ep_intr, INTR_BUFFER_SIZE);
		req = mtp_request_new(dev->ep_intr,
				INTR_BUFFER_SIZE + extra_buf_alloc);
		if (!req)
			goto fail;
		req->complete = mtp_complete_intr;