* [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh
@ 2012-06-07 4:39 Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Chun-Yeow Yeoh @ 2012-06-07 4:39 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, javier, linville, devel, Chun-Yeow Yeoh
These series of patches allow the support of proactive PREQ mechanism as defined in
Sec. 13.10.4.2 of IEEE Std. 802.11-2012 based on the setting of dot11MeshHWMPRootMode
as follow:
dot11MeshHWMPRootMode (2): Proactive PREQ no PREP
dot11MeshHWMPRootMode (3): Proactive PREQ with PREP
Proactive RANN is now supported if the dot11MeshHWMPRootMode is set as (4).
This v2 is modified according to Johannes's comments.
Chun-Yeow Yeoh (4):
{nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and
dot11MeshHWMPactivePathToRootTimeout
mac80211: implement the proactive PREQ generation
mac80211: implement the proactive PREP generation
mac80211: invoke the timer only with correct dot11MeshHWMPRootMode
value
include/linux/ieee80211.h | 17 +++++++++++
include/linux/nl80211.h | 9 ++++++
include/net/cfg80211.h | 2 +
net/mac80211/cfg.c | 12 ++++++-
net/mac80211/debugfs_netdev.c | 6 ++++
net/mac80211/mesh.c | 9 ++++--
net/mac80211/mesh_hwmp.c | 64 ++++++++++++++++++++++++++++++++++------
net/wireless/mesh.c | 4 ++
net/wireless/nl80211.c | 17 ++++++++++-
9 files changed, 124 insertions(+), 16 deletions(-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout
2012-06-07 4:39 [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh Chun-Yeow Yeoh
@ 2012-06-07 4:39 ` Chun-Yeow Yeoh
2012-06-09 8:40 ` Johannes Berg
` (2 more replies)
2012-06-07 4:39 ` [PATCH v2 2/4] mac80211: implement the proactive PREQ generation Chun-Yeow Yeoh
` (2 subsequent siblings)
3 siblings, 3 replies; 13+ messages in thread
From: Chun-Yeow Yeoh @ 2012-06-07 4:39 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, javier, linville, devel, Chun-Yeow Yeoh
Add the mesh configuration parameters dot11MeshHWMProotInterval and
dot11MeshHWMPactivePathToRootTimeout to be used by proactive PREQ mechanism.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: avoid renumbering the old command ids (Johannes)
include/linux/nl80211.h | 9 +++++++++
include/net/cfg80211.h | 2 ++
net/mac80211/cfg.c | 8 ++++++++
net/mac80211/debugfs_netdev.c | 6 ++++++
net/wireless/mesh.c | 4 ++++
net/wireless/nl80211.c | 17 ++++++++++++++++-
6 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 970afdf..b91b3fe 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -2162,6 +2162,13 @@ enum nl80211_mntr_flags {
*
* @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
*
+ * @NL80211_MESHCONF_HWMP_ACTIVE_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 {
@@ -2188,6 +2195,8 @@ enum nl80211_meshconf_params {
NL80211_MESHCONF_RSSI_THRESHOLD,
NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
NL80211_MESHCONF_HT_OPMODE,
+ NL80211_MESHCONF_HWMP_ACTIVE_PATH_TO_ROOT_TIMEOUT,
+ NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
/* keep last */
__NL80211_MESHCONF_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7319f25..dfc8939 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -827,6 +827,8 @@ struct mesh_config {
bool dot11MeshForwarding;
s32 rssi_threshold;
u16 ht_opmode;
+ u32 dot11MeshHWMPactivePathToRootTimeout;
+ u16 dot11MeshHWMProotInterval;
};
/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 498c94e..38e743f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1590,6 +1590,14 @@ 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_ACTIVE_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;
}
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index d4272ff..59d2086 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -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
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index b44c736..2f141cf 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -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 = {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7ae54b8..cc554b9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -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_ACTIVE_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);
@@ -3506,6 +3510,10 @@ 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_ACTIVE_PATH_TO_ROOT_TIMEOUT] = {
+ .type = NLA_U32
+ },
+ [NL80211_MESHCONF_HWMP_ROOT_INTERVAL] = { .type = NLA_U16 },
};
static const struct nla_policy
@@ -3605,6 +3613,13 @@ do {\
mask, NL80211_MESHCONF_RSSI_THRESHOLD, nla_get_u32);
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_ACTIVE_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;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/4] mac80211: implement the proactive PREQ generation
2012-06-07 4:39 [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
@ 2012-06-07 4:39 ` Chun-Yeow Yeoh
2012-06-09 8:45 ` Johannes Berg
2012-06-07 4:39 ` [PATCH v2 3/4] mac80211: implement the proactive PREP generation Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value Chun-Yeow Yeoh
3 siblings, 1 reply; 13+ messages in thread
From: Chun-Yeow Yeoh @ 2012-06-07 4:39 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, javier, linville, devel, Chun-Yeow Yeoh
Generate the proactive PREQ element as defined in Sec. 13.10.9.3 (Case C) of IEEE Std. 802.11-2012
based on the selection of dot11MeshHWMPRootMode as follow:
dot11MeshHWMPRootMode (2) is proactivePREQnoPREP
dot11MeshHWMPRootMode (3) is proactivePREQwithPREP
The proactive PREQ is generated based on the interval defined by dot11MeshHWMProotInterval.
With this change, proactive RANN element is now generated if the dot11MeshHWMPRootMode is set to
(4) instead of (1).
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: redefine the root mesh STA mode identifier (Johannes)
include/linux/ieee80211.h | 17 +++++++++++++++++
net/mac80211/mesh.c | 7 +++++--
net/mac80211/mesh_hwmp.c | 30 ++++++++++++++++++++++++++----
3 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ce9af89..1d6a807 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1474,6 +1474,23 @@ enum {
IEEE80211_PATH_METRIC_VENDOR = 255,
};
+/**
+ * enum - root mesh STA mode identifier used by dot11MeshHWMPRootMode
+ *
+ * @IEEE80211_NO_ROOT: the mesh STA is not a root mesh STA (default)
+ * @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA
+ * supports the proactive PREQ with proactive PREP subfield set to 0
+ * @IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA
+ * supports the proactive PREQ with proactive PREP subfield set to 1
+ * @IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports
+ * the proactive RANN
+ */
+enum {
+ IEEE80211_NO_ROOT = 0,
+ IEEE80211_PROACTIVE_PREQ_NO_PREP = 2,
+ IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3,
+ IEEE80211_PROACTIVE_RANN = 4,
+};
/*
* IEEE 802.11-2007 7.3.2.9 Country information element
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 7cf1950..b690144 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -541,11 +541,14 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata,
static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ u32 interval;
mesh_path_tx_root_frame(sdata);
+ interval = (ifmsh->mshcfg.dot11MeshHWMPRootMode ==
+ IEEE80211_PROACTIVE_RANN) ? ifmsh->mshcfg.dot11MeshHWMPRannInterval
+ : ifmsh->mshcfg.dot11MeshHWMProotInterval;
mod_timer(&ifmsh->mesh_path_root_timer,
- round_jiffies(TU_TO_EXP_TIME(
- ifmsh->mshcfg.dot11MeshHWMPRannInterval)));
+ round_jiffies(TU_TO_EXP_TIME(interval)));
}
#ifdef CONFIG_PM
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index fa7c580..999db08 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -33,9 +33,11 @@
/* Reply and forward */
#define MP_F_RF 0x2
/* Unknown Sequence Number */
-#define MP_F_USN 0x01
+#define MP_F_USN 0x04
/* Reason code Present */
#define MP_F_RCODE 0x02
+/* Proactive PREQ with PREP */
+#define PREQ_F_PREP 0x04
static void mesh_queue_preq(struct mesh_path *, u8);
@@ -1157,13 +1159,33 @@ mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
u32 interval = ifmsh->mshcfg.dot11MeshHWMPRannInterval;
- u8 flags;
+ u8 flags, target_flags = 0;
flags = (ifmsh->mshcfg.dot11MeshGateAnnouncementProtocol)
? RANN_FLAG_IS_GATE : 0;
- mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr,
+
+ switch (ifmsh->mshcfg.dot11MeshHWMPRootMode) {
+ case IEEE80211_PROACTIVE_RANN:
+ mesh_path_sel_frame_tx(MPATH_RANN, flags, sdata->vif.addr,
cpu_to_le32(++ifmsh->sn),
0, NULL, 0, broadcast_addr,
- 0, sdata->u.mesh.mshcfg.element_ttl,
+ 0, ifmsh->mshcfg.element_ttl,
cpu_to_le32(interval), 0, 0, sdata);
+ break;
+ case IEEE80211_PROACTIVE_PREQ_WITH_PREP:
+ flags |= PREQ_F_PREP;
+ case IEEE80211_PROACTIVE_PREQ_NO_PREP:
+ interval = ifmsh->mshcfg.dot11MeshHWMPactivePathToRootTimeout;
+ target_flags |= MP_F_DO | MP_F_USN;
+ mesh_path_sel_frame_tx(MPATH_PREQ, flags, sdata->vif.addr,
+ cpu_to_le32(++ifmsh->sn), target_flags,
+ (u8 *) broadcast_addr, 0, broadcast_addr,
+ 0, ifmsh->mshcfg.element_ttl,
+ cpu_to_le32(interval),
+ 0, cpu_to_le32(ifmsh->preq_id++), sdata);
+ break;
+ default:
+ mhwmp_dbg("Proactive mechanism not supported");
+ return;
+ }
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/4] mac80211: implement the proactive PREP generation
2012-06-07 4:39 [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 2/4] mac80211: implement the proactive PREQ generation Chun-Yeow Yeoh
@ 2012-06-07 4:39 ` Chun-Yeow Yeoh
2012-06-09 8:46 ` Johannes Berg
2012-06-07 4:39 ` [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value Chun-Yeow Yeoh
3 siblings, 1 reply; 13+ messages in thread
From: Chun-Yeow Yeoh @ 2012-06-07 4:39 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, javier, linville, devel, Chun-Yeow Yeoh
Generate the proactive PREP element in Proactive PREQ mode as defined in
Sec. 13.10.10.3 (Case D) of IEEE Std. 802.11-2012.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: adhere to Linux kernel coding style (Johannes)
net/mac80211/mesh_hwmp.c | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 999db08..1f2ebf0 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -521,10 +521,11 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
struct mesh_path *mpath = NULL;
u8 *target_addr, *orig_addr;
const u8 *da;
- u8 target_flags, ttl;
+ u8 target_flags, ttl, flags;
u32 orig_sn, target_sn, lifetime;
bool reply = false;
bool forward = true;
+ bool root_is_gate;
/* Update target SN, if present */
target_addr = PREQ_IE_TARGET_ADDR(preq_elem);
@@ -532,6 +533,9 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
target_sn = PREQ_IE_TARGET_SN(preq_elem);
orig_sn = PREQ_IE_ORIG_SN(preq_elem);
target_flags = PREQ_IE_TARGET_F(preq_elem);
+ /* Proactive PREQ gate announcements */
+ flags = PREQ_IE_FLAGS(preq_elem);
+ root_is_gate = !!(flags & RANN_FLAG_IS_GATE);
mhwmp_dbg("received PREQ from %pM", orig_addr);
@@ -546,6 +550,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
target_sn = ++ifmsh->sn;
ifmsh->last_sn_update = jiffies;
}
+ } else if (is_broadcast_ether_addr(target_addr) &&
+ (target_flags & MP_F_DO)) {
+ mpath = mesh_path_lookup(orig_addr, sdata);
+ if (mpath) {
+ if (flags & PREQ_F_PREP)
+ reply = true;
+ if (root_is_gate)
+ mesh_path_add_gate(mpath);
+ }
} else {
rcu_read_lock();
mpath = mesh_path_lookup(target_addr, sdata);
@@ -573,11 +586,20 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
ttl = ifmsh->mshcfg.element_ttl;
if (ttl != 0) {
mhwmp_dbg("replying to the PREQ");
- mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
- cpu_to_le32(orig_sn), 0, target_addr,
- cpu_to_le32(target_sn), mgmt->sa, 0, ttl,
- cpu_to_le32(lifetime), cpu_to_le32(metric),
- 0, sdata);
+ if (!is_broadcast_ether_addr(target_addr)) {
+ mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
+ cpu_to_le32(orig_sn), 0, target_addr,
+ cpu_to_le32(target_sn), mgmt->sa, 0, ttl,
+ cpu_to_le32(lifetime), cpu_to_le32(metric),
+ 0, sdata);
+ } else {
+ mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
+ cpu_to_le32(orig_sn), 0, sdata->vif.addr,
+ cpu_to_le32(++ifmsh->sn), mgmt->sa, 0, ttl,
+ cpu_to_le32(lifetime), 0,
+ 0, sdata);
+ ifmsh->last_sn_update = jiffies;
+ }
} else
ifmsh->mshstats.dropped_frames_ttl++;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
2012-06-07 4:39 [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh Chun-Yeow Yeoh
` (2 preceding siblings ...)
2012-06-07 4:39 ` [PATCH v2 3/4] mac80211: implement the proactive PREP generation Chun-Yeow Yeoh
@ 2012-06-07 4:39 ` Chun-Yeow Yeoh
2012-06-09 8:46 ` Johannes Berg
3 siblings, 1 reply; 13+ messages in thread
From: Chun-Yeow Yeoh @ 2012-06-07 4:39 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, javier, linville, devel, Chun-Yeow Yeoh
mesh_path_root_timer is invoked once the dot11MeshHWMPRootMode is larger than 1. This patch
also adds the backward compatible to the previous setting on dot11MeshHWMPRootMode. If the
user configures as follow, it will still trigger the proactive RANN with Gate Announcement.
iw mesh0 set mesh_param mesh_hwmp_rootmode 1
iw mesh0 set mesh_param mesh_gate_announcements 1
similar to the following setting:
iw mesh0 set mesh_param mesh_hwmp_rootmode 4
iw mesh0 set mesh_param mesh_gate_announcements 1
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: use constant for dot11MeshHWMPRootMode assignment (Johannes)
net/mac80211/cfg.c | 4 ++--
net/mac80211/mesh.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 38e743f..85c6601 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1564,8 +1564,8 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
* announcements, so require this ifmsh to also be a root node
* */
if (nconf->dot11MeshGateAnnouncementProtocol &&
- !conf->dot11MeshHWMPRootMode) {
- conf->dot11MeshHWMPRootMode = 1;
+ !(conf->dot11MeshHWMPRootMode > 1)) {
+ conf->dot11MeshHWMPRootMode = IEEE80211_PROACTIVE_RANN;
ieee80211_mesh_root_setup(ifmsh);
}
conf->dot11MeshGateAnnouncementProtocol =
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index b690144..ffec13e 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -443,7 +443,7 @@ static void ieee80211_mesh_path_root_timer(unsigned long data)
void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh)
{
- if (ifmsh->mshcfg.dot11MeshHWMPRootMode)
+ if (ifmsh->mshcfg.dot11MeshHWMPRootMode > 1)
set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
else {
clear_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
@ 2012-06-09 8:40 ` Johannes Berg
2012-06-09 8:41 ` Johannes Berg
2012-06-09 8:43 ` Johannes Berg
2 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:40 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
> + * @NL80211_MESHCONF_HWMP_ACTIVE_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.
In a separate patch, somebody really needs to go in and make this match
the style used everywhere else in this file, that is a tab instead of a
space in the continuation lines:
* @foo_member: bla bla bla ....
* bla bla bla
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
2012-06-09 8:40 ` Johannes Berg
@ 2012-06-09 8:41 ` Johannes Berg
2012-06-09 8:43 ` Johannes Berg
2 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:41 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -827,6 +827,8 @@ struct mesh_config {
> bool dot11MeshForwarding;
> s32 rssi_threshold;
> u16 ht_opmode;
> + u32 dot11MeshHWMPactivePathToRootTimeout;
> + u16 dot11MeshHWMProotInterval;
Also in a separate patch, this structure should have kernel-doc. Please
submit a patch for that before adding any more members (I'll take this
patch as-is for now)
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
2012-06-09 8:40 ` Johannes Berg
2012-06-09 8:41 ` Johannes Berg
@ 2012-06-09 8:43 ` Johannes Berg
2 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:43 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
Ok actually, I won't take it as-is:
> + if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ACTIVE_PATH_TO_ROOT_TIMEOUT,
> + mask))
that indentation is wrong
> + conf->dot11MeshHWMPactivePathToRootTimeout =
> + nconf->dot11MeshHWMPactivePathToRootTimeout;
> + if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask)) {
> + conf->dot11MeshHWMProotInterval =
> + nconf->dot11MeshHWMProotInterval;
> + }
that shouldn't have braces
> +IEEE80211_IF_FILE(dot11MeshHWMPactivePathToRootTimeout,
> + u.mesh.mshcfg.dot11MeshHWMPactivePathToRootTimeout, DEC);
> +IEEE80211_IF_FILE(dot11MeshHWMProotInterval,
> + u.mesh.mshcfg.dot11MeshHWMProotInterval, DEC);
that indentation is also wrong
> 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_ACTIVE_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);
and that, even though it matches the current surrounding style.
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/4] mac80211: implement the proactive PREQ generation
2012-06-07 4:39 ` [PATCH v2 2/4] mac80211: implement the proactive PREQ generation Chun-Yeow Yeoh
@ 2012-06-09 8:45 ` Johannes Berg
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:45 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
> + * @IEEE80211_NO_ROOT: the mesh STA is not a root mesh STA (default)
> + * @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA
> + * supports the proactive PREQ with proactive PREP subfield set to 0
please indent to make it readable
> mesh_path_tx_root_frame(sdata);
> + interval = (ifmsh->mshcfg.dot11MeshHWMPRootMode ==
> + IEEE80211_PROACTIVE_RANN) ? ifmsh->mshcfg.dot11MeshHWMPRannInterval
> + : ifmsh->mshcfg.dot11MeshHWMProotInterval;
that's a horrible way to write this, I suppose an if statement could
actually be readable :-)
> +++ b/net/mac80211/mesh_hwmp.c
> @@ -33,9 +33,11 @@
> /* Reply and forward */
> #define MP_F_RF 0x2
> /* Unknown Sequence Number */
> -#define MP_F_USN 0x01
> +#define MP_F_USN 0x04
> /* Reason code Present */
> #define MP_F_RCODE 0x02
> +/* Proactive PREQ with PREP */
> +#define PREQ_F_PREP 0x04
Should all of this really be here rather than in ieee80211.h?
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/4] mac80211: implement the proactive PREP generation
2012-06-07 4:39 ` [PATCH v2 3/4] mac80211: implement the proactive PREP generation Chun-Yeow Yeoh
@ 2012-06-09 8:46 ` Johannes Berg
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:46 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
> v2: adhere to Linux kernel coding style (Johannes)
> + if (!is_broadcast_ether_addr(target_addr)) {
> + mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
> + cpu_to_le32(orig_sn), 0, target_addr,
four spaces to indent? I don't think that's right right style :-)
This function really looks rife for refactoring, it's got way too many
indentation levels now.
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
2012-06-07 4:39 ` [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value Chun-Yeow Yeoh
@ 2012-06-09 8:46 ` Johannes Berg
2012-06-09 16:11 ` Yeoh Chun-Yeow
0 siblings, 1 reply; 13+ messages in thread
From: Johannes Berg @ 2012-06-09 8:46 UTC (permalink / raw)
To: Chun-Yeow Yeoh; +Cc: linux-wireless, javier, linville, devel
On Thu, 2012-06-07 at 12:39 +0800, Chun-Yeow Yeoh wrote:
> mesh_path_root_timer is invoked once the dot11MeshHWMPRootMode is larger than 1. This patch
> also adds the backward compatible to the previous setting on dot11MeshHWMPRootMode. If the
> user configures as follow, it will still trigger the proactive RANN with Gate Announcement.
>
> iw mesh0 set mesh_param mesh_hwmp_rootmode 1
> iw mesh0 set mesh_param mesh_gate_announcements 1
>
> similar to the following setting:
>
> iw mesh0 set mesh_param mesh_hwmp_rootmode 4
> iw mesh0 set mesh_param mesh_gate_announcements 1
>
> Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
> ---
> v2: use constant for dot11MeshHWMPRootMode assignment (Johannes)
>
> net/mac80211/cfg.c | 4 ++--
> net/mac80211/mesh.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index 38e743f..85c6601 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1564,8 +1564,8 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
> * announcements, so require this ifmsh to also be a root node
> * */
> if (nconf->dot11MeshGateAnnouncementProtocol &&
> - !conf->dot11MeshHWMPRootMode) {
> - conf->dot11MeshHWMPRootMode = 1;
> + !(conf->dot11MeshHWMPRootMode > 1)) {
> + conf->dot11MeshHWMPRootMode = IEEE80211_PROACTIVE_RANN;
so, humm, there's still the same constant here.
> - if (ifmsh->mshcfg.dot11MeshHWMPRootMode)
> + if (ifmsh->mshcfg.dot11MeshHWMPRootMode > 1)
and here.
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
2012-06-09 8:46 ` Johannes Berg
@ 2012-06-09 16:11 ` Yeoh Chun-Yeow
2012-06-11 7:24 ` Johannes Berg
0 siblings, 1 reply; 13+ messages in thread
From: Yeoh Chun-Yeow @ 2012-06-09 16:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, javier, linville, devel
> so, humm, there's still the same constant here.
>
> and here.
>
Possible to stick to the number, because in the standard it define
(0) no root
(2) proactive PREQ no PREP
(3) proactive RPEQ with PREP
(4) RANN
Not so sure what's the proper naming for this constant.
Chun-Yeow
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
2012-06-09 16:11 ` Yeoh Chun-Yeow
@ 2012-06-11 7:24 ` Johannes Berg
0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2012-06-11 7:24 UTC (permalink / raw)
To: Yeoh Chun-Yeow; +Cc: linux-wireless, javier, linville, devel
On Sun, 2012-06-10 at 00:11 +0800, Yeoh Chun-Yeow wrote:
> > so, humm, there's still the same constant here.
> >
> > and here.
> >
>
> Possible to stick to the number, because in the standard it define
> (0) no root
> (2) proactive PREQ no PREP
> (3) proactive RPEQ with PREP
> (4) RANN
>
> Not so sure what's the proper naming for this constant.
You could make up a name, or use >= 2 instead of > 1 ?
johannes
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-06-11 7:24 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07 4:39 [PATCH v2 0/4] Support proactive PREQ mechanism in Mesh Chun-Yeow Yeoh
2012-06-07 4:39 ` [PATCH v2 1/4] {nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToRootTimeout Chun-Yeow Yeoh
2012-06-09 8:40 ` Johannes Berg
2012-06-09 8:41 ` Johannes Berg
2012-06-09 8:43 ` Johannes Berg
2012-06-07 4:39 ` [PATCH v2 2/4] mac80211: implement the proactive PREQ generation Chun-Yeow Yeoh
2012-06-09 8:45 ` Johannes Berg
2012-06-07 4:39 ` [PATCH v2 3/4] mac80211: implement the proactive PREP generation Chun-Yeow Yeoh
2012-06-09 8:46 ` Johannes Berg
2012-06-07 4:39 ` [PATCH v2 4/4] mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value Chun-Yeow Yeoh
2012-06-09 8:46 ` Johannes Berg
2012-06-09 16:11 ` Yeoh Chun-Yeow
2012-06-11 7:24 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox