From patchwork Mon Jun 4 11:41:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 162760 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7DA21B6FBB for ; Mon, 4 Jun 2012 21:41:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id BCD039D242; Mon, 4 Jun 2012 07:41:19 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bQ-cYsIL37xy; Mon, 4 Jun 2012 07:41:19 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 88E879D243; Mon, 4 Jun 2012 07:41:03 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 94CAB9D23F for ; Mon, 4 Jun 2012 07:41:01 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fkp7PLDjUzhc for ; Mon, 4 Jun 2012 07:40:57 -0400 (EDT) Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "smtp.autistici.org", Issuer "Autistici/Inventati Certification Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id CDD409D231 for ; Mon, 4 Jun 2012 07:40:52 -0400 (EDT) Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 4D4F198A42; Mon, 4 Jun 2012 11:40:51 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org 4D4F198A42 From: Antonio Quartulli To: hostap Subject: [RFC-PATCH 2/2] driver_nl80211: use new parameters during ibss join Date: Mon, 4 Jun 2012 13:41:12 +0200 Message-Id: <1338810072-31040-3-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.9.4 In-Reply-To: <1338810072-31040-1-git-send-email-ordex@autistici.org> References: <1338810072-31040-1-git-send-email-ordex@autistici.org> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Signed-hostap: Antonio Quartulli --- src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 693a885..f5d8d2e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6429,7 +6429,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv, struct wpa_driver_associate_params *params) { struct nl_msg *msg; - int ret = -1; + int ret = -1, i; int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); @@ -6462,6 +6462,37 @@ retry: wpa_printf(MSG_DEBUG, " * freq=%d", params->freq); NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq); + if (params->fixed_freq) { + wpa_printf(MSG_DEBUG, " * fixed_freq"); + NLA_PUT_FLAG(msg, NL80211_ATTR_FREQ_FIXED); + } + + if (params->beacon_interval > 0) { + wpa_printf(MSG_DEBUG, " * beacon_interval=%d", + params->beacon_interval); + NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, + params->beacon_interval); + } + + if (params->rates[0] > 0) { + wpa_printf(MSG_DEBUG, " * basic_rates:"); + i = 0; + while (i < NL80211_MAX_SUPP_RATES && + params->rates[i] > 0) { + wpa_printf(MSG_DEBUG, " %f", + (double)params->rates[i] / 2); + i++; + } + NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, i, + params->rates); + } + + if (params->mcast_rate > 0) { + wpa_printf(MSG_DEBUG, " * mcast_rates=%.1f", + (double)params->mcast_rate / 10); + NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); + } + ret = nl80211_set_conn_keys(params, msg); if (ret) goto nla_put_failure;