Skip to contentSkip to conversation

iw: Add ibss join parameter for beacon interval

PATCH Superseded Bruno Randolf 2 participants 3 messages Oct 19, 2010 – Oct 26, 2010

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: Add ibss join parameter for beacon interval

NL80211_ATTR_BEACON_INTERVAL already exists, we just have to use it.

---
 ibss.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
ibss.c +11 -1
index e85ef1d..e1b6765 100644
@@ -26,6 +26,7 @@ static int join_ibss(struct nl80211_state *state,
 	int n_rates = 0;
 	char *value = NULL, *sptr = NULL;
 	float rate;
+	int bintval;
 
 	if (argc < 2)
 		return 1;
@@ -57,6 +58,15 @@ static int join_ibss(struct nl80211_state *state,
 		}
 	}
 
+	if (argc > 1 && strcmp(argv[0], "bintval") == 0) {
+		argv++;
+		argc--;
+		bintval = strtoul(argv[0], &end, 10);
+		NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, bintval);
+		argv++;
+		argc--;
+	}
+
 	/* basic rates */
 	if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
 		argv++;
@@ -108,7 +118,7 @@ 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>] "
+	"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [bintval <ms>] "
 	"[basic-rates <rate in Mbps,rate2,...>] [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"
#1 lore raw

ibss.c static int join_ibss(struct nl80211_state *state, · line 61

Quoted 1 line · Bruno Randolf
ibss.c +1 -0
+	if (argc > 1 && strcmp(argv[0], "bintval") == 0) {

I'd prefer this to be called just "bi" or fully spelt out.

ibss.c COMMAND(ibss, leave, NULL, · line 121

Quoted 5 lines
ibss.c +1 -1
 	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>] "
+	"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [bintval <ms>] "

It's not in ms, but TU. *sigh*

johannes

#2 lore raw
Quoted 4 lines · On Mon October 25 2010 17:26:16 Johannes Berg wrote:

ibss.c static int join_ibss(struct nl80211_state *state, · line 61

Quoted 1 line · Bruno Randolf
ibss.c +1 -0
+	if (argc > 1 && strcmp(argv[0], "bintval") == 0) {

I'd prefer this to be called just "bi" or fully spelt out.

o.k.

Quoted 9 lines

ibss.c COMMAND(ibss, leave, NULL, · line 121

Quoted 7 lines
ibss.c +1 -1
 	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>] "
+	"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [bintval <ms>] "

It's not in ms, but TU. *sigh*

oh, true. i forgot. will change.

bruno