diff options
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 38 |
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 | ||
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, |