Patchwork [2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs

login
register
mail settings
Submitter Ian Coolidge
Date Nov. 6, 2012, 9 p.m.
Message ID <1352235611-13066-3-git-send-email-iancoolidge@gmail.com>
Download mbox | patch
Permalink /patch/197543/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Ian Coolidge - Nov. 6, 2012, 9 p.m.
cdc_eem frames might need to contain 802.1Q VLAN Ethernet frames.
Provide this information as an override to usbnet->rx_urb_size

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
---
 drivers/net/usb/cdc_eem.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 439690b..63c38dc 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -31,6 +31,7 @@ 
 #include <linux/usb/cdc.h>
 #include <linux/usb/usbnet.h>
 #include <linux/gfp.h>
+#include <linux/if_vlan.h>
 
 
 /*
@@ -94,6 +95,9 @@  static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
 
 	dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
 
+	/* octets we need to rx for a single ethernet frame */
+	dev->rx_urb_size = EEM_HEAD + ETH_FCS_LEN + VLAN_ETH_FRAME_LEN;
+
 	return 0;
 }