aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColleen Twitty <colleen@cozybit.com>2013-06-03 12:53:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-11 08:16:29 -0400
commit8e7c053853b7d299e8a2b8733659b0df8eee51f7 (patch)
treeeec28175ba2437205a7376db82cb0eeafdced0a7
parenta0a2af765543a96bdf188ec57dd201e708195302 (diff)
{nl,cfg}80211: make peer link expiration time configurable
If a STA has a peer that it hasn't seen any tx activity from for a certain length of time, the peer link is expired. This means the inactive STA is removed from the list of peers and that STA is not considered a peer again unless it re-peers. Previously, this inactivity time was always 30 minutes. Now, add it to the mesh configuration and allow it to be configured. Retain 30 minutes as a default value. Signed-off-by: Colleen Twitty <colleen@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--include/uapi/linux/nl80211.h5
-rw-r--r--net/wireless/mesh.c2
-rw-r--r--net/wireless/nl80211.c8
4 files changed, 18 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 855c76ccff38..31ca11672ca8 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1124,6 +1124,9 @@ struct bss_parameters {
1124 * setting for new peer links. 1124 * setting for new peer links.
1125 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake 1125 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
1126 * after transmitting its beacon. 1126 * after transmitting its beacon.
1127 * @plink_timeout: If no tx activity is seen from a STA we've established
1128 * peering with for longer than this time (in seconds), then remove it
1129 * from the STA's list of peers. Default is 30 minutes.
1127 */ 1130 */
1128struct mesh_config { 1131struct mesh_config {
1129 u16 dot11MeshRetryTimeout; 1132 u16 dot11MeshRetryTimeout;
@@ -1153,6 +1156,7 @@ struct mesh_config {
1153 u16 dot11MeshHWMPconfirmationInterval; 1156 u16 dot11MeshHWMPconfirmationInterval;
1154 enum nl80211_mesh_power_mode power_mode; 1157 enum nl80211_mesh_power_mode power_mode;
1155 u16 dot11MeshAwakeWindowDuration; 1158 u16 dot11MeshAwakeWindowDuration;
1159 u32 plink_timeout;
1156}; 1160};
1157 1161
1158/** 1162/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1f0019d4cce6..ca6facf4df0c 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2577,6 +2577,10 @@ enum nl80211_mesh_power_mode {
2577 * 2577 *
2578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) 2578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
2579 * 2579 *
2580 * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
2581 * established peering with for longer than this time (in seconds), then
2582 * remove it from the STA's list of peers. Default is 30 minutes.
2583 *
2580 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2584 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2581 */ 2585 */
2582enum nl80211_meshconf_params { 2586enum nl80211_meshconf_params {
@@ -2608,6 +2612,7 @@ enum nl80211_meshconf_params {
2608 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, 2612 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2609 NL80211_MESHCONF_POWER_MODE, 2613 NL80211_MESHCONF_POWER_MODE,
2610 NL80211_MESHCONF_AWAKE_WINDOW, 2614 NL80211_MESHCONF_AWAKE_WINDOW,
2615 NL80211_MESHCONF_PLINK_TIMEOUT,
2611 2616
2612 /* keep last */ 2617 /* keep last */
2613 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2618 __NL80211_MESHCONF_ATTR_AFTER_LAST,
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 5dfb289ab761..0daaf72e1b81 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -18,6 +18,7 @@
18#define MESH_PATH_TO_ROOT_TIMEOUT 6000 18#define MESH_PATH_TO_ROOT_TIMEOUT 6000
19#define MESH_ROOT_INTERVAL 5000 19#define MESH_ROOT_INTERVAL 5000
20#define MESH_ROOT_CONFIRMATION_INTERVAL 2000 20#define MESH_ROOT_CONFIRMATION_INTERVAL 2000
21#define MESH_DEFAULT_PLINK_TIMEOUT 1800 /* timeout in seconds */
21 22
22/* 23/*
23 * Minimum interval between two consecutive PREQs originated by the same 24 * Minimum interval between two consecutive PREQs originated by the same
@@ -75,6 +76,7 @@ const struct mesh_config default_mesh_config = {
75 .dot11MeshHWMPconfirmationInterval = MESH_ROOT_CONFIRMATION_INTERVAL, 76 .dot11MeshHWMPconfirmationInterval = MESH_ROOT_CONFIRMATION_INTERVAL,
76 .power_mode = NL80211_MESH_POWER_ACTIVE, 77 .power_mode = NL80211_MESH_POWER_ACTIVE,
77 .dot11MeshAwakeWindowDuration = MESH_DEFAULT_AWAKE_WINDOW, 78 .dot11MeshAwakeWindowDuration = MESH_DEFAULT_AWAKE_WINDOW,
79 .plink_timeout = MESH_DEFAULT_PLINK_TIMEOUT,
78}; 80};
79 81
80const struct mesh_setup default_mesh_setup = { 82const struct mesh_setup default_mesh_setup = {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 88e820b73674..8aa83c04d4eb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4575,7 +4575,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
4575 nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE, 4575 nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE,
4576 cur_params.power_mode) || 4576 cur_params.power_mode) ||
4577 nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, 4577 nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW,
4578 cur_params.dot11MeshAwakeWindowDuration)) 4578 cur_params.dot11MeshAwakeWindowDuration) ||
4579 nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT,
4580 cur_params.plink_timeout))
4579 goto nla_put_failure; 4581 goto nla_put_failure;
4580 nla_nest_end(msg, pinfoattr); 4582 nla_nest_end(msg, pinfoattr);
4581 genlmsg_end(msg, hdr); 4583 genlmsg_end(msg, hdr);
@@ -4616,6 +4618,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
4616 [NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL] = { .type = NLA_U16 }, 4618 [NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL] = { .type = NLA_U16 },
4617 [NL80211_MESHCONF_POWER_MODE] = { .type = NLA_U32 }, 4619 [NL80211_MESHCONF_POWER_MODE] = { .type = NLA_U32 },
4618 [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 }, 4620 [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 },
4621 [NL80211_MESHCONF_PLINK_TIMEOUT] = { .type = NLA_U32 },
4619}; 4622};
4620 4623
4621static const struct nla_policy 4624static const struct nla_policy
@@ -4753,6 +4756,9 @@ do { \
4753 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration, 4756 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration,
4754 0, 65535, mask, 4757 0, 65535, mask,
4755 NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16); 4758 NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16);
4759 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 1, 0xffffffff,
4760 mask, NL80211_MESHCONF_PLINK_TIMEOUT,
4761 nla_get_u32);
4756 if (mask_out) 4762 if (mask_out)
4757 *mask_out = mask; 4763 *mask_out = mask;
4758 4764