All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: usb: cdc_eem: fix mtu
@ 2012-03-29 17:15 Rabin Vincent
  2012-04-02  3:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Rabin Vincent @ 2012-03-29 17:15 UTC (permalink / raw)
  To: oliver-Q6YOFhsQ4GZ7tPAFqOLdPg
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Rabin Vincent

Make CDC EEM recalculate the hard_mtu after adjusting the
hard_header_len.

Without this, usbnet adjusts the MTU down to 1494 bytes, and the host is
unable to receive standard 1500-byte frames from the device.

Tested with the Linux USB Ethernet gadget.

Cc: Oliver Neukum <oliver-Q6YOFhsQ4GZ7tPAFqOLdPg@public.gmane.org>
Signed-off-by: Rabin Vincent <rabin-66gdRtMMWGc@public.gmane.org>
---
 drivers/net/usb/cdc_eem.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 882f53f..82d43b2 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -93,6 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
 	/* no jumbogram (16K) support for now */
 
 	dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
+	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
 
 	return 0;
 }
-- 
1.7.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: usb: cdc_eem: fix mtu
  2012-03-29 17:15 [PATCH] net: usb: cdc_eem: fix mtu Rabin Vincent
@ 2012-04-02  3:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-04-02  3:33 UTC (permalink / raw)
  To: rabin; +Cc: oliver, linux-usb, netdev

From: Rabin Vincent <rabin@rab.in>
Date: Thu, 29 Mar 2012 22:45:15 +0530

> Make CDC EEM recalculate the hard_mtu after adjusting the
> hard_header_len.
> 
> Without this, usbnet adjusts the MTU down to 1494 bytes, and the host is
> unable to receive standard 1500-byte frames from the device.
> 
> Tested with the Linux USB Ethernet gadget.
> 
> Cc: Oliver Neukum <oliver@neukum.name>
> Signed-off-by: Rabin Vincent <rabin@rab.in>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-02  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 17:15 [PATCH] net: usb: cdc_eem: fix mtu Rabin Vincent
2012-04-02  3:33 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.