ChangeSet 1.1006.4.24, 2003/03/05 22:12:42-08:00, okurth@gmx.net

[PATCH] USB: MTU patch for kaweth

Recently, I had problems using NFS with my kaweth device, tcpdump showed
fragmented packages. The reason, I found, was the MTU, which is 1514
by default for kaweth. Setting it to 1500 solved the problems. The
attached patch sets the MTU to 1500 by default.


 drivers/usb/kaweth.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/kaweth.c b/drivers/usb/kaweth.c
--- a/drivers/usb/kaweth.c	Thu Mar 27 16:02:55 2003
+++ b/drivers/usb/kaweth.c	Thu Mar 27 16:02:55 2003
@@ -74,7 +74,7 @@
 
 #include "kawethfw.h"
 
-#define KAWETH_MTU			1514
+#define KAWETH_MTU			1500
 #define KAWETH_BUF_SIZE			1664
 #define KAWETH_TX_TIMEOUT		(5 * HZ)
 #define KAWETH_SCRATCH_SIZE		32
@@ -1036,7 +1036,8 @@
 	kaweth->net->hard_start_xmit = kaweth_start_xmit;
 	kaweth->net->set_multicast_list = kaweth_set_rx_mode;
 	kaweth->net->get_stats = kaweth_netdev_stats;
-	kaweth->net->mtu = le16_to_cpu(kaweth->configuration.segment_size);
+	kaweth->net->mtu = le16_to_cpu(kaweth->configuration.segment_size < KAWETH_MTU ?
+				       kaweth->configuration.segment_size : KAWETH_MTU);
 
 	memset(&kaweth->stats, 0, sizeof(kaweth->stats));
 
