{nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToR...
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Wed, 13 Jun 2012 18:06:06 +0000 (02:06 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 14 Jun 2012 07:08:22 +0000 (09:08 +0200)
Add the mesh configuration parameters dot11MeshHWMProotInterval
and dot11MeshHWMPactivePathToRootTimeout to be used by
proactive PREQ mechanism.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
[line-break commit log]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/linux/nl80211.h
include/net/cfg80211.h
net/mac80211/cfg.c
net/mac80211/debugfs_netdev.c
net/wireless/mesh.c
net/wireless/nl80211.c

index e4f41bdebc07650435fcb2980a89242519557c3f..6936fabe87976e60240794444f98452fb7829054 100644 (file)
@@ -2185,6 +2185,13 @@ enum nl80211_mntr_flags {
  *
  * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
  *
+ * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
+ *     which mesh STAs receiving a proactive PREQ shall consider the forwarding
+ *     information to the root mesh STA to be valid.
+ *
+ * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
+ *     proactive PREQs are transmitted.
+ *
  * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_meshconf_params {
@@ -2211,6 +2218,8 @@ enum nl80211_meshconf_params {
        NL80211_MESHCONF_RSSI_THRESHOLD,
        NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
        NL80211_MESHCONF_HT_OPMODE,
+       NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
+       NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
 
        /* keep last */
        __NL80211_MESHCONF_ATTR_AFTER_LAST,
index 76d54725ea3190d7e0ed85b1c974998586affa68..e52b38d7b1b6616fa10117fabb23f647767e87e0 100644 (file)
@@ -842,6 +842,13 @@ struct bss_parameters {
  * @rssi_threshold: the threshold for average signal strength of candidate
  *     station to establish a peer link
  * @ht_opmode: mesh HT protection mode
+ *
+ * @dot11MeshHWMPactivePathToRootTimeout: The time (in TUs) for which mesh STAs
+ *     receiving a proactive PREQ shall consider the forwarding information to
+ *     the root mesh STA to be valid.
+ *
+ * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive
+ *     PREQs are transmitted.
  */
 struct mesh_config {
        u16 dot11MeshRetryTimeout;
@@ -866,6 +873,8 @@ struct mesh_config {
        bool dot11MeshForwarding;
        s32 rssi_threshold;
        u16 ht_opmode;
+       u32 dot11MeshHWMPactivePathToRootTimeout;
+       u16 dot11MeshHWMProotInterval;
 };
 
 /**
index cd8b1fb05d42498885976aa4df8a780e2156e97c..d93cda1c4215ab4f3d177181526d347c107008ac 100644 (file)
@@ -1590,6 +1590,12 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
                sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode;
                ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
        }
+       if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask))
+               conf->dot11MeshHWMPactivePathToRootTimeout =
+                       nconf->dot11MeshHWMPactivePathToRootTimeout;
+       if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask))
+               conf->dot11MeshHWMProotInterval =
+                       nconf->dot11MeshHWMProotInterval;
        return 0;
 }
 
index c429417e1322be387a487f15fc5600b8eed859c4..a8cea70902e42efdc4c0f181b0ad9098e77086bc 100644 (file)
@@ -510,6 +510,10 @@ IEEE80211_IF_FILE(dot11MeshHWMPRannInterval,
 IEEE80211_IF_FILE(dot11MeshForwarding, u.mesh.mshcfg.dot11MeshForwarding, DEC);
 IEEE80211_IF_FILE(rssi_threshold, u.mesh.mshcfg.rssi_threshold, DEC);
 IEEE80211_IF_FILE(ht_opmode, u.mesh.mshcfg.ht_opmode, DEC);
+IEEE80211_IF_FILE(dot11MeshHWMPactivePathToRootTimeout,
+                 u.mesh.mshcfg.dot11MeshHWMPactivePathToRootTimeout, DEC);
+IEEE80211_IF_FILE(dot11MeshHWMProotInterval,
+                 u.mesh.mshcfg.dot11MeshHWMProotInterval, DEC);
 #endif
 
 #define DEBUGFS_ADD_MODE(name, mode) \
@@ -611,6 +615,8 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
        MESHPARAMS_ADD(dot11MeshGateAnnouncementProtocol);
        MESHPARAMS_ADD(rssi_threshold);
        MESHPARAMS_ADD(ht_opmode);
+       MESHPARAMS_ADD(dot11MeshHWMPactivePathToRootTimeout);
+       MESHPARAMS_ADD(dot11MeshHWMProotInterval);
 #undef MESHPARAMS_ADD
 }
 #endif
index b44c736bf9cfb292a1d7baefb7333fe925800386..2f141cfd581e85698e12ddfc521a485f8e446c43 100644 (file)
@@ -14,6 +14,8 @@
 
 #define MESH_PATH_TIMEOUT      5000
 #define MESH_RANN_INTERVAL      5000
+#define MESH_PATH_TO_ROOT_TIMEOUT      6000
+#define MESH_ROOT_INTERVAL     5000
 
 /*
  * Minimum interval between two consecutive PREQs originated by the same
@@ -62,6 +64,8 @@ const struct mesh_config default_mesh_config = {
        .dot11MeshForwarding = true,
        .rssi_threshold = MESH_RSSI_THRESHOLD,
        .ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED,
+       .dot11MeshHWMPactivePathToRootTimeout = MESH_PATH_TO_ROOT_TIMEOUT,
+       .dot11MeshHWMProotInterval = MESH_ROOT_INTERVAL,
 };
 
 const struct mesh_setup default_mesh_setup = {
index 7db0aee8cd5b37d59347e4ae9e8c3da2843deb0c..f8930db613df54327049b9098957c4d721ce612d 100644 (file)
@@ -3469,7 +3469,11 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
            nla_put_u32(msg, NL80211_MESHCONF_RSSI_THRESHOLD,
                        cur_params.rssi_threshold) ||
            nla_put_u32(msg, NL80211_MESHCONF_HT_OPMODE,
-                       cur_params.ht_opmode))
+                       cur_params.ht_opmode) ||
+           nla_put_u32(msg, NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
+                       cur_params.dot11MeshHWMPactivePathToRootTimeout) ||
+           nla_put_u16(msg, NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
+                       cur_params.dot11MeshHWMProotInterval))
                goto nla_put_failure;
        nla_nest_end(msg, pinfoattr);
        genlmsg_end(msg, hdr);
@@ -3505,6 +3509,8 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
        [NL80211_MESHCONF_FORWARDING] = { .type = NLA_U8 },
        [NL80211_MESHCONF_RSSI_THRESHOLD] = { .type = NLA_U32 },
        [NL80211_MESHCONF_HT_OPMODE] = { .type = NLA_U16 },
+       [NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT] = { .type = NLA_U32 },
+       [NL80211_MESHCONF_HWMP_ROOT_INTERVAL] = { .type = NLA_U16 },
 };
 
 static const struct nla_policy
@@ -3612,6 +3618,13 @@ do {\
        FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode,
                                  mask, NL80211_MESHCONF_HT_OPMODE,
                                  nla_get_u16);
+       FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMPactivePathToRootTimeout,
+                                 mask,
+                                 NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
+                                 nla_get_u32);
+       FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshHWMProotInterval,
+                                 mask, NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
+                                 nla_get_u16);
        if (mask_out)
                *mask_out = mask;