aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2011-04-07 18:08:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-12 16:57:39 -0400
commitc93b5e717ec47b57abfe0229360bc11e77520984 (patch)
tree1e6f703c3c1b1c2e55b759b4e992ef04e81f973e /net/wireless/nl80211.c
parent96b78dff0321d881ef27d858a462c476e0444619 (diff)
nl80211: New notification to discover mesh peer candidates.
Notify userspace when a beacon/presp is received from a suitable mesh peer candidate for whom no sta information exists. Userspace can then decide to create a sta info for the candidate. If userspace is not ready to authenticate the peer right away, it can create the sta info with the authenticated flag unset and set it later. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c38
1 files changed, 38 insertions, 0 deletions
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
5821void 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
5821void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, 5859void 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,