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

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

USB: f_rmnet: 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: Ie572b5222f7bdc66774db86efac64e697dcdcdd2
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 432006ed
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -332,7 +332,8 @@ int name_to_prot(struct f_rmnet *dev, const char *name)
}

static struct usb_request *
frmnet_alloc_req(struct usb_ep *ep, unsigned int len, gfp_t flags)
frmnet_alloc_req(struct usb_ep *ep, unsigned int len, size_t extra_buf_alloc,
		gfp_t flags)
{
	struct usb_request *req;

@@ -340,7 +341,7 @@ frmnet_alloc_req(struct usb_ep *ep, unsigned int len, gfp_t flags)
	if (!req)
		return ERR_PTR(-ENOMEM);

	req->buf = kmalloc(len, flags);
	req->buf = kmalloc(len + extra_buf_alloc, flags);
	if (!req->buf) {
		usb_ep_free_request(ep, req);
		return ERR_PTR(-ENOMEM);
@@ -1014,6 +1015,7 @@ static int ipa_update_function_bind_params(struct f_rmnet *dev,
		ep->driver_data = cdev;
		dev->notify_req = frmnet_alloc_req(ep,
				sizeof(struct usb_cdc_notification),
				cdev->gadget->extra_buf_alloc,
				GFP_KERNEL);
		if (IS_ERR(dev->notify_req)) {
			pr_err("%s: unable to allocate memory for notify req\n",