diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/mesh.c | 14 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 38 | ||||
-rw-r--r-- | net/wireless/nl80211.h | 4 |
3 files changed, 56 insertions, 0 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index e0226e8265a3..5c116083eeca 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/ieee80211.h> | 1 | #include <linux/ieee80211.h> |
2 | #include <net/cfg80211.h> | 2 | #include <net/cfg80211.h> |
3 | #include "nl80211.h" | ||
3 | #include "core.h" | 4 | #include "core.h" |
4 | 5 | ||
5 | /* Default values, timeouts in ms */ | 6 | /* Default values, timeouts in ms */ |
@@ -110,6 +111,19 @@ int cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
110 | return err; | 111 | return err; |
111 | } | 112 | } |
112 | 113 | ||
114 | void cfg80211_notify_new_peer_candidate(struct net_device *dev, | ||
115 | const u8 *macaddr, const u8* ie, u8 ie_len, gfp_t gfp) | ||
116 | { | ||
117 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
118 | |||
119 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_MESH_POINT)) | ||
120 | return; | ||
121 | |||
122 | nl80211_send_new_peer_candidate(wiphy_to_dev(wdev->wiphy), dev, | ||
123 | macaddr, ie, ie_len, gfp); | ||
124 | } | ||
125 | EXPORT_SYMBOL(cfg80211_notify_new_peer_candidate); | ||
126 | |||
113 | static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev, | 127 | static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev, |
114 | struct net_device *dev) | 128 | struct net_device *dev) |
115 | { | 129 | { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f4cb8efe2e5f..58f501a35022 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5818,6 +5818,44 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev, | |||
5818 | nlmsg_free(msg); | 5818 | nlmsg_free(msg); |
5819 | } | 5819 | } |
5820 | 5820 | ||
5821 | void nl80211_send_new_peer_candidate(struct cfg80211_registered_device *rdev, | ||
5822 | struct net_device *netdev, | ||
5823 | const u8 *macaddr, const u8* ie, u8 ie_len, | ||
5824 | gfp_t gfp) | ||
5825 | { | ||
5826 | struct sk_buff *msg; | ||
5827 | void *hdr; | ||
5828 | |||
5829 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); | ||
5830 | if (!msg) | ||
5831 | return; | ||
5832 | |||
5833 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_NEW_PEER_CANDIDATE); | ||
5834 | if (!hdr) { | ||
5835 | nlmsg_free(msg); | ||
5836 | return; | ||
5837 | } | ||
5838 | |||
5839 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); | ||
5840 | NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); | ||
5841 | NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, macaddr); | ||
5842 | if (ie_len && ie) | ||
5843 | NLA_PUT(msg, NL80211_ATTR_IE, ie_len , ie); | ||
5844 | |||
5845 | if (genlmsg_end(msg, hdr) < 0) { | ||
5846 | nlmsg_free(msg); | ||
5847 | return; | ||
5848 | } | ||
5849 | |||
5850 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | ||
5851 | nl80211_mlme_mcgrp.id, gfp); | ||
5852 | return; | ||
5853 | |||
5854 | nla_put_failure: | ||
5855 | genlmsg_cancel(msg, hdr); | ||
5856 | nlmsg_free(msg); | ||
5857 | } | ||
5858 | |||
5821 | void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, | 5859 | void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, |
5822 | struct net_device *netdev, const u8 *addr, | 5860 | struct net_device *netdev, const u8 *addr, |
5823 | enum nl80211_key_type key_type, int key_id, | 5861 | enum nl80211_key_type key_type, int key_id, |
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index dcac5cd6f017..f2af6955a665 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h | |||
@@ -50,6 +50,10 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, | |||
50 | struct net_device *netdev, u16 reason, | 50 | struct net_device *netdev, u16 reason, |
51 | const u8 *ie, size_t ie_len, bool from_ap); | 51 | const u8 *ie, size_t ie_len, bool from_ap); |
52 | 52 | ||
53 | void nl80211_send_new_peer_candidate(struct cfg80211_registered_device *rdev, | ||
54 | struct net_device *netdev, | ||
55 | const u8 *macaddr, const u8* ie, u8 ie_len, | ||
56 | gfp_t gfp); | ||
53 | void | 57 | void |
54 | nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, | 58 | nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, |
55 | struct net_device *netdev, const u8 *addr, | 59 | struct net_device *netdev, const u8 *addr, |