aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@cozybit.com>2013-03-04 16:06:10 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-03-06 10:36:11 -0500
commitbb2798d45fc0575f5d08c0bb7baf4d5d5e8cc0c3 (patch)
tree258715ee28471c02b0c14e1b4c4bfeb499e5d5b1
parent2ff2b690c56588efc063288f71a9d1cea33772cb (diff)
nl80211: explicit userspace MPM
Secure mesh had the implicit requirement that the Mesh Peering Management entity be in userspace. However userspace might want to implement an open MPM as well, so specify a mesh setup parameter to indicate this. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--include/uapi/linux/nl80211.h25
-rw-r--r--net/wireless/mesh.c1
-rw-r--r--net/wireless/nl80211.c8
4 files changed, 29 insertions, 7 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index dfef0d5b5d3d..69b2b2631b9a 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1151,6 +1151,7 @@ struct mesh_config {
1151 * @ie_len: length of vendor information elements 1151 * @ie_len: length of vendor information elements
1152 * @is_authenticated: this mesh requires authentication 1152 * @is_authenticated: this mesh requires authentication
1153 * @is_secure: this mesh uses security 1153 * @is_secure: this mesh uses security
1154 * @user_mpm: userspace handles all MPM functions
1154 * @dtim_period: DTIM period to use 1155 * @dtim_period: DTIM period to use
1155 * @beacon_interval: beacon interval to use 1156 * @beacon_interval: beacon interval to use
1156 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] 1157 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
@@ -1168,6 +1169,7 @@ struct mesh_setup {
1168 u8 ie_len; 1169 u8 ie_len;
1169 bool is_authenticated; 1170 bool is_authenticated;
1170 bool is_secure; 1171 bool is_secure;
1172 bool user_mpm;
1171 u8 dtim_period; 1173 u8 dtim_period;
1172 u16 beacon_interval; 1174 u16 beacon_interval;
1173 int mcast_rate[IEEE80211_NUM_BANDS]; 1175 int mcast_rate[IEEE80211_NUM_BANDS];
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 2d0cff57ff89..8134c6a96f57 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -513,9 +513,11 @@
513 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a 513 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
514 * beacon or probe response from a compatible mesh peer. This is only 514 * beacon or probe response from a compatible mesh peer. This is only
515 * sent while no station information (sta_info) exists for the new peer 515 * sent while no station information (sta_info) exists for the new peer
516 * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set. On 516 * candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
517 * reception of this notification, userspace may decide to create a new 517 * @NL80211_MESH_SETUP_USERSPACE_AMPE, or
518 * station (@NL80211_CMD_NEW_STATION). To stop this notification from 518 * @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this
519 * notification, userspace may decide to create a new station
520 * (@NL80211_CMD_NEW_STATION). To stop this notification from
519 * reoccurring, the userspace authentication daemon may want to create the 521 * reoccurring, the userspace authentication daemon may want to create the
520 * new station with the AUTHENTICATED flag unset and maybe change it later 522 * new station with the AUTHENTICATED flag unset and maybe change it later
521 * depending on the authentication result. 523 * depending on the authentication result.
@@ -1199,10 +1201,10 @@ enum nl80211_commands {
1199 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver 1201 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
1200 * allows auth frames in a mesh to be passed to userspace for processing via 1202 * allows auth frames in a mesh to be passed to userspace for processing via
1201 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. 1203 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
1202 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as 1204 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
1203 * defined in &enum nl80211_plink_state. Used when userspace is 1205 * &enum nl80211_plink_state. Used when userspace is driving the peer link
1204 * driving the peer link management state machine. 1206 * management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or
1205 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. 1207 * @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
1206 * 1208 *
1207 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy 1209 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
1208 * capabilities, the supported WoWLAN triggers 1210 * capabilities, the supported WoWLAN triggers
@@ -2612,6 +2614,9 @@ enum nl80211_meshconf_params {
2612 * vendor specific synchronization method or disable it to use the default 2614 * vendor specific synchronization method or disable it to use the default
2613 * neighbor offset synchronization 2615 * neighbor offset synchronization
2614 * 2616 *
2617 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
2618 * implement an MPM which handles peer allocation and state.
2619 *
2615 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 2620 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2616 * 2621 *
2617 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2622 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2624,6 +2629,7 @@ enum nl80211_mesh_setup_params {
2624 NL80211_MESH_SETUP_USERSPACE_AUTH, 2629 NL80211_MESH_SETUP_USERSPACE_AUTH,
2625 NL80211_MESH_SETUP_USERSPACE_AMPE, 2630 NL80211_MESH_SETUP_USERSPACE_AMPE,
2626 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 2631 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2632 NL80211_MESH_SETUP_USERSPACE_MPM,
2627 2633
2628 /* keep last */ 2634 /* keep last */
2629 __NL80211_MESH_SETUP_ATTR_AFTER_LAST, 2635 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
@@ -3526,6 +3532,10 @@ enum nl80211_ap_sme_features {
3526 * stations the authenticated/associated bits have to be set in the mask. 3532 * stations the authenticated/associated bits have to be set in the mask.
3527 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits 3533 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
3528 * (HT40, VHT 80/160 MHz) if this flag is set 3534 * (HT40, VHT 80/160 MHz) if this flag is set
3535 * @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
3536 * Peering Management entity which may be implemented by registering for
3537 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
3538 * still generated by the driver.
3529 */ 3539 */
3530enum nl80211_feature_flags { 3540enum nl80211_feature_flags {
3531 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3541 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3544,6 +3554,7 @@ enum nl80211_feature_flags {
3544 /* bit 13 is reserved */ 3554 /* bit 13 is reserved */
3545 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, 3555 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
3546 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, 3556 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3557 NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
3547}; 3558};
3548 3559
3549/** 3560/**
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 9688b249a805..0bb93f3061a4 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -85,6 +85,7 @@ const struct mesh_setup default_mesh_setup = {
85 .ie = NULL, 85 .ie = NULL,
86 .ie_len = 0, 86 .ie_len = 0,
87 .is_secure = false, 87 .is_secure = false,
88 .user_mpm = false,
88 .beacon_interval = MESH_DEFAULT_BEACON_INTERVAL, 89 .beacon_interval = MESH_DEFAULT_BEACON_INTERVAL,
89 .dtim_period = MESH_DEFAULT_DTIM_PERIOD, 90 .dtim_period = MESH_DEFAULT_DTIM_PERIOD,
90}; 91};
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7469020175d5..bdf39836d9d8 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4618,6 +4618,7 @@ static const struct nla_policy
4618 [NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 }, 4618 [NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL] = { .type = NLA_U8 },
4619 [NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 }, 4619 [NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC] = { .type = NLA_U8 },
4620 [NL80211_MESH_SETUP_USERSPACE_AUTH] = { .type = NLA_FLAG }, 4620 [NL80211_MESH_SETUP_USERSPACE_AUTH] = { .type = NLA_FLAG },
4621 [NL80211_MESH_SETUP_USERSPACE_MPM] = { .type = NLA_FLAG },
4621 [NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY, 4622 [NL80211_MESH_SETUP_IE] = { .type = NLA_BINARY,
4622 .len = IEEE80211_MAX_DATA_LEN }, 4623 .len = IEEE80211_MAX_DATA_LEN },
4623 [NL80211_MESH_SETUP_USERSPACE_AMPE] = { .type = NLA_FLAG }, 4624 [NL80211_MESH_SETUP_USERSPACE_AMPE] = { .type = NLA_FLAG },
@@ -4756,6 +4757,7 @@ do { \
4756static int nl80211_parse_mesh_setup(struct genl_info *info, 4757static int nl80211_parse_mesh_setup(struct genl_info *info,
4757 struct mesh_setup *setup) 4758 struct mesh_setup *setup)
4758{ 4759{
4760 struct cfg80211_registered_device *rdev = info->user_ptr[0];
4759 struct nlattr *tb[NL80211_MESH_SETUP_ATTR_MAX + 1]; 4761 struct nlattr *tb[NL80211_MESH_SETUP_ATTR_MAX + 1];
4760 4762
4761 if (!info->attrs[NL80211_ATTR_MESH_SETUP]) 4763 if (!info->attrs[NL80211_ATTR_MESH_SETUP])
@@ -4792,8 +4794,14 @@ static int nl80211_parse_mesh_setup(struct genl_info *info,
4792 setup->ie = nla_data(ieattr); 4794 setup->ie = nla_data(ieattr);
4793 setup->ie_len = nla_len(ieattr); 4795 setup->ie_len = nla_len(ieattr);
4794 } 4796 }
4797 if (tb[NL80211_MESH_SETUP_USERSPACE_MPM] &&
4798 !(rdev->wiphy.features & NL80211_FEATURE_USERSPACE_MPM))
4799 return -EINVAL;
4800 setup->user_mpm = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_MPM]);
4795 setup->is_authenticated = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AUTH]); 4801 setup->is_authenticated = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AUTH]);
4796 setup->is_secure = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AMPE]); 4802 setup->is_secure = nla_get_flag(tb[NL80211_MESH_SETUP_USERSPACE_AMPE]);
4803 if (setup->is_secure)
4804 setup->user_mpm = true;
4797 4805
4798 return 0; 4806 return 0;
4799} 4807}