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

Commit 7cf69aa8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: f_diag: Report max request size handled by controller"

parents 4b073182 d0ad31ec
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -424,6 +424,27 @@ fail:
}
EXPORT_SYMBOL(usb_diag_alloc_req);

#define DWC3_MAX_REQUEST_SIZE (1024 * 1024)
#define CI_MAX_REQUEST_SIZE   (16 * 1024)
/**
 * usb_diag_request_size - Max request size for controller
 * @ch: Channel handler
 *
 * Infom max request size so that diag driver can split packets
 * in chunks of max size which controller can handle.
 */
int usb_diag_request_size(struct usb_diag_ch *ch)
{
	struct diag_context *ctxt = ch->priv_usb;
	struct usb_composite_dev *cdev = ctxt->cdev;

	if (gadget_is_dwc3(cdev->gadget))
		return DWC3_MAX_REQUEST_SIZE;
	else
		return CI_MAX_REQUEST_SIZE;
}
EXPORT_SYMBOL(usb_diag_request_size);

/**
 * usb_diag_read() - Read data from USB diag channel
 * @ch: Channel handler
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ struct usb_diag_ch {
};

#ifdef CONFIG_USB_G_ANDROID
int usb_diag_request_size(struct usb_diag_ch *ch);
struct usb_diag_ch *usb_diag_open(const char *name, void *priv,
		void (*notify)(void *, unsigned, struct diag_request *));
void usb_diag_close(struct usb_diag_ch *ch);