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

Commit 08202d56 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

USB: f_ncm: 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: I77587e6afd66c9c3ea62b6c728e72a91c1e38e25
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent 9579a43c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1325,7 +1325,8 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
	ncm->notify_req = usb_ep_alloc_request(ep, GFP_KERNEL);
	if (!ncm->notify_req)
		goto fail;
	ncm->notify_req->buf = kmalloc(NCM_STATUS_BYTECOUNT, GFP_KERNEL);
	ncm->notify_req->buf = kmalloc(NCM_STATUS_BYTECOUNT
			+ (cdev->gadget->extra_buf_alloc), GFP_KERNEL);
	if (!ncm->notify_req->buf)
		goto fail;
	ncm->notify_req->context = ncm;
+4 −3
Original line number Diff line number Diff line
@@ -820,7 +820,8 @@ static void tx_complete(struct usb_ep *ep, struct usb_request *req)
		skb = req->context;
		/* 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;
@@ -859,8 +860,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 = kzalloc(dev->tx_req_bufsize,
						GFP_ATOMIC);
			req->buf = kzalloc(dev->tx_req_bufsize
				+ dev->gadget->extra_buf_alloc, GFP_ATOMIC);
			if (!req->buf)
				goto free_buf;
		}