Commit 8e7c0538 authored by Colleen Twitty's avatar Colleen Twitty Committed by Johannes Berg

{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: default avatarColleen Twitty <colleen@cozybit.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a0a2af76
...@@ -1124,6 +1124,9 @@ struct bss_parameters { ...@@ -1124,6 +1124,9 @@ struct bss_parameters {
* setting for new peer links. * setting for new peer links.
* @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
* after transmitting its beacon. * after transmitting its beacon.
* @plink_timeout: If no tx activity is seen from a STA we've established
* peering with for longer than this time (in seconds), then remove it
* from the STA's list of peers. Default is 30 minutes.
*/ */
struct mesh_config { struct mesh_config {
u16 dot11MeshRetryTimeout; u16 dot11MeshRetryTimeout;
...@@ -1153,6 +1156,7 @@ struct mesh_config { ...@@ -1153,6 +1156,7 @@ struct mesh_config {
u16 dot11MeshHWMPconfirmationInterval; u16 dot11MeshHWMPconfirmationInterval;
enum nl80211_mesh_power_mode power_mode; enum nl80211_mesh_power_mode power_mode;
u16 dot11MeshAwakeWindowDuration; u16 dot11MeshAwakeWindowDuration;
u32 plink_timeout;
}; };
/** /**
......
...@@ -2577,6 +2577,10 @@ enum nl80211_mesh_power_mode { ...@@ -2577,6 +2577,10 @@ enum nl80211_mesh_power_mode {
* *
* @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
* *
* @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
* established peering with for longer than this time (in seconds), then
* remove it from the STA's list of peers. Default is 30 minutes.
*
* @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
*/ */
enum nl80211_meshconf_params { enum nl80211_meshconf_params {
...@@ -2608,6 +2612,7 @@ enum nl80211_meshconf_params { ...@@ -2608,6 +2612,7 @@ enum nl80211_meshconf_params {
NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
NL80211_MESHCONF_POWER_MODE, NL80211_MESHCONF_POWER_MODE,
NL80211_MESHCONF_AWAKE_WINDOW, NL80211_MESHCONF_AWAKE_WINDOW,
NL80211_MESHCONF_PLINK_TIMEOUT,
/* keep last */ /* keep last */
__NL80211_MESHCONF_ATTR_AFTER_LAST, __NL80211_MESHCONF_ATTR_AFTER_LAST,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define MESH_PATH_TO_ROOT_TIMEOUT 6000 #define MESH_PATH_TO_ROOT_TIMEOUT 6000
#define MESH_ROOT_INTERVAL 5000 #define MESH_ROOT_INTERVAL 5000
#define MESH_ROOT_CONFIRMATION_INTERVAL 2000 #define MESH_ROOT_CONFIRMATION_INTERVAL 2000
#define MESH_DEFAULT_PLINK_TIMEOUT 1800 /* timeout in seconds */
/* /*
* Minimum interval between two consecutive PREQs originated by the same * Minimum interval between two consecutive PREQs originated by the same
...@@ -75,6 +76,7 @@ const struct mesh_config default_mesh_config = { ...@@ -75,6 +76,7 @@ const struct mesh_config default_mesh_config = {
.dot11MeshHWMPconfirmationInterval = MESH_ROOT_CONFIRMATION_INTERVAL, .dot11MeshHWMPconfirmationInterval = MESH_ROOT_CONFIRMATION_INTERVAL,
.power_mode = NL80211_MESH_POWER_ACTIVE, .power_mode = NL80211_MESH_POWER_ACTIVE,
.dot11MeshAwakeWindowDuration = MESH_DEFAULT_AWAKE_WINDOW, .dot11MeshAwakeWindowDuration = MESH_DEFAULT_AWAKE_WINDOW,
.plink_timeout = MESH_DEFAULT_PLINK_TIMEOUT,
}; };
const struct mesh_setup default_mesh_setup = { const struct mesh_setup default_mesh_setup = {
......
...@@ -4575,7 +4575,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, ...@@ -4575,7 +4575,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE, nla_put_u32(msg, NL80211_MESHCONF_POWER_MODE,
cur_params.power_mode) || cur_params.power_mode) ||
nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW,
cur_params.dot11MeshAwakeWindowDuration)) cur_params.dot11MeshAwakeWindowDuration) ||
nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT,
cur_params.plink_timeout))
goto nla_put_failure; goto nla_put_failure;
nla_nest_end(msg, pinfoattr); nla_nest_end(msg, pinfoattr);
genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
...@@ -4616,6 +4618,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A ...@@ -4616,6 +4618,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
[NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL] = { .type = NLA_U16 }, [NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL] = { .type = NLA_U16 },
[NL80211_MESHCONF_POWER_MODE] = { .type = NLA_U32 }, [NL80211_MESHCONF_POWER_MODE] = { .type = NLA_U32 },
[NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 }, [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 },
[NL80211_MESHCONF_PLINK_TIMEOUT] = { .type = NLA_U32 },
}; };
static const struct nla_policy static const struct nla_policy
...@@ -4753,6 +4756,9 @@ do { \ ...@@ -4753,6 +4756,9 @@ do { \
FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration, FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshAwakeWindowDuration,
0, 65535, mask, 0, 65535, mask,
NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16); NL80211_MESHCONF_AWAKE_WINDOW, nla_get_u16);
FILL_IN_MESH_PARAM_IF_SET(tb, cfg, plink_timeout, 1, 0xffffffff,
mask, NL80211_MESHCONF_PLINK_TIMEOUT,
nla_get_u32);
if (mask_out) if (mask_out)
*mask_out = mask; *mask_out = mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment