aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBeni Lev <beni.lev@intel.com>2016-02-17 13:30:00 -0500
committerJohannes Berg <johannes.berg@intel.com>2016-02-24 03:04:41 -0500
commit0c9ca11b1ae8eb16c1b6bbae91991392d2321372 (patch)
tree546c9155db103c7127aba6f04a66cd87101cc6d0
parentb5a33d52595f0cb153f09bf45a5dcd66a7418dbb (diff)
cfg80211: Add global RRM capability
Today, the supplicant will add the RRM capabilities Information Element in the association request only if Quiet period is supported (NL80211_FEATURE_QUIET). Quiet is one of many RRM features, and there are other RRM features that are not related to Quiet (e.g. neighbor report). Therefore, requiring Quiet to enable RRM is too restrictive. Some of the features, like neighbor report, can be supported by user space without any help from the kernel. Hence adding the RRM capabilities IE to association request should be the sole user space's decision. Removing the RRM dependency on Quiet in the driver solves this problem, but using an old driver with a user space tool that would not require Quiet feature would be problematic: the user space would add NL80211_ATTR_USE_RRM in the association request even if the kernel doesn't advertize NL80211_FEATURE_QUIET and the association would be denied by the kernel. This solution adds a global RRM capability, that tells user space that it can request RRM capabilities IE publishment without any specific feature support in the kernel. Signed-off-by: Beni Lev <beni.lev@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/uapi/linux/nl80211.h8
-rw-r--r--net/wireless/nl80211.c18
2 files changed, 19 insertions, 7 deletions
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 7758969a2a8e..5a30a7563633 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1727,6 +1727,8 @@ enum nl80211_commands {
1727 * underlying device supports these minimal RRM features: 1727 * underlying device supports these minimal RRM features:
1728 * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES, 1728 * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
1729 * %NL80211_FEATURE_QUIET, 1729 * %NL80211_FEATURE_QUIET,
1730 * Or, if global RRM is supported, see:
1731 * %NL80211_EXT_FEATURE_RRM
1730 * If this flag is used, driver must add the Power Capabilities IE to the 1732 * If this flag is used, driver must add the Power Capabilities IE to the
1731 * association request. In addition, it must also set the RRM capability 1733 * association request. In addition, it must also set the RRM capability
1732 * flag in the association request's Capability Info field. 1734 * flag in the association request's Capability Info field.
@@ -4402,12 +4404,18 @@ enum nl80211_feature_flags {
4402/** 4404/**
4403 * enum nl80211_ext_feature_index - bit index of extended features. 4405 * enum nl80211_ext_feature_index - bit index of extended features.
4404 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. 4406 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
4407 * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
4408 * can request to use RRM (see %NL80211_ATTR_USE_RRM) with
4409 * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
4410 * the ASSOC_REQ_USE_RRM flag in the association request even if
4411 * NL80211_FEATURE_QUIET is not advertized.
4405 * 4412 *
4406 * @NUM_NL80211_EXT_FEATURES: number of extended features. 4413 * @NUM_NL80211_EXT_FEATURES: number of extended features.
4407 * @MAX_NL80211_EXT_FEATURES: highest extended feature index. 4414 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
4408 */ 4415 */
4409enum nl80211_ext_feature_index { 4416enum nl80211_ext_feature_index {
4410 NL80211_EXT_FEATURE_VHT_IBSS, 4417 NL80211_EXT_FEATURE_VHT_IBSS,
4418 NL80211_EXT_FEATURE_RRM,
4411 4419
4412 /* add new features before the definition below */ 4420 /* add new features before the definition below */
4413 NUM_NL80211_EXT_FEATURES, 4421 NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 268cb493f6a5..90890f183c0e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 4 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
5 * Copyright 2013-2014 Intel Mobile Communications GmbH 5 * Copyright 2013-2014 Intel Mobile Communications GmbH
6 * Copyright 2015 Intel Deutschland GmbH 6 * Copyright 2015-2016 Intel Deutschland GmbH
7 */ 7 */
8 8
9#include <linux/if.h> 9#include <linux/if.h>
@@ -7286,9 +7286,11 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
7286 } 7286 }
7287 7287
7288 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) { 7288 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) {
7289 if (!(rdev->wiphy.features & 7289 if (!((rdev->wiphy.features &
7290 NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) || 7290 NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) &&
7291 !(rdev->wiphy.features & NL80211_FEATURE_QUIET)) 7291 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
7292 !wiphy_ext_feature_isset(&rdev->wiphy,
7293 NL80211_EXT_FEATURE_RRM))
7292 return -EINVAL; 7294 return -EINVAL;
7293 req.flags |= ASSOC_REQ_USE_RRM; 7295 req.flags |= ASSOC_REQ_USE_RRM;
7294 } 7296 }
@@ -7976,9 +7978,11 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
7976 } 7978 }
7977 7979
7978 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) { 7980 if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) {
7979 if (!(rdev->wiphy.features & 7981 if (!((rdev->wiphy.features &
7980 NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) || 7982 NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) &&
7981 !(rdev->wiphy.features & NL80211_FEATURE_QUIET)) { 7983 (rdev->wiphy.features & NL80211_FEATURE_QUIET)) &&
7984 !wiphy_ext_feature_isset(&rdev->wiphy,
7985 NL80211_EXT_FEATURE_RRM)) {
7982 kzfree(connkeys); 7986 kzfree(connkeys);
7983 return -EINVAL; 7987 return -EINVAL;
7984 } 7988 }