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

Commit 2b5ed57b authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

USB: f_rndis: 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: I6df0a248e5ac6706de68104cccbb738643f1eab1
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 091d4ff6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -793,7 +793,8 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
	rndis->notify_req = usb_ep_alloc_request(ep, GFP_KERNEL);
	if (!rndis->notify_req)
		goto fail;
	rndis->notify_req->buf = kmalloc(STATUS_BYTECOUNT, GFP_KERNEL);
	rndis->notify_req->buf = kmalloc(STATUS_BYTECOUNT +
			cdev->gadget->extra_buf_alloc, GFP_KERNEL);
	if (!rndis->notify_req->buf)
		goto fail;
	rndis->notify_req->length = STATUS_BYTECOUNT;
+4 −3
Original line number Diff line number Diff line
@@ -651,7 +651,8 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)
	} else {
		/* Is aggregation already enabled and buffers allocated ? */
		if (dev->port_usb->multi_pkt_xfer && dev->tx_req_bufsize) {
			req->buf = kzalloc(dev->tx_req_bufsize, GFP_ATOMIC);
			req->buf = kzalloc(dev->tx_req_bufsize
				+ dev->gadget->extra_buf_alloc, GFP_ATOMIC);
			req->context = NULL;
		} else {
			req->buf = NULL;
@@ -690,8 +691,8 @@ static int alloc_tx_buffer(struct eth_dev *dev)
	list_for_each(act, &dev->tx_reqs) {
		req = container_of(act, struct usb_request, list);
		if (!req->buf)
			req->buf = kmalloc(dev->tx_req_bufsize,
						GFP_ATOMIC);
			req->buf = kmalloc(dev->tx_req_bufsize
				+ dev->gadget->extra_buf_alloc, GFP_ATOMIC);

		if (!req->buf)
			goto free_buf;