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

Commit f6629052 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
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>
parent 2c82dc59
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -253,7 +253,8 @@ static inline struct f_rmnet *port_to_rmnet(struct grmnet *r)
}

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

@@ -261,7 +262,7 @@ frmnet_alloc_req(struct usb_ep *ep, unsigned 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);
@@ -1175,6 +1176,7 @@ static int frmnet_bind(struct usb_configuration *c, struct usb_function *f)

	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",