dm9601: fix reception of full size ethernet frames on dm9620/dm9621a
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 16 Dec 2013 10:35:33 +0000 (11:35 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Dec 2013 22:46:55 +0000 (17:46 -0500)
dm9620/dm9621a require room for 4 byte padding even in dm9601 (3 byte
header) mode.

Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/dm9601.c

index 8e885729aa288eec416f2988f060c6eda5fd004a..aca0285d18bfeff6f0879f0570c5f2d2b2a723c3 100644 (file)
@@ -364,7 +364,12 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
        dev->net->ethtool_ops = &dm9601_ethtool_ops;
        dev->net->hard_header_len += DM_TX_OVERHEAD;
        dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
        dev->net->ethtool_ops = &dm9601_ethtool_ops;
        dev->net->hard_header_len += DM_TX_OVERHEAD;
        dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
-       dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD;
+
+       /* dm9620/21a require room for 4 byte padding, even in dm9601
+        * mode, so we need +1 to be able to receive full size
+        * ethernet frames.
+        */
+       dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1;
 
        dev->mii.dev = dev->net;
        dev->mii.mdio_read = dm9601_mdio_read;
 
        dev->mii.dev = dev->net;
        dev->mii.mdio_read = dm9601_mdio_read;