From patchwork Wed Oct 27 03:07:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 284552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9R381WY009618 for ; Wed, 27 Oct 2010 03:08:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933883Ab0J0DH4 (ORCPT ); Tue, 26 Oct 2010 23:07:56 -0400 Received: from mail30t.wh2.ocn.ne.jp ([125.206.180.136]:21592 "HELO mail30t.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S933636Ab0J0DHz (ORCPT ); Tue, 26 Oct 2010 23:07:55 -0400 Received: from vs3008.wh2.ocn.ne.jp (125.206.180.171) by mail30t.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 4-082748872 for ; Wed, 27 Oct 2010 12:07:53 +0900 (JST) Received: (qmail 18952 invoked from network); 27 Oct 2010 03:07:52 -0000 Received: from unknown (HELO localhost6.localdomain6) (220.110.201.18) by with SMTP; 27 Oct 2010 03:07:52 -0000 Subject: [PATCH v2] iw: Add ibss join parameter for beacon interval To: johannes@sipsolutions.net, linville@tuxdriver.com From: Bruno Randolf Cc: linux-wireless@vger.kernel.org Date: Wed, 27 Oct 2010 12:07:56 +0900 Message-ID: <20101027030756.29191.4213.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Oct 2010 03:08:02 +0000 (UTC) diff --git a/ibss.c b/ibss.c index e85ef1d..1d24ad2 100644 --- a/ibss.c +++ b/ibss.c @@ -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], "beacon-interval") == 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,11 +118,12 @@ COMMAND(ibss, leave, NULL, NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss, "Leave the current IBSS cell."); COMMAND(ibss, join, - " [fixed-freq] [] " - "[basic-rates ] [key d:0:abcde]", + " [fixed-freq] [] [beacon-interval " + "] [basic-rates ] [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 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).");