From 359208a01aec4c9640204b913ae46d3ccb7e109e Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Sat, 15 Jun 2019 23:11:34 +0800 Subject: [PATCH] moto_f_usbnet: increase usbnet transport speed Enlarge USB MTU and tx/rx bulk size to 10 times of its original size. The kernel version may not support member max_mtu in net_device so remove the code to set the max_mtu to avoid compile issue on some kernel version. Change-Id: I2756a7153e9211e2560d0efa186466095a17d271 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/1371702 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianhong Wang Reviewed-by: Zonghua Liu Reviewed-by: Jianqi Yang Reviewed-by: Yuecai Liu Submit-Approved: Jira Key --- drivers/moto_f_usbnet/f_usbnet.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/moto_f_usbnet/f_usbnet.c b/drivers/moto_f_usbnet/f_usbnet.c index 55d9ce884b89..553d2a851963 100644 --- a/drivers/moto_f_usbnet/f_usbnet.c +++ b/drivers/moto_f_usbnet/f_usbnet.c @@ -49,10 +49,10 @@ #define USBNET_SET_HOST_IP 0x07 /* Linux Network Interface */ -#define USB_MTU 1536 -#define MAX_BULK_TX_REQ_NUM 8 -#define MAX_BULK_RX_REQ_NUM 8 -#define MAX_INTR_RX_REQ_NUM 8 +#define USB_MTU 15360 +#define MAX_BULK_TX_REQ_NUM 80 +#define MAX_BULK_RX_REQ_NUM 80 +#define MAX_INTR_RX_REQ_NUM 80 #define INTERFACE_STRING_INDEX 0 struct usbnet_context { @@ -967,6 +967,7 @@ static struct usb_function_instance *usbnet_alloc_inst(void) return ERR_PTR(-ENOMEM); } + net_dev->mtu = 15000; ret = register_netdev(net_dev); if (ret) { pr_err("%s: register_netdev error\n", __func__);