aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@cozybit.com>2011-11-24 20:15:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:44:06 -0500
commitdca7e9430cb3e492437a5ce891b8b3e315c147ca (patch)
treea7503e86e20e649074bbaccd5272d61a51425e2e
parentd3c1597b8d1ba0447ce858c7c385eabcf69f2c8f (diff)
{nl,cfg,mac}80211: implement dot11MeshHWMPperrMinInterval
As per 802.11mb 13.9.11.3 Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/linux/nl80211.h5
-rw-r--r--include/net/cfg80211.h1
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/debugfs_netdev.c3
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/mesh.c1
-rw-r--r--net/mac80211/mesh_hwmp.c6
-rw-r--r--net/wireless/mesh.c2
-rw-r--r--net/wireless/nl80211.c6
9 files changed, 30 insertions, 1 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 1fc04853ec95..f51e3bf93a96 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -2094,6 +2094,10 @@ enum nl80211_mntr_flags {
2094 * access to a broader network beyond the MBSS. This is done via Root 2094 * access to a broader network beyond the MBSS. This is done via Root
2095 * Announcement frames. 2095 * Announcement frames.
2096 * 2096 *
2097 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
2098 * TUs) during which a mesh STA can send only one Action frame containing a
2099 * PERR element.
2100 *
2097 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 2101 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
2098 * 2102 *
2099 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2103 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -2117,6 +2121,7 @@ enum nl80211_meshconf_params {
2117 NL80211_MESHCONF_ELEMENT_TTL, 2121 NL80211_MESHCONF_ELEMENT_TTL,
2118 NL80211_MESHCONF_HWMP_RANN_INTERVAL, 2122 NL80211_MESHCONF_HWMP_RANN_INTERVAL,
2119 NL80211_MESHCONF_GATE_ANNOUNCEMENTS, 2123 NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
2124 NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
2120 2125
2121 /* keep last */ 2126 /* keep last */
2122 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2127 __NL80211_MESHCONF_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 232d1a5c5672..ce6236b5473d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -782,6 +782,7 @@ struct mesh_config {
782 u16 min_discovery_timeout; 782 u16 min_discovery_timeout;
783 u32 dot11MeshHWMPactivePathTimeout; 783 u32 dot11MeshHWMPactivePathTimeout;
784 u16 dot11MeshHWMPpreqMinInterval; 784 u16 dot11MeshHWMPpreqMinInterval;
785 u16 dot11MeshHWMPperrMinInterval;
785 u16 dot11MeshHWMPnetDiameterTraversalTime; 786 u16 dot11MeshHWMPnetDiameterTraversalTime;
786 u8 dot11MeshHWMPRootMode; 787 u8 dot11MeshHWMPRootMode;
787 u16 dot11MeshHWMPRannInterval; 788 u16 dot11MeshHWMPRannInterval;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7ccba83dc8c8..393b2a4445b8 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1272,6 +1272,9 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1272 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, mask)) 1272 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, mask))
1273 conf->dot11MeshHWMPpreqMinInterval = 1273 conf->dot11MeshHWMPpreqMinInterval =
1274 nconf->dot11MeshHWMPpreqMinInterval; 1274 nconf->dot11MeshHWMPpreqMinInterval;
1275 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, mask))
1276 conf->dot11MeshHWMPperrMinInterval =
1277 nconf->dot11MeshHWMPperrMinInterval;
1275 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 1278 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
1276 mask)) 1279 mask))
1277 conf->dot11MeshHWMPnetDiameterTraversalTime = 1280 conf->dot11MeshHWMPnetDiameterTraversalTime =
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 9352819a986b..8df28910b8ee 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -405,6 +405,8 @@ IEEE80211_IF_FILE(dot11MeshHWMPactivePathTimeout,
405 u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout, DEC); 405 u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout, DEC);
406IEEE80211_IF_FILE(dot11MeshHWMPpreqMinInterval, 406IEEE80211_IF_FILE(dot11MeshHWMPpreqMinInterval,
407 u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval, DEC); 407 u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval, DEC);
408IEEE80211_IF_FILE(dot11MeshHWMPperrMinInterval,
409 u.mesh.mshcfg.dot11MeshHWMPperrMinInterval, DEC);
408IEEE80211_IF_FILE(dot11MeshHWMPnetDiameterTraversalTime, 410IEEE80211_IF_FILE(dot11MeshHWMPnetDiameterTraversalTime,
409 u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime, DEC); 411 u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime, DEC);
410IEEE80211_IF_FILE(dot11MeshHWMPmaxPREQretries, 412IEEE80211_IF_FILE(dot11MeshHWMPmaxPREQretries,
@@ -534,6 +536,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
534 MESHPARAMS_ADD(dot11MeshMaxPeerLinks); 536 MESHPARAMS_ADD(dot11MeshMaxPeerLinks);
535 MESHPARAMS_ADD(dot11MeshHWMPactivePathTimeout); 537 MESHPARAMS_ADD(dot11MeshHWMPactivePathTimeout);
536 MESHPARAMS_ADD(dot11MeshHWMPpreqMinInterval); 538 MESHPARAMS_ADD(dot11MeshHWMPpreqMinInterval);
539 MESHPARAMS_ADD(dot11MeshHWMPperrMinInterval);
537 MESHPARAMS_ADD(dot11MeshHWMPnetDiameterTraversalTime); 540 MESHPARAMS_ADD(dot11MeshHWMPnetDiameterTraversalTime);
538 MESHPARAMS_ADD(dot11MeshHWMPmaxPREQretries); 541 MESHPARAMS_ADD(dot11MeshHWMPmaxPREQretries);
539 MESHPARAMS_ADD(path_refresh_time); 542 MESHPARAMS_ADD(path_refresh_time);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 7a757a97ba37..a785d61defe1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -514,7 +514,9 @@ struct ieee80211_if_mesh {
514 atomic_t mpaths; 514 atomic_t mpaths;
515 /* Timestamp of last SN update */ 515 /* Timestamp of last SN update */
516 unsigned long last_sn_update; 516 unsigned long last_sn_update;
517 /* Timestamp of last SN sent */ 517 /* Time when it's ok to send next PERR */
518 unsigned long next_perr;
519 /* Timestamp of last PREQ sent */
518 unsigned long last_preq; 520 unsigned long last_preq;
519 struct mesh_rmc *rmc; 521 struct mesh_rmc *rmc;
520 spinlock_t mesh_preq_queue_lock; 522 spinlock_t mesh_preq_queue_lock;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index ee82d2f7f114..c707c8bf6d2c 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -749,6 +749,7 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
749 atomic_set(&ifmsh->mpaths, 0); 749 atomic_set(&ifmsh->mpaths, 0);
750 mesh_rmc_init(sdata); 750 mesh_rmc_init(sdata);
751 ifmsh->last_preq = jiffies; 751 ifmsh->last_preq = jiffies;
752 ifmsh->next_perr = jiffies;
752 /* Allocate all mesh structures when creating the first mesh interface. */ 753 /* Allocate all mesh structures when creating the first mesh interface. */
753 if (!mesh_allocated) 754 if (!mesh_allocated)
754 ieee80211s_init(); 755 ieee80211s_init();
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 208ba35661f9..fe93386d6aa9 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -241,11 +241,15 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
241{ 241{
242 struct ieee80211_local *local = sdata->local; 242 struct ieee80211_local *local = sdata->local;
243 struct sk_buff *skb; 243 struct sk_buff *skb;
244 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
244 struct ieee80211_mgmt *mgmt; 245 struct ieee80211_mgmt *mgmt;
245 u8 *pos, ie_len; 246 u8 *pos, ie_len;
246 int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) + 247 int hdr_len = offsetof(struct ieee80211_mgmt, u.action.u.mesh_action) +
247 sizeof(mgmt->u.action.u.mesh_action); 248 sizeof(mgmt->u.action.u.mesh_action);
248 249
250 if (time_before(jiffies, ifmsh->next_perr))
251 return -EAGAIN;
252
249 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 253 skb = dev_alloc_skb(local->hw.extra_tx_headroom +
250 hdr_len + 254 hdr_len +
251 2 + 15 /* PERR IE */); 255 2 + 15 /* PERR IE */);
@@ -290,6 +294,8 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
290 294
291 /* see note in function header */ 295 /* see note in function header */
292 prepare_frame_for_deferred_tx(sdata, skb); 296 prepare_frame_for_deferred_tx(sdata, skb);
297 ifmsh->next_perr = TU_TO_EXP_TIME(
298 ifmsh->mshcfg.dot11MeshHWMPperrMinInterval);
293 ieee80211_add_pending_skb(local, skb); 299 ieee80211_add_pending_skb(local, skb);
294 return 0; 300 return 0;
295} 301}
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index b7b7868f4128..8c550df13037 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -20,6 +20,7 @@
20 * interface 20 * interface
21 */ 21 */
22#define MESH_PREQ_MIN_INT 10 22#define MESH_PREQ_MIN_INT 10
23#define MESH_PERR_MIN_INT 100
23#define MESH_DIAM_TRAVERSAL_TIME 50 24#define MESH_DIAM_TRAVERSAL_TIME 50
24 25
25/* 26/*
@@ -47,6 +48,7 @@ const struct mesh_config default_mesh_config = {
47 .dot11MeshMaxPeerLinks = MESH_MAX_ESTAB_PLINKS, 48 .dot11MeshMaxPeerLinks = MESH_MAX_ESTAB_PLINKS,
48 .dot11MeshHWMPactivePathTimeout = MESH_PATH_TIMEOUT, 49 .dot11MeshHWMPactivePathTimeout = MESH_PATH_TIMEOUT,
49 .dot11MeshHWMPpreqMinInterval = MESH_PREQ_MIN_INT, 50 .dot11MeshHWMPpreqMinInterval = MESH_PREQ_MIN_INT,
51 .dot11MeshHWMPperrMinInterval = MESH_PERR_MIN_INT,
50 .dot11MeshHWMPnetDiameterTraversalTime = MESH_DIAM_TRAVERSAL_TIME, 52 .dot11MeshHWMPnetDiameterTraversalTime = MESH_DIAM_TRAVERSAL_TIME,
51 .dot11MeshHWMPmaxPREQretries = MESH_MAX_PREQ_RETRIES, 53 .dot11MeshHWMPmaxPREQretries = MESH_MAX_PREQ_RETRIES,
52 .path_refresh_time = MESH_PATH_REFRESH_TIME, 54 .path_refresh_time = MESH_PATH_REFRESH_TIME,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5699c3b1aba4..0ee512b85a1f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3195,6 +3195,8 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
3195 cur_params.dot11MeshHWMPactivePathTimeout); 3195 cur_params.dot11MeshHWMPactivePathTimeout);
3196 NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, 3196 NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
3197 cur_params.dot11MeshHWMPpreqMinInterval); 3197 cur_params.dot11MeshHWMPpreqMinInterval);
3198 NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
3199 cur_params.dot11MeshHWMPperrMinInterval);
3198 NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 3200 NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
3199 cur_params.dot11MeshHWMPnetDiameterTraversalTime); 3201 cur_params.dot11MeshHWMPnetDiameterTraversalTime);
3200 NLA_PUT_U8(msg, NL80211_MESHCONF_HWMP_ROOTMODE, 3202 NLA_PUT_U8(msg, NL80211_MESHCONF_HWMP_ROOTMODE,
@@ -3229,6 +3231,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
3229 [NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT] = { .type = NLA_U16 }, 3231 [NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT] = { .type = NLA_U16 },
3230 [NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT] = { .type = NLA_U32 }, 3232 [NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT] = { .type = NLA_U32 },
3231 [NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL] = { .type = NLA_U16 }, 3233 [NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL] = { .type = NLA_U16 },
3234 [NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL] = { .type = NLA_U16 },
3232 [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 }, 3235 [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 },
3233 [NL80211_MESHCONF_HWMP_ROOTMODE] = { .type = NLA_U8 }, 3236 [NL80211_MESHCONF_HWMP_ROOTMODE] = { .type = NLA_U8 },
3234 [NL80211_MESHCONF_HWMP_RANN_INTERVAL] = { .type = NLA_U16 }, 3237 [NL80211_MESHCONF_HWMP_RANN_INTERVAL] = { .type = NLA_U16 },
@@ -3303,6 +3306,9 @@ do {\
3303 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMPpreqMinInterval, 3306 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMPpreqMinInterval,
3304 mask, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, 3307 mask, NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
3305 nla_get_u16); 3308 nla_get_u16);
3309 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMPperrMinInterval,
3310 mask, NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
3311 nla_get_u16);
3306 FILL_IN_MESH_PARAM_IF_SET(tb, cfg, 3312 FILL_IN_MESH_PARAM_IF_SET(tb, cfg,
3307 dot11MeshHWMPnetDiameterTraversalTime, 3313 dot11MeshHWMPnetDiameterTraversalTime,
3308 mask, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 3314 mask, NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,