Search Linux Wireless

[PATCH] Support mcast-rate in Mesh Node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chun-Yeow Yeoh <yeohchunyeow@xxxxxxxxx>

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@xxxxxxxxx>
---
 mesh.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/mesh.c b/mesh.c
index dc8f49c..bdd5d1d 100644
--- a/mesh.c
+++ b/mesh.c
@@ -342,6 +342,9 @@ 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)
 {
+	float rate = 0;
+	char *end;
+
 	if (argc < 1)
 		return 1;
 
@@ -349,15 +352,34 @@ static int join_mesh(struct nl80211_state *state, struct nl_cb *cb,
 	argc--;
 	argv++;
 
+	if (argc) {
+		if (strcmp(argv[0], "mcast-rate") == 0) {
+			argc--;
+			argv++;
+
+			rate = strtod(argv[0], &end);
+			if (*end != '\0')
+				return 0;
+
+			if (rate)
+				NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE,
+						(int)(rate * 10));
+
+				argv++;
+				argc--;
+		}
+	}
+
 	if (!argc)
 		return 0;
+
 	return set_interface_meshparam(state, cb, msg, argc, argv);
  nla_put_failure:
 	return -ENOBUFS;
 }
-COMMAND(mesh, join, "<mesh ID> [<param>=<value>]*",
+COMMAND(mesh, join, "<mesh ID> [mcast-rate <rate in Mbps>] [<param>=<value>]*",
 	NL80211_CMD_JOIN_MESH, 0, CIB_NETDEV, join_mesh,
-	"Join a mesh with the given mesh ID and mesh parameters.");
+	"Join a mesh with the given mesh ID with mcast-rate and mesh parameters.");
 
 static int leave_mesh(struct nl80211_state *state, struct nl_cb *cb,
 		      struct nl_msg *msg, int argc, char **argv)
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux