From patchwork Tue Jun 26 08:05:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Bursztyka X-Patchwork-Id: 167332 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 0AC071007DB for ; Tue, 26 Jun 2012 18:07:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1BD0C9D287; Tue, 26 Jun 2012 04:07:32 -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 P7I7GHJfwEH0; Tue, 26 Jun 2012 04:07:31 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1F62B9D288; Tue, 26 Jun 2012 04:06:31 -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 8685E9D27A for ; Tue, 26 Jun 2012 04:06:28 -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 dK8cxTGx7AaS for ; Tue, 26 Jun 2012 04:06:24 -0400 (EDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id AFE889D231 for ; Tue, 26 Jun 2012 04:06:15 -0400 (EDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 26 Jun 2012 01:06:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="162733321" Received: from mriya.fi.intel.com ([10.237.68.149]) by orsmga002.jf.intel.com with ESMTP; 26 Jun 2012 01:06:09 -0700 From: Tomasz Bursztyka To: hostap@lists.shmoo.com Subject: [PATCH 5/7] Adding autoscan command into wpa_cli Date: Tue, 26 Jun 2012 11:05:50 +0300 Message-Id: <1340697952-4209-6-git-send-email-tomasz.bursztyka@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1340697952-4209-1-git-send-email-tomasz.bursztyka@linux.intel.com> References: <1340697952-4209-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 d1c421d..b7f058e 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -2811,6 +2811,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 @@ -3181,6 +3204,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 } };