|
@@ -48,6 +48,11 @@
|
|
|
|
|
|
#define UETH__VERSION "29-May-2008"
|
|
#define UETH__VERSION "29-May-2008"
|
|
|
|
|
|
|
|
+/* Experiments show that both Linux and Windows hosts allow up to 16k
|
|
|
|
+ * frame sizes. Set the max size to 15k+52 to prevent allocating 32k
|
|
|
|
+ * blocks and still have efficient handling. */
|
|
|
|
+#define GETHER_MAX_ETH_FRAME_LEN 15412
|
|
|
|
+
|
|
struct eth_dev {
|
|
struct eth_dev {
|
|
/* lock is held while accessing port_usb
|
|
/* lock is held while accessing port_usb
|
|
*/
|
|
*/
|
|
@@ -146,7 +151,7 @@ static int ueth_change_mtu(struct net_device *net, int new_mtu)
|
|
spin_lock_irqsave(&dev->lock, flags);
|
|
spin_lock_irqsave(&dev->lock, flags);
|
|
if (dev->port_usb)
|
|
if (dev->port_usb)
|
|
status = -EBUSY;
|
|
status = -EBUSY;
|
|
- else if (new_mtu <= ETH_HLEN || new_mtu > ETH_FRAME_LEN)
|
|
|
|
|
|
+ else if (new_mtu <= ETH_HLEN || new_mtu > GETHER_MAX_ETH_FRAME_LEN)
|
|
status = -ERANGE;
|
|
status = -ERANGE;
|
|
else
|
|
else
|
|
net->mtu = new_mtu;
|
|
net->mtu = new_mtu;
|
|
@@ -294,7 +299,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)
|
|
while (skb2) {
|
|
while (skb2) {
|
|
if (status < 0
|
|
if (status < 0
|
|
|| ETH_HLEN > skb2->len
|
|
|| ETH_HLEN > skb2->len
|
|
- || skb2->len > VLAN_ETH_FRAME_LEN) {
|
|
|
|
|
|
+ || skb2->len > GETHER_MAX_ETH_FRAME_LEN) {
|
|
dev->net->stats.rx_errors++;
|
|
dev->net->stats.rx_errors++;
|
|
dev->net->stats.rx_length_errors++;
|
|
dev->net->stats.rx_length_errors++;
|
|
DBG(dev, "rx length %d\n", skb2->len);
|
|
DBG(dev, "rx length %d\n", skb2->len);
|