]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: add multicast rates to IBSS join
authorFelix Fietkau <nbd@openwrt.org>
Tue, 11 Jan 2011 00:51:18 +0000 (09:51 +0900)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Jan 2011 08:32:40 +0000 (09:32 +0100)
Add multicast rates to IBSS join command.

This patch comes from OpenWRT.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Bruno Randolf <br1@einfach.org>
ibss.c

diff --git a/ibss.c b/ibss.c
index 84ea7f277f42b2048323f1ceaf6b4867f130e1a5..ca8a4ec8262870018e54be0f745fbdbc55a28b7e 100644 (file)
--- a/ibss.c
+++ b/ibss.c
@@ -95,6 +95,20 @@ static int join_ibss(struct nl80211_state *state,
                argc--;
        }
 
+       /* multicast rate */
+       if (argc > 1 && strcmp(argv[0], "mcast-rate") == 0) {
+               argv++;
+               argc--;
+
+               rate = strtod(argv[0], &end);
+               if (*end != '\0')
+                       return 1;
+
+               NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int) rate * 10);
+               argv++;
+               argc--;
+       }
+
        if (!argc)
                return 0;
 
@@ -120,12 +134,13 @@ COMMAND(ibss, leave, NULL,
        NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
        "Leave the current IBSS cell.");
 COMMAND(ibss, join,
-       "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval "
-       "<TU>] [basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
+       "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval <TU>]"
+       " [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] "
+       "[key d:0:abcde]",
        NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
        "Join the IBSS cell with the given SSID, if it doesn't exist create\n"
        "it on the given frequency. When fixed frequency is requested, don't\n"
        "join/create a cell on a different frequency. When a fixed BSSID is\n"
        "requested use that BSSID and do not adopt another cell's BSSID even\n"
        "if it has higher TSF and the same SSID. If an IBSS is created, create\n"
-       "it with the specified basic-rates and beacon-interval (in TU).");
+       "it with the specified basic-rates, multicast-rate and beacon-interval.");