diff options
-rw-r--r-- | include/linux/nl80211.h | 5 | ||||
-rw-r--r-- | include/net/cfg80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.h | 2 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 7 | ||||
-rw-r--r-- | net/wireless/mesh.c | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 9 |
8 files changed, 33 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 6936fabe8797..b7c3b737ddde 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -2192,6 +2192,10 @@ enum nl80211_mntr_flags { | |||
2192 | * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between | 2192 | * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between |
2193 | * proactive PREQs are transmitted. | 2193 | * proactive PREQs are transmitted. |
2194 | * | 2194 | * |
2195 | * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time | ||
2196 | * (in TUs) during which a mesh STA can send only one Action frame | ||
2197 | * containing a PREQ element for root path confirmation. | ||
2198 | * | ||
2195 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 2199 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
2196 | */ | 2200 | */ |
2197 | enum nl80211_meshconf_params { | 2201 | enum nl80211_meshconf_params { |
@@ -2220,6 +2224,7 @@ enum nl80211_meshconf_params { | |||
2220 | NL80211_MESHCONF_HT_OPMODE, | 2224 | NL80211_MESHCONF_HT_OPMODE, |
2221 | NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, | 2225 | NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, |
2222 | NL80211_MESHCONF_HWMP_ROOT_INTERVAL, | 2226 | NL80211_MESHCONF_HWMP_ROOT_INTERVAL, |
2227 | NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, | ||
2223 | 2228 | ||
2224 | /* keep last */ | 2229 | /* keep last */ |
2225 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 2230 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e52b38d7b1b6..f0163a10b8ce 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -849,6 +849,9 @@ struct bss_parameters { | |||
849 | * | 849 | * |
850 | * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive | 850 | * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive |
851 | * PREQs are transmitted. | 851 | * PREQs are transmitted. |
852 | * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs) | ||
853 | * during which a mesh STA can send only one Action frame containing | ||
854 | * a PREQ element for root path confirmation. | ||
852 | */ | 855 | */ |
853 | struct mesh_config { | 856 | struct mesh_config { |
854 | u16 dot11MeshRetryTimeout; | 857 | u16 dot11MeshRetryTimeout; |
@@ -875,6 +878,7 @@ struct mesh_config { | |||
875 | u16 ht_opmode; | 878 | u16 ht_opmode; |
876 | u32 dot11MeshHWMPactivePathToRootTimeout; | 879 | u32 dot11MeshHWMPactivePathToRootTimeout; |
877 | u16 dot11MeshHWMProotInterval; | 880 | u16 dot11MeshHWMProotInterval; |
881 | u16 dot11MeshHWMPconfirmationInterval; | ||
878 | }; | 882 | }; |
879 | 883 | ||
880 | /** | 884 | /** |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5bd316c0a63d..6e25ac4873c7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1596,6 +1596,9 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy, | |||
1596 | if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) | 1596 | if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) |
1597 | conf->dot11MeshHWMProotInterval = | 1597 | conf->dot11MeshHWMProotInterval = |
1598 | nconf->dot11MeshHWMProotInterval; | 1598 | nconf->dot11MeshHWMProotInterval; |
1599 | if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask)) | ||
1600 | conf->dot11MeshHWMPconfirmationInterval = | ||
1601 | nconf->dot11MeshHWMPconfirmationInterval; | ||
1599 | return 0; | 1602 | return 0; |
1600 | } | 1603 | } |
1601 | 1604 | ||
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index a8cea70902e4..512c894893d6 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -514,6 +514,8 @@ IEEE80211_IF_FILE(dot11MeshHWMPactivePathToRootTimeout, | |||
514 | u.mesh.mshcfg.dot11MeshHWMPactivePathToRootTimeout, DEC); | 514 | u.mesh.mshcfg.dot11MeshHWMPactivePathToRootTimeout, DEC); |
515 | IEEE80211_IF_FILE(dot11MeshHWMProotInterval, | 515 | IEEE80211_IF_FILE(dot11MeshHWMProotInterval, |
516 | u.mesh.mshcfg.dot11MeshHWMProotInterval, DEC); | 516 | u.mesh.mshcfg.dot11MeshHWMProotInterval, DEC); |
517 | IEEE80211_IF_FILE(dot11MeshHWMPconfirmationInterval, | ||
518 | u.mesh.mshcfg.dot11MeshHWMPconfirmationInterval, DEC); | ||
517 | #endif | 519 | #endif |
518 | 520 | ||
519 | #define DEBUGFS_ADD_MODE(name, mode) \ | 521 | #define DEBUGFS_ADD_MODE(name, mode) \ |
@@ -617,6 +619,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata) | |||
617 | MESHPARAMS_ADD(ht_opmode); | 619 | MESHPARAMS_ADD(ht_opmode); |
618 | MESHPARAMS_ADD(dot11MeshHWMPactivePathToRootTimeout); | 620 | MESHPARAMS_ADD(dot11MeshHWMPactivePathToRootTimeout); |
619 | MESHPARAMS_ADD(dot11MeshHWMProotInterval); | 621 | MESHPARAMS_ADD(dot11MeshHWMProotInterval); |
622 | MESHPARAMS_ADD(dot11MeshHWMPconfirmationInterval); | ||
620 | #undef MESHPARAMS_ADD | 623 | #undef MESHPARAMS_ADD |
621 | } | 624 | } |
622 | #endif | 625 | #endif |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index c7400a23b64b..faaa39bcfd10 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -104,6 +104,7 @@ enum mesh_deferred_task_flags { | |||
104 | * an mpath to a hash bucket on a path table. | 104 | * an mpath to a hash bucket on a path table. |
105 | * @rann_snd_addr: the RANN sender address | 105 | * @rann_snd_addr: the RANN sender address |
106 | * @rann_metric: the aggregated path metric towards the root node | 106 | * @rann_metric: the aggregated path metric towards the root node |
107 | * @last_preq_to_root: Timestamp of last PREQ sent to root | ||
107 | * @is_root: the destination station of this path is a root node | 108 | * @is_root: the destination station of this path is a root node |
108 | * @is_gate: the destination station of this path is a mesh gate | 109 | * @is_gate: the destination station of this path is a mesh gate |
109 | * | 110 | * |
@@ -131,6 +132,7 @@ struct mesh_path { | |||
131 | spinlock_t state_lock; | 132 | spinlock_t state_lock; |
132 | u8 rann_snd_addr[ETH_ALEN]; | 133 | u8 rann_snd_addr[ETH_ALEN]; |
133 | u32 rann_metric; | 134 | u32 rann_metric; |
135 | unsigned long last_preq_to_root; | ||
134 | bool is_root; | 136 | bool is_root; |
135 | bool is_gate; | 137 | bool is_gate; |
136 | }; | 138 | }; |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 35e3acbe2262..bea52479e3aa 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -98,6 +98,8 @@ static inline u32 u16_field_get(u8 *preq_elem, int offset, bool ae) | |||
98 | #define max_preq_retries(s) (s->u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries) | 98 | #define max_preq_retries(s) (s->u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries) |
99 | #define disc_timeout_jiff(s) \ | 99 | #define disc_timeout_jiff(s) \ |
100 | msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout) | 100 | msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout) |
101 | #define root_path_confirmation_jiffies(s) \ | ||
102 | msecs_to_jiffies(sdata->u.mesh.mshcfg.dot11MeshHWMPconfirmationInterval) | ||
101 | 103 | ||
102 | enum mpath_frame_type { | 104 | enum mpath_frame_type { |
103 | MPATH_PREQ = 0, | 105 | MPATH_PREQ = 0, |
@@ -811,11 +813,14 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, | |||
811 | } | 813 | } |
812 | 814 | ||
813 | if ((!(mpath->flags & (MESH_PATH_ACTIVE | MESH_PATH_RESOLVING)) || | 815 | if ((!(mpath->flags & (MESH_PATH_ACTIVE | MESH_PATH_RESOLVING)) || |
814 | time_after(jiffies, mpath->exp_time - 1*HZ)) && | 816 | (time_after(jiffies, mpath->last_preq_to_root + |
817 | root_path_confirmation_jiffies(sdata)) || | ||
818 | time_before(jiffies, mpath->last_preq_to_root))) && | ||
815 | !(mpath->flags & MESH_PATH_FIXED)) { | 819 | !(mpath->flags & MESH_PATH_FIXED)) { |
816 | mhwmp_dbg("%s time to refresh root mpath %pM", sdata->name, | 820 | mhwmp_dbg("%s time to refresh root mpath %pM", sdata->name, |
817 | orig_addr); | 821 | orig_addr); |
818 | mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); | 822 | mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); |
823 | mpath->last_preq_to_root = jiffies; | ||
819 | } | 824 | } |
820 | 825 | ||
821 | if ((SN_LT(mpath->sn, orig_sn) || (mpath->sn == orig_sn && | 826 | if ((SN_LT(mpath->sn, orig_sn) || (mpath->sn == orig_sn && |
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index 2f141cfd581e..3b73b07486cf 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #define MESH_RANN_INTERVAL 5000 | 16 | #define MESH_RANN_INTERVAL 5000 |
17 | #define MESH_PATH_TO_ROOT_TIMEOUT 6000 | 17 | #define MESH_PATH_TO_ROOT_TIMEOUT 6000 |
18 | #define MESH_ROOT_INTERVAL 5000 | 18 | #define MESH_ROOT_INTERVAL 5000 |
19 | #define MESH_ROOT_CONFIRMATION_INTERVAL 2000 | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Minimum interval between two consecutive PREQs originated by the same | 22 | * Minimum interval between two consecutive PREQs originated by the same |
@@ -66,6 +67,7 @@ const struct mesh_config default_mesh_config = { | |||
66 | .ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED, | 67 | .ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED, |
67 | .dot11MeshHWMPactivePathToRootTimeout = MESH_PATH_TO_ROOT_TIMEOUT, | 68 | .dot11MeshHWMPactivePathToRootTimeout = MESH_PATH_TO_ROOT_TIMEOUT, |
68 | .dot11MeshHWMProotInterval = MESH_ROOT_INTERVAL, | 69 | .dot11MeshHWMProotInterval = MESH_ROOT_INTERVAL, |
70 | .dot11MeshHWMPconfirmationInterval = MESH_ROOT_CONFIRMATION_INTERVAL, | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | const struct mesh_setup default_mesh_setup = { | 73 | const struct mesh_setup default_mesh_setup = { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f8930db613df..a363ca17bfc5 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3473,7 +3473,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
3473 | nla_put_u32(msg, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, | 3473 | nla_put_u32(msg, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, |
3474 | cur_params.dot11MeshHWMPactivePathToRootTimeout) || | 3474 | cur_params.dot11MeshHWMPactivePathToRootTimeout) || |
3475 | nla_put_u16(msg, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, | 3475 | nla_put_u16(msg, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, |
3476 | cur_params.dot11MeshHWMProotInterval)) | 3476 | cur_params.dot11MeshHWMProotInterval) || |
3477 | nla_put_u16(msg, NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, | ||
3478 | cur_params.dot11MeshHWMPconfirmationInterval)) | ||
3477 | goto nla_put_failure; | 3479 | goto nla_put_failure; |
3478 | nla_nest_end(msg, pinfoattr); | 3480 | nla_nest_end(msg, pinfoattr); |
3479 | genlmsg_end(msg, hdr); | 3481 | genlmsg_end(msg, hdr); |
@@ -3511,6 +3513,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A | |||
3511 | [NL80211_MESHCONF_HT_OPMODE] = { .type = NLA_U16 }, | 3513 | [NL80211_MESHCONF_HT_OPMODE] = { .type = NLA_U16 }, |
3512 | [NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT] = { .type = NLA_U32 }, | 3514 | [NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT] = { .type = NLA_U32 }, |
3513 | [NL80211_MESHCONF_HWMP_ROOT_INTERVAL] = { .type = NLA_U16 }, | 3515 | [NL80211_MESHCONF_HWMP_ROOT_INTERVAL] = { .type = NLA_U16 }, |
3516 | [NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL] = { .type = NLA_U16 }, | ||
3514 | }; | 3517 | }; |
3515 | 3518 | ||
3516 | static const struct nla_policy | 3519 | static const struct nla_policy |
@@ -3625,6 +3628,10 @@ do {\ | |||
3625 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMProotInterval, | 3628 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMProotInterval, |
3626 | mask, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, | 3629 | mask, NL80211_MESHCONF_HWMP_ROOT_INTERVAL, |
3627 | nla_get_u16); | 3630 | nla_get_u16); |
3631 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, | ||
3632 | dot11MeshHWMPconfirmationInterval, mask, | ||
3633 | NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, | ||
3634 | nla_get_u16); | ||
3628 | if (mask_out) | 3635 | if (mask_out) |
3629 | *mask_out = mask; | 3636 | *mask_out = mask; |
3630 | 3637 | ||