diff mbox

net: usb: cdc_eem: fix mtu

Message ID 1333041315-4303-1-git-send-email-rabin@rab.in
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Rabin Vincent March 29, 2012, 5:15 p.m. UTC
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>
---
 drivers/net/usb/cdc_eem.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

David Miller April 2, 2012, 3:33 a.m. UTC | #1
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }