]> Pileus Git - ~andy/linux/blobdiff - net/wireless/mesh.c
Merge branch 'for-paul' of git://gitorious.org/linux-omap-dss2/linux
[~andy/linux] / net / wireless / mesh.c
index 0d4b2260f96fe5eb577165c7409473f488734196..5c116083eeca7f99c28b9f8e9835a5d32e0e24db 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/ieee80211.h>
 #include <net/cfg80211.h>
+#include "nl80211.h"
 #include "core.h"
 
 /* Default values, timeouts in ms */
@@ -55,6 +56,7 @@ const struct mesh_setup default_mesh_setup = {
        .path_metric = IEEE80211_PATH_METRIC_AIRTIME,
        .ie = NULL,
        .ie_len = 0,
+       .is_secure = false,
 };
 
 int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
@@ -72,6 +74,10 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
        if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT)
                return -EOPNOTSUPP;
 
+       if (!(rdev->wiphy.flags & WIPHY_FLAG_MESH_AUTH) &&
+             setup->is_secure)
+               return -EOPNOTSUPP;
+
        if (wdev->mesh_id_len)
                return -EALREADY;
 
@@ -105,6 +111,19 @@ int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
        return err;
 }
 
+void cfg80211_notify_new_peer_candidate(struct net_device *dev,
+               const u8 *macaddr, const u8* ie, u8 ie_len, gfp_t gfp)
+{
+       struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+       if (WARN_ON(wdev->iftype != NL80211_IFTYPE_MESH_POINT))
+               return;
+
+       nl80211_send_new_peer_candidate(wiphy_to_dev(wdev->wiphy), dev,
+                       macaddr, ie, ie_len, gfp);
+}
+EXPORT_SYMBOL(cfg80211_notify_new_peer_candidate);
+
 static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
                                 struct net_device *dev)
 {