2012-04-13 00:45:19

by Ashok Nagarajan

[permalink] [raw]
Subject: [PATCH 1/2] iw: add mesh conf parameter "mesh_sync_offset_max_neighor"

Maximum number of neighbors to synchronize to for mesh default synchronization
method

Signed-off-by: Marco Porsch <[email protected]>
---
mesh.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/mesh.c b/mesh.c
index b2c7208..12147a2 100644
--- a/mesh.c
+++ b/mesh.c
@@ -116,6 +116,11 @@ static void _print_u16_in_TUs(struct nlattr *a)
printf("%d TUs", nla_get_u16(a));
}

+static void _print_u32(struct nlattr *a)
+{
+ printf("%d", nla_get_u32(a));
+}
+
static void _print_u32_timeout(struct nlattr *a)
{
printf("%u milliseconds", nla_get_u32(a));
@@ -179,6 +184,9 @@ const static struct mesh_param_descr _mesh_param_descrs[] =
_my_nla_put_u8, _parse_u8, _print_u8},
{"mesh_fwding", NL80211_MESHCONF_FORWARDING,
_my_nla_put_u8, _parse_u8_as_bool, _print_u8},
+ {"mesh_sync_offset_max_neighor",
+ NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
+ _my_nla_put_u32, _parse_u32, _print_u32},
};

static void print_all_mesh_param_descr(void)
--
1.7.5.4



2012-04-13 00:45:20

by Ashok Nagarajan

[permalink] [raw]
Subject: [PATCH 2/2] iw: allow user to enable vendor synchronization when joining mesh

Currently this option just disables the default neighbor offset
synchronization method. It is useful for testing.

Signed-off-by: Marco Porsch <[email protected]>
---
mesh.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/mesh.c b/mesh.c
index 12147a2..4a3c29e 100644
--- a/mesh.c
+++ b/mesh.c
@@ -352,6 +352,7 @@ COMMAND(get, mesh_param, "[<param>]",
static int join_mesh(struct nl80211_state *state, struct nl_cb *cb,
struct nl_msg *msg, int argc, char **argv)
{
+ struct nlattr *container;
float rate;
char *end;

@@ -375,13 +376,34 @@ static int join_mesh(struct nl80211_state *state, struct nl_cb *cb,
argc--;
}

+ container = nla_nest_start(msg, NL80211_ATTR_MESH_SETUP);
+ if (!container)
+ return -ENOBUFS;
+
+ if (argc > 1 && strcmp(argv[0], "vendor_sync") == 0) {
+ argv++;
+ argc--;
+ if (strcmp(argv[0], "on") == 0)
+ NLA_PUT_U8(msg,
+ NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 1);
+ else
+ NLA_PUT_U8(msg,
+ NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 0);
+ argv++;
+ argc--;
+ }
+ /* parse and put other NL80211_ATTR_MESH_SETUP elements here */
+
+ nla_nest_end(msg, container);
+
if (!argc)
return 0;
return set_interface_meshparam(state, cb, msg, argc, argv);
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(mesh, join, "<mesh ID> [mcast-rate <rate in Mbps>] [<param>=<value>]*",
+COMMAND(mesh, join, "<mesh ID> [mcast-rate <rate in Mbps>] [vendor_sync on|off]"
+ " [<param>=<value>]*",
NL80211_CMD_JOIN_MESH, 0, CIB_NETDEV, join_mesh,
"Join a mesh with the given mesh ID with mcast-rate and mesh parameters.");

--
1.7.5.4