Skip to contentSkip to conversation

Allow mtu bigger than 1500 for ieee80211

PATH matthieu castet 3 participants 5 messages Sep 28, 2006 – Sep 29, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi

this patch allow to set the mtu between 1500 and 2304 (max octets in an MSDU) for devices using ieee80211 linux stack.

net/ieee80211/ieee80211_module.c +9 -0
Index: linux/net/ieee80211/ieee80211_module.c
===================================================================
@@ -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 > IEEE80211_DATA_LEN))
+		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;
 
#1 lore raw

net/ieee80211/ieee80211_module.c line 124

Quoted 2 lines · matthieu castet
net/ieee80211/ieee80211_module.c +2 -0
+	if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN))
+		return -EINVAL;

What's with that lower limit, why 68?

johannes

#2 lore raw
Quoted 6 lines · Johannes Berg

net/ieee80211/ieee80211_module.c line 124

Quoted 2 lines · matthieu castet
net/ieee80211/ieee80211_module.c +2 -0
+	if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN))
+		return -EINVAL;

What's with that lower limit, why 68?

Isn't 68 the minimum MTU required by IPv4?

#3 lore raw
Quoted 9 lines · Joerg Roedel
Quoted 6 lines · Johannes Berg

net/ieee80211/ieee80211_module.c line 124

Quoted 2 lines · matthieu castet
net/ieee80211/ieee80211_module.c +2 -0
+	if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN))
+		return -EINVAL;

What's with that lower limit, why 68?

Isn't 68 the minimum MTU required by IPv4?

No idea, but shouldn't there be a named constant somewhere for that then?

johannes

#4 lore raw
Quoted 6 lines · Johannes Berg
Quoted 1 line · Joerg Roedel

Isn't 68 the minimum MTU required by IPv4?

No idea, but shouldn't there be a named constant somewhere for that then?

Maybe. Other network drivers also implement this number as a hard value in their change_mtu callback. For example, the default ethernet function is implemented this way.

Joerg