aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-13 04:48:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-15 13:38:28 -0400
commit77dbbb138986b26cb99f868d4b6410577ef4c040 (patch)
treee3f4f9a2bb6b36938e3b221f4f0ee2e74d1ab238 /net/wireless/nl80211.c
parent95acac61ba66c4abd40e038dae8c1ed2e176c7b1 (diff)
nl80211: advertise GTK rekey support, new triggers
Since we now have the necessary API in place to support GTK rekeying, applications will need to know whether it is supported by a device. Add a pseudo-trigger that is used only to advertise that capability. Also, add some new triggers that match what iwlagn devices can do. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 6a82c898f831..a2e1e49c9196 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -205,6 +205,10 @@ nl80211_wowlan_policy[NUM_NL80211_WOWLAN_TRIG] = {
205 [NL80211_WOWLAN_TRIG_DISCONNECT] = { .type = NLA_FLAG }, 205 [NL80211_WOWLAN_TRIG_DISCONNECT] = { .type = NLA_FLAG },
206 [NL80211_WOWLAN_TRIG_MAGIC_PKT] = { .type = NLA_FLAG }, 206 [NL80211_WOWLAN_TRIG_MAGIC_PKT] = { .type = NLA_FLAG },
207 [NL80211_WOWLAN_TRIG_PKT_PATTERN] = { .type = NLA_NESTED }, 207 [NL80211_WOWLAN_TRIG_PKT_PATTERN] = { .type = NLA_NESTED },
208 [NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE] = { .type = NLA_FLAG },
209 [NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST] = { .type = NLA_FLAG },
210 [NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE] = { .type = NLA_FLAG },
211 [NL80211_WOWLAN_TRIG_RFKILL_RELEASE] = { .type = NLA_FLAG },
208}; 212};
209 213
210/* policy for GTK rekey offload attributes */ 214/* policy for GTK rekey offload attributes */
@@ -929,6 +933,16 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
929 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT); 933 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT);
930 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_MAGIC_PKT) 934 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_MAGIC_PKT)
931 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT); 935 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT);
936 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)
937 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED);
938 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE)
939 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE);
940 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ)
941 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST);
942 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_4WAY_HANDSHAKE)
943 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE);
944 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_RFKILL_RELEASE)
945 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE);
932 if (dev->wiphy.wowlan.n_patterns) { 946 if (dev->wiphy.wowlan.n_patterns) {
933 struct nl80211_wowlan_pattern_support pat = { 947 struct nl80211_wowlan_pattern_support pat = {
934 .max_patterns = dev->wiphy.wowlan.n_patterns, 948 .max_patterns = dev->wiphy.wowlan.n_patterns,
@@ -5272,6 +5286,14 @@ static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info)
5272 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT); 5286 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT);
5273 if (rdev->wowlan->magic_pkt) 5287 if (rdev->wowlan->magic_pkt)
5274 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT); 5288 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT);
5289 if (rdev->wowlan->gtk_rekey_failure)
5290 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE);
5291 if (rdev->wowlan->eap_identity_req)
5292 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST);
5293 if (rdev->wowlan->four_way_handshake)
5294 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE);
5295 if (rdev->wowlan->rfkill_release)
5296 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE);
5275 if (rdev->wowlan->n_patterns) { 5297 if (rdev->wowlan->n_patterns) {
5276 struct nlattr *nl_pats, *nl_pat; 5298 struct nlattr *nl_pats, *nl_pat;
5277 int i, pat_len; 5299 int i, pat_len;
@@ -5348,6 +5370,33 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
5348 new_triggers.magic_pkt = true; 5370 new_triggers.magic_pkt = true;
5349 } 5371 }
5350 5372
5373 if (tb[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED])
5374 return -EINVAL;
5375
5376 if (tb[NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE]) {
5377 if (!(wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE))
5378 return -EINVAL;
5379 new_triggers.gtk_rekey_failure = true;
5380 }
5381
5382 if (tb[NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST]) {
5383 if (!(wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ))
5384 return -EINVAL;
5385 new_triggers.eap_identity_req = true;
5386 }
5387
5388 if (tb[NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE]) {
5389 if (!(wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE))
5390 return -EINVAL;
5391 new_triggers.four_way_handshake = true;
5392 }
5393
5394 if (tb[NL80211_WOWLAN_TRIG_RFKILL_RELEASE]) {
5395 if (!(wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE))
5396 return -EINVAL;
5397 new_triggers.rfkill_release = true;
5398 }
5399
5351 if (tb[NL80211_WOWLAN_TRIG_PKT_PATTERN]) { 5400 if (tb[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
5352 struct nlattr *pat; 5401 struct nlattr *pat;
5353 int n_patterns = 0; 5402 int n_patterns = 0;