From 5cf94796ec67e08d77e0e6d91e19ee2a083228f3 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Thu, 18 Sep 2014 10:48:48 -0700 Subject: [PATCH] ndis: Add debug support to disable RNDIS Multipacket Feature This change adds module param which allows to disable RNDIS Multi-packet Feature (Aggregation support in Downlink path) as this feature is enabled by default. To disable use this param before moving to RNDIS Composition: echo 1 > /sys/module/g_android/parameters/rndis_multipacket_dl_disable Also counts errors as Rx errors if received RNDIS packets are not following RNDIS message format as those packets are being discarded. Change-Id: I764430da78f2204af92e14bb279c11b24c7e4c67 Signed-off-by: Mayank Rana --- drivers/usb/gadget/f_rndis.c | 2 ++ drivers/usb/gadget/u_ether.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 130efdfa7881..a0240195b46a 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c @@ -477,6 +477,8 @@ static void rndis_command_complete(struct usb_ep *ep, struct usb_request *req) __func__, buf->MaxTransferSize, rndis->port.multi_pkt_xfer ? "enabled" : "disabled"); + if (rndis_multipacket_dl_disable) + rndis->port.multi_pkt_xfer = 0; } // spin_unlock(&dev->lock); } diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 9705c2bb15fb..ff26f5c2d38e 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -292,6 +292,10 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req) status = dev->unwrap(dev->port_usb, skb, &dev->rx_frames); + if (status == -EINVAL) + dev->net->stats.rx_errors++; + else if (status == -EOVERFLOW) + dev->net->stats.rx_over_errors++; } else { dev_kfree_skb_any(skb); status = -ENOTCONN; -- 2.34.1