Subject: Re: softmac mtu

From: matthieu castet <[email-masked]>
Date: Wed, 27 Sep 2006 19:17:09 +0200

Johannes Berg wrote:
> On Wed, 2006-09-27 at 15:57 +0200, [email-masked] wrote:
> 
> 
>>Also I wonder what should be the max mtu.
> 
> 
> 2304, I think, as that's
> synonym sMaxMsduLng Integer = 2304; /* max octets in an MSDU */
> 

Yes but if it is bigger the frame get framented at the 802.11 layer : in 
theory we could put mtu (IP max packet size) a big as we want [1].
Also if I understand it correctly if encryption is used there is less 
space for IP data ?

If people want to play with it, I attach the current version of my 
(trivial) patch.

Matthieu

[1]
if mtu > 2304, (struct ieee80211_txb*)->nr_frags is bigger than one ;)
Index: linux/net/ieee80211/ieee80211_module.c
===================================================================
--- linux.orig/net/ieee80211/ieee80211_module.c	2006-09-25 22:37:20.000000000 +0200
+++ linux/net/ieee80211/ieee80211_module.c	2006-09-25 22:39:07.000000000 +0200
@@ -118,6 +118,14 @@
 			      &ieee->network_free_list);
 }
 
+static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
+{
+	if ((new_mtu < 68) || (new_mtu > 2400))
+		return -EINVAL;
+	dev->mtu = new_mtu;
+	return 0;
+}
+
 struct net_device *alloc_ieee80211(int sizeof_priv)
 {
 	struct ieee80211_device *ieee;
@@ -133,6 +141,7 @@
 	}
 	ieee = netdev_priv(dev);
 	dev->hard_start_xmit = ieee80211_xmit;
+	dev->change_mtu = ieee80211_change_mtu;
 
 	ieee->dev = dev;