iw: Fix data types for iw survey channel time
[openwrt.git] / package / iw / patches / 501-ibss-bintval.patch
1 iw: Add ibss join parameter for beacon interval
2
3 From: Bruno Randolf <br1@einfach.org>
4
5 NL80211_ATTR_BEACON_INTERVAL already exists, we just have to use it.
6
7 Signed-off-by: Bruno Randolf <br1@einfach.org>
8 ---
9 ibss.c | 19 ++++++++++++++++---
10 1 files changed, 16 insertions(+), 3 deletions(-)
11
12 diff --git a/ibss.c b/ibss.c
13 index ed2c73a..9c9c133 100644
14 --- a/ibss.c
15 +++ b/ibss.c
16 @@ -26,6 +26,7 @@ static int join_ibss(struct nl80211_state *state,
17 int n_rates = 0;
18 char *value = NULL, *sptr = NULL;
19 float rate;
20 + int bintval;
21
22 if (argc < 2)
23 return 1;
24 @@ -57,6 +58,17 @@ static int join_ibss(struct nl80211_state *state,
25 }
26 }
27
28 + if (argc > 1 && strcmp(argv[0], "beacon-interval") == 0) {
29 + argv++;
30 + argc--;
31 + bintval = strtoul(argv[0], &end, 10);
32 + if (*end != '\0')
33 + return 1;
34 + NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, bintval);
35 + argv++;
36 + argc--;
37 + }
38 +
39 /* basic rates */
40 if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
41 argv++;
42 @@ -122,11 +134,12 @@ COMMAND(ibss, leave, NULL,
43 NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
44 "Leave the current IBSS cell.");
45 COMMAND(ibss, join,
46 - "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
47 - "[basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]",
48 + "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval "
49 + "<TU>] [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]",
50 NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
51 "Join the IBSS cell with the given SSID, if it doesn't exist create\n"
52 "it on the given frequency. When fixed frequency is requested, don't\n"
53 "join/create a cell on a different frequency. When a fixed BSSID is\n"
54 "requested use that BSSID and do not adopt another cell's BSSID even\n"
55 - "if it has higher TSF and the same SSID.");
56 + "if it has higher TSF and the same SSID. If an IBSS is created, create\n"
57 + "it with the specified basic-rates and beacon-interval (in TU).");
This page took 0.051416 seconds and 5 git commands to generate.