From patchwork Wed Nov 7 09:58:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1709511 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 48069DFB7A for ; Wed, 7 Nov 2012 09:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987Ab2KGJ6y (ORCPT ); Wed, 7 Nov 2012 04:58:54 -0500 Received: from latitanza.investici.org ([82.94.249.234]:61770 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927Ab2KGJ6x (ORCPT ); Wed, 7 Nov 2012 04:58:53 -0500 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id CB39198134; Wed, 7 Nov 2012 09:58:51 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org CB39198134 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1352282332; bh=hkDfY8kzvlb2+v6dZXMsf9NfSHaXUfEWldB9hRSNY7c=; h=From:To:Cc:Subject:Date:Message-Id; b=pciEYPkM1qdqggxqSVBhAbqHYDjTmz0p76Ngnlt9un+uRjfeklGJlUz2nyB3TunVi AN1+JjGeky37KJr8Ww1/d8ImkqjjYQL1jfSBAPih9Co37zH7MvSKKp4hvD7iXC3/iX nVxI/EwxX2OuWlqOL12JmVc1AYU+G2gv70oLP/Fg= From: Antonio Quartulli To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCH] iw: add set_mcast_rate command support Date: Wed, 7 Nov 2012 10:58:03 +0100 Message-Id: <1352282283-31254-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- interface.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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, "", 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, "", + NL80211_CMD_SET_MCAST_RATE, 0, CIB_NETDEV, set_mcast_rate, + "Set the multicast bitrate.");