From patchwork Thu May 3 13:16:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Bursztyka X-Patchwork-Id: 156695 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]) by ozlabs.org (Postfix) with ESMTP id 20E73B6F9D for ; Thu, 3 May 2012 23:16:06 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B201E9C1A3; Thu, 3 May 2012 09:15:58 -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 GHoQdIaIIs88; Thu, 3 May 2012 09:15:58 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C87589D272; Thu, 3 May 2012 09:15:07 -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 33E9617C04C for ; Thu, 3 May 2012 09:15:06 -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 oYni7xMnvDAK for ; Thu, 3 May 2012 09:15:02 -0400 (EDT) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4C0B49D264 for ; Thu, 3 May 2012 09:14:58 -0400 (EDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 03 May 2012 06:14:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="138434986" Received: from mriya.fi.intel.com ([10.237.68.145]) by azsmga001.ch.intel.com with ESMTP; 03 May 2012 06:14:57 -0700 From: Tomasz Bursztyka To: hostap@lists.shmoo.com Subject: [PATCH 5/7] Adding autoscan command into wpa_cli Date: Thu, 3 May 2012 16:16:54 +0300 Message-Id: <1336051016-15005-6-git-send-email-tomasz.bursztyka@linux.intel.com> X-Mailer: git-send-email 1.7.8.5 In-Reply-To: <1336051016-15005-1-git-send-email-tomasz.bursztyka@linux.intel.com> References: <1336051016-15005-1-git-send-email-tomasz.bursztyka@linux.intel.com> 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: Tomasz Bursztyka --- wpa_supplicant/wpa_cli.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index 18759ab..2a13085 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -2756,6 +2756,29 @@ static int wpa_cli_cmd_reauthenticate(struct wpa_ctrl *ctrl, int argc, } +#ifdef CONFIG_AUTOSCAN + +static int wpa_cli_cmd_autoscan(struct wpa_ctrl *ctrl, int argc, + char *argv[]) +{ + char cmd[256]; + int res; + + if (argc == 0) + return wpa_ctrl_command(ctrl, "AUTOSCAN "); + + res = os_snprintf(cmd, sizeof(cmd), "AUTOSCAN %s", argv[0]); + if (res < 0 || (size_t) res >= sizeof(cmd) - 1) { + printf("Too long AUTOSCAN command.\n"); + return -1; + } + + return wpa_ctrl_command(ctrl, cmd); +} + +#endif /**/ + + enum wpa_cli_cmd_flags { cli_cmd_flag_none = 0x00, cli_cmd_flag_sensitive = 0x01 @@ -3118,6 +3141,10 @@ static struct wpa_cli_cmd wpa_cli_commands[] = { "= get signal parameters" }, { "reauthenticate", wpa_cli_cmd_reauthenticate, cli_cmd_flag_none, "= trigger IEEE 802.1X/EAPOL reauthentication" }, +#ifdef CONFIG_AUTOSCAN + { "autoscan", wpa_cli_cmd_autoscan, cli_cmd_flag_none, + "[params] = Set or unset (if none) autoscan parameters" }, +#endif /* CONFIG_AUTOSCAN */ { NULL, NULL, cli_cmd_flag_none, NULL } };