From patchwork Fri Oct 26 14:41:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1652121 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A97D4DF2F6 for ; Fri, 26 Oct 2012 14:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933308Ab2JZOmb (ORCPT ); Fri, 26 Oct 2012 10:42:31 -0400 Received: from latitanza.investici.org ([82.94.249.234]:54840 "EHLO latitanza.investici.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932544Ab2JZOma (ORCPT ); Fri, 26 Oct 2012 10:42:30 -0400 Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id A0532981D9; Fri, 26 Oct 2012 14:42:28 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org A0532981D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1351262549; bh=4P2S7xFxyyB6X6wgWWfVvMHokub0kPfDbVEkgSUakjA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Zlbb7EsYyQqNfXgPWDq/CAilf1nv85zW8ZqzH82juZKxlvPPWZTBnzPeCwr92OgnA 8tkNEI4q6T+A4kLaK4XoPq3QlvFLJb4qNSaYqqxqSy+qx6yxLF8t6cuEreAFc9WMxM AxXU5eHD/ryOWo9sjGm9q8n0zrqRsUU8+Vnoec/Q= From: Antonio Quartulli To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [PATCH 2/2] iw: add support for the forced AP scan Date: Fri, 26 Oct 2012 16:41:48 +0200 Message-Id: <1351262508-23386-2-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351262508-23386-1-git-send-email-ordex@autistici.org> References: <1351262508-23386-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 This patch introduces the "ap-force" argument to the scan command. This argument instructs mac80211 to trigger the scan even if the interface is configured as AP and has already started beaconing (the driver may not support such operation) Signed-off-by: Antonio Quartulli --- scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scan.c b/scan.c index 91984e5..73fb3fe 100644 --- a/scan.c +++ b/scan.c @@ -103,6 +103,10 @@ static int handle_scan(struct nl80211_state *state, parse = NONE; flags |= NL80211_SCAN_FLAG_FLUSH; break; + } else if (strcmp(argv[i], "ap-force") == 0) { + parse = NONE; + flags |= NL80211_SCAN_FLAG_AP; + break; } else if (strcmp(argv[i], "ssid") == 0) { parse = SSID; have_ssids = true; @@ -1355,7 +1359,7 @@ static int handle_scan_combined(struct nl80211_state *state, dump_argv[0] = argv[0]; return handle_cmd(state, id, dump_argc, dump_argv); } -TOPLEVEL(scan, "[-u] [freq *] [ies ] [lowpri,flush] [ssid *|passive]", 0, 0, +TOPLEVEL(scan, "[-u] [freq *] [ies ] [lowpri,flush,ap-force] [ssid *|passive]", 0, 0, CIB_NETDEV, handle_scan_combined, "Scan on the given frequencies and probe for the given SSIDs\n" "(or wildcard if not given) unless passive scanning is requested.\n" @@ -1365,7 +1369,7 @@ COMMAND(scan, dump, "[-u]", NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump, "Dump the current scan results. If -u is specified, print unknown\n" "data in scan results."); -COMMAND(scan, trigger, "[freq *] [ies ] [lowpri,flush] [ssid *|passive]", +COMMAND(scan, trigger, "[freq *] [ies ] [lowpri,flush,ap-force] [ssid *|passive]", NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan, "Trigger a scan on the given frequencies with probing for the given\n" "SSIDs (or wildcard if not given) unless passive scanning is requested.");