aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-09-16 11:56:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-19 16:10:14 -0400
commitc9df56b48e4ff003eaebd680ec7a45342dcd03ea (patch)
treeb943ce5010290a4979a1488d791a5e6663db02a4 /net/wireless
parent2981808269941490f209b2db88ae021d7007b39d (diff)
cfg80211/nl80211: Add PMKSA caching candidate event
When the driver (or most likely firmware) decides which AP to use for roaming based on internal scan result processing, user space needs to be notified of PMKSA caching candidates to allow RSN pre-authentication to be used. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/mlme.c11
-rw-r--r--net/wireless/nl80211.c46
-rw-r--r--net/wireless/nl80211.h4
3 files changed, 61 insertions, 0 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 832f6574e4ed..61adea540e02 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -1095,3 +1095,14 @@ void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
1095 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp); 1095 nl80211_gtk_rekey_notify(rdev, dev, bssid, replay_ctr, gfp);
1096} 1096}
1097EXPORT_SYMBOL(cfg80211_gtk_rekey_notify); 1097EXPORT_SYMBOL(cfg80211_gtk_rekey_notify);
1098
1099void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
1100 const u8 *bssid, bool preauth, gfp_t gfp)
1101{
1102 struct wireless_dev *wdev = dev->ieee80211_ptr;
1103 struct wiphy *wiphy = wdev->wiphy;
1104 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
1105
1106 nl80211_pmksa_candidate_notify(rdev, dev, index, bssid, preauth, gfp);
1107}
1108EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 430b432bc3f0..3c6427abdf34 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7270,6 +7270,52 @@ void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
7270 nlmsg_free(msg); 7270 nlmsg_free(msg);
7271} 7271}
7272 7272
7273void nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
7274 struct net_device *netdev, int index,
7275 const u8 *bssid, bool preauth, gfp_t gfp)
7276{
7277 struct sk_buff *msg;
7278 struct nlattr *attr;
7279 void *hdr;
7280
7281 msg = nlmsg_new(NLMSG_GOODSIZE, gfp);
7282 if (!msg)
7283 return;
7284
7285 hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_PMKSA_CANDIDATE);
7286 if (!hdr) {
7287 nlmsg_free(msg);
7288 return;
7289 }
7290
7291 NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
7292 NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex);
7293
7294 attr = nla_nest_start(msg, NL80211_ATTR_PMKSA_CANDIDATE);
7295 if (!attr)
7296 goto nla_put_failure;
7297
7298 NLA_PUT_U32(msg, NL80211_PMKSA_CANDIDATE_INDEX, index);
7299 NLA_PUT(msg, NL80211_PMKSA_CANDIDATE_BSSID, ETH_ALEN, bssid);
7300 if (preauth)
7301 NLA_PUT_FLAG(msg, NL80211_PMKSA_CANDIDATE_PREAUTH);
7302
7303 nla_nest_end(msg, attr);
7304
7305 if (genlmsg_end(msg, hdr) < 0) {
7306 nlmsg_free(msg);
7307 return;
7308 }
7309
7310 genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
7311 nl80211_mlme_mcgrp.id, gfp);
7312 return;
7313
7314 nla_put_failure:
7315 genlmsg_cancel(msg, hdr);
7316 nlmsg_free(msg);
7317}
7318
7273void 7319void
7274nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev, 7320nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev,
7275 struct net_device *netdev, const u8 *peer, 7321 struct net_device *netdev, const u8 *peer,
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index 5d69c56400ae..f24a1fbeaf19 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -113,4 +113,8 @@ void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
113 struct net_device *netdev, const u8 *bssid, 113 struct net_device *netdev, const u8 *bssid,
114 const u8 *replay_ctr, gfp_t gfp); 114 const u8 *replay_ctr, gfp_t gfp);
115 115
116void nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
117 struct net_device *netdev, int index,
118 const u8 *bssid, bool preauth, gfp_t gfp);
119
116#endif /* __NET_WIRELESS_NL80211_H */ 120#endif /* __NET_WIRELESS_NL80211_H */