diff mbox

iw: add set_mcast_rate command support

Message ID 1352282283-31254-1-git-send-email-ordex@autistici.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Antonio Quartulli Nov. 7, 2012, 9:58 a.m. UTC
This patch adds the support to run the set_mcast_rate() command on
adhoc and mesh_point vifs. With this command it is possible to tune
the bitrate to use when sending group frames. This command can be used
even if the vifs has already joint the ibss/mesh network.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
 interface.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Antonio Quartulli Nov. 7, 2012, 11:50 a.m. UTC | #1
On Wed, Nov 07, 2012 at 10:58:03AM +0100, Antonio Quartulli wrote:
> This patch adds the support to run the set_mcast_rate() command on
> adhoc and mesh_point vifs. With this command it is possible to tune
> the bitrate to use when sending group frames. This command can be used
> even if the vifs has already joint the ibss/mesh network.
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>

ops, I forgot to say that nl80211.h in the iw package must be updated to let
this change work.

Cheers,
Johannes Berg Nov. 19, 2012, 2:41 p.m. UTC | #2
On Wed, 2012-11-07 at 10:58 +0100, Antonio Quartulli wrote:
> This patch adds the support to run the set_mcast_rate() command on
> adhoc and mesh_point vifs. With this command it is possible to tune
> the bitrate to use when sending group frames. This command can be used
> even if the vifs has already joint the ibss/mesh network.

Applied.

johannes

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

Patch

diff --git a/interface.c b/interface.c
index 945362f..87ac617 100644
--- a/interface.c
+++ b/interface.c
@@ -490,3 +490,32 @@  static int handle_interface_wds_peer(struct nl80211_state *state,
 COMMAND(set, peer, "<MAC address>",
 	NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer,
 	"Set interface WDS peer.");
+
+static int set_mcast_rate(struct nl80211_state *state,
+			  struct nl_cb *cb,
+			  struct nl_msg *msg,
+			  int argc, char **argv,
+			  enum id_input id)
+{
+	float rate;
+	char *end;
+
+	if (argc != 1) {
+		printf("Invalid parameters!\n");
+		return 2;
+	}
+
+	rate = strtod(argv[0], &end);
+	if (*end != '\0')
+		return 1;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int)(rate * 10));
+
+	return 0;
+nla_put_failure:
+	return -ENOBUFS;
+}
+
+COMMAND(set, mcast_rate, "<rate in Mbps>",
+	NL80211_CMD_SET_MCAST_RATE, 0, CIB_NETDEV, set_mcast_rate,
+	"Set the multicast bitrate.");