From patchwork Fri Aug 9 16:58:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2842061 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBAB5BF546 for ; Fri, 9 Aug 2013 17:01:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBB39202A7 for ; Fri, 9 Aug 2013 17:01:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A0A620292 for ; Fri, 9 Aug 2013 17:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968255Ab3HIRBT (ORCPT ); Fri, 9 Aug 2013 13:01:19 -0400 Received: from contumacia.investici.org ([178.255.144.35]:60729 "EHLO contumacia.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967928Ab3HIRBS (ORCPT ); Fri, 9 Aug 2013 13:01:18 -0400 Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id D3639E82F7; Fri, 9 Aug 2013 17:01:15 +0000 (UTC) X-DKIM: OpenDKIM Filter v2.6.8 contumacia.investici.org D3639E82F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1376067676; bh=QwfzNf/rLsWp0XY6lZE2dEW8S86JgPGhCkp92A/lz6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ff5QPGjAatRs7xcpmSRrS8T22664Lp7ydchmPJyYD5ysy4bBeWH195asRNI0js/PT bBwNCL0WpMvq4BylbXo2dZpXgCL4LCWOuodEyH9p+168YKukko9SO1FqQfo6qlTCHI vqefyYJLah1Ti4N+9rQcjn+XstRI6HDNo9czD6CU= From: Antonio Quartulli To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCHv2] mac80211: ibss - do not scan if not needed when creating an IBSS Date: Fri, 9 Aug 2013 18:58:32 +0200 Message-Id: <1376067512-733-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1375862917-3625-1-git-send-email-ordex@autistici.org> References: <1375862917-3625-1-git-send-email-ordex@autistici.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Antonio Quartulli In some cases mac80211 will scan before creating an IBSS even if bssid and frequency have been forced by the user. This is not needed and leads only to a delay in the IBSS establishment phase. Immediately create the cell if both bssid and frequency (and fixed_freq is set) have been specified. Signed-off-by: Antonio Quartulli --- net/mac80211/ibss.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index e08387c..79e294e 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -891,6 +891,17 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) return; } + /* if a fixed bssid and a fixed freq have been provided create the IBSS + * directly and do not waste time scanning + */ + if (ifibss->fixed_bssid && ifibss->fixed_channel) { + sdata_info(sdata, "Created IBSS using preconfigured BSSID %pM\n", + bssid); + ieee80211_sta_create_ibss(sdata); + return; + } + + ibss_dbg(sdata, "sta_find_ibss: did not try to join ibss\n"); /* Selected IBSS not found in current scan results - try to scan */