aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2008-02-23 09:17:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 15:30:42 -0500
commitf7a921443740d7dafc65b17aa32531730d358f50 (patch)
tree0629d16849547d50b4d37b1669841f57ee4a8700
parentc5dd9c2bd0b2422dbcd57fe8158d1d7d36c07dd9 (diff)
mac80211: complete the mesh (interface handling) code
This completes the mesh interface handling code and a few other bits about the mac80211 module. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/ieee80211.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 190917a74c3e..7106d651f4f9 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -26,6 +26,9 @@
26 26
27#include "ieee80211_i.h" 27#include "ieee80211_i.h"
28#include "ieee80211_rate.h" 28#include "ieee80211_rate.h"
29#ifdef CONFIG_MAC80211_MESH
30#include "mesh.h"
31#endif
29#include "wep.h" 32#include "wep.h"
30#include "wme.h" 33#include "wme.h"
31#include "aes_ccm.h" 34#include "aes_ccm.h"
@@ -138,9 +141,15 @@ static void ieee80211_master_set_multicast_list(struct net_device *dev)
138 141
139static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) 142static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
140{ 143{
144 int meshhdrlen;
145 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
146
147 meshhdrlen = (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) ? 5 : 0;
148
141 /* FIX: what would be proper limits for MTU? 149 /* FIX: what would be proper limits for MTU?
142 * This interface uses 802.3 frames. */ 150 * This interface uses 802.3 frames. */
143 if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6) { 151 if (new_mtu < 256 ||
152 new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) {
144 printk(KERN_WARNING "%s: invalid MTU %d\n", 153 printk(KERN_WARNING "%s: invalid MTU %d\n",
145 dev->name, new_mtu); 154 dev->name, new_mtu);
146 return -EINVAL; 155 return -EINVAL;
@@ -441,6 +450,9 @@ static int ieee80211_stop(struct net_device *dev)
441 ieee80211_configure_filter(local); 450 ieee80211_configure_filter(local);
442 netif_tx_unlock_bh(local->mdev); 451 netif_tx_unlock_bh(local->mdev);
443 break; 452 break;
453 case IEEE80211_IF_TYPE_MESH_POINT:
454 sta_info_flush(local, dev);
455 /* fall through */
444 case IEEE80211_IF_TYPE_STA: 456 case IEEE80211_IF_TYPE_STA:
445 case IEEE80211_IF_TYPE_IBSS: 457 case IEEE80211_IF_TYPE_IBSS:
446 sdata->u.sta.state = IEEE80211_DISABLED; 458 sdata->u.sta.state = IEEE80211_DISABLED;
@@ -926,6 +938,11 @@ static int __ieee80211_if_config(struct net_device *dev,
926 conf.bssid = sdata->u.sta.bssid; 938 conf.bssid = sdata->u.sta.bssid;
927 conf.ssid = sdata->u.sta.ssid; 939 conf.ssid = sdata->u.sta.ssid;
928 conf.ssid_len = sdata->u.sta.ssid_len; 940 conf.ssid_len = sdata->u.sta.ssid_len;
941#ifdef CONFIG_MAC80211_MESH
942 } else if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) {
943 conf.beacon = beacon;
944 ieee80211_start_mesh(dev);
945#endif
929 } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 946 } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) {
930 conf.ssid = sdata->u.ap.ssid; 947 conf.ssid = sdata->u.ap.ssid;
931 conf.ssid_len = sdata->u.ap.ssid_len; 948 conf.ssid_len = sdata->u.ap.ssid_len;
@@ -938,6 +955,11 @@ static int __ieee80211_if_config(struct net_device *dev,
938 955
939int ieee80211_if_config(struct net_device *dev) 956int ieee80211_if_config(struct net_device *dev)
940{ 957{
958 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
959 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
960 if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT &&
961 (local->hw.flags & IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE))
962 return ieee80211_if_config_beacon(dev);
941 return __ieee80211_if_config(dev, NULL, NULL); 963 return __ieee80211_if_config(dev, NULL, NULL);
942} 964}
943 965
@@ -1802,6 +1824,10 @@ static void __exit ieee80211_exit(void)
1802 rc80211_simple_exit(); 1824 rc80211_simple_exit();
1803 rc80211_pid_exit(); 1825 rc80211_pid_exit();
1804 1826
1827#ifdef CONFIG_MAC80211_MESH
1828 if (mesh_allocated)
1829 ieee80211s_stop();
1830#endif
1805 ieee80211_wme_unregister(); 1831 ieee80211_wme_unregister();
1806 ieee80211_debugfs_netdev_exit(); 1832 ieee80211_debugfs_netdev_exit();
1807} 1833}