From patchwork Thu Mar 13 22:12:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Shmidt X-Patchwork-Id: 330137 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 ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DCE522C00CA for ; Fri, 14 Mar 2014 09:13:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B2F289D21C; Thu, 13 Mar 2014 18:13:22 -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 IHlVP1r3lfWT; Thu, 13 Mar 2014 18:13:22 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 084329D1E1; Thu, 13 Mar 2014 18:13:18 -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 5D2D59D1E1 for ; Thu, 13 Mar 2014 18:13:17 -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 sQ94VvBobZVq for ; Thu, 13 Mar 2014 18:13:12 -0400 (EDT) Received: from mail-ve0-f202.google.com (mail-ve0-f202.google.com [209.85.128.202]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 532DB9C1A7 for ; Thu, 13 Mar 2014 18:13:12 -0400 (EDT) Received: by mail-ve0-f202.google.com with SMTP id pa12so219321veb.1 for ; Thu, 13 Mar 2014 15:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:date:subject:to:message-id; bh=5z9vjLuPwJrktcw/3QcZR8jg+m2TyYa0OSf+a9m7/lg=; b=IP6L5Hy6hTIW+q3jokLI7FsUJG9xoI9q26vlzYqy6c1iAcP6i3SqJSspLcv6nvriet Vl/T3ltmTZX/ZzOP6p4BQhmN3Ym8dY1xtuRa9nvhrN8pka1Tn1QD8OMu7wRUK56wO8ps 7mhmsnprn4LweSFYDT9eU3dZInRbVH8K9UghOL2K8uIS2aLz+8+bktRV4EGjW7eJ1Mgr 9Iwy/zx7n/Rjco3RPVH8TlAyotRnUYT0oCer75VNFKCB0iksIY8fVXJ3U2HfxBeR+x/6 qce+LxJTWKoH+TBiVeXUCMKlkdAv4zP7LMCkK5HI4YN+mkOkBfztCa51kSbQStCLvdLi nLjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:subject:to:message-id; bh=5z9vjLuPwJrktcw/3QcZR8jg+m2TyYa0OSf+a9m7/lg=; b=c3J9k1oESt7IHXJtmOxdnRX/Osc/NOFMah16PmmbjIiY7PH3oKdudO+M6ZjtIZxnaX GUx8XcTkl/KFgx7+TAPjO20D0Tv+5ZfttsKwV9P52CJT9Va8U4w6DLFngtMEDnNQ381v JdWdnLw9yzO1HB+v87HV1A5MNpF5yB7tVKUoJTfVJHxXxIYLM9lacr312cpkH9Euq6EU 8j2hHImwe9aH44hVVRrF7lEY5OrcAiKG+E8IgMN2vFP7T1AGZqC6UfbrHGVcAglX1MAH reqyqOLlYVzt6R9G+IinVRkhuDnC4lPAxXNZyQRU/V/2LY8JZkV2ZLsIJxGvqVZuLNoD c9KA== X-Gm-Message-State: ALoCoQn9U1EuLdoF5nqZCa/L8RswmCkflzA5iFxgyYuDRXQzZaPLhSsQqHY17tYeB0E4DqLp0JlJHpVljgwbbSVgeVkoha8PmX67OPE8E9Ew8U45fOHPkOosyPtRunHrZa1jb3WqY/hYRx8w/oxxNyQH4k6ahim8GIf/TLU/XIdIhQzYU3tHBAkox4uoMnydKZ2fD3pMg1n3GRQmuyJq/BJYYAr2bDH5lJ3zJ93ufbV4iq04sFAx8TE= X-Received: by 10.236.92.204 with SMTP id j52mr1570205yhf.26.1394748791800; Thu, 13 Mar 2014 15:13:11 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id f21si576589yhn.2.2014.03.13.15.13.11 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Mar 2014 15:13:11 -0700 (PDT) Received: from ushik.mtv.corp.google.com (ushik.mtv.corp.google.com [172.18.120.113]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 9D4D55A4016 for ; Thu, 13 Mar 2014 15:13:11 -0700 (PDT) Received: by ushik.mtv.corp.google.com (Postfix, from userid 57417) id 36BC113F8B1; Thu, 13 Mar 2014 15:13:11 -0700 (PDT) From: Dmitry Shmidt Date: Thu, 13 Mar 2014 15:12:38 -0700 Subject: [PATCH] TDLS: Add get_capability tdls command To: hostap@lists.shmoo.com Message-Id: <20140313221311.36BC113F8B1@ushik.mtv.corp.google.com> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 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 Command returns info in format: UNSUPPORTED/INTERNAL/EXTERNAL Change-Id: I3bc1cc02c03c5a8b7cbaeaef302e2860d1356950 Signed-off-by: Dmitry Shmidt --- wpa_supplicant/ctrl_iface.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 98c4b65..f215e3a 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -538,6 +538,21 @@ static int wpa_supplicant_ctrl_iface_tdls_teardown( return ret; } + +static int ctrl_iface_get_capability_tdls( + struct wpa_supplicant *wpa_s, char *buf, size_t buflen) +{ + int ret; + + ret = os_snprintf(buf, buflen, "%s\n", + wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_SUPPORT ? + wpa_s->drv_flags & WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP ? + "EXTERNAL" : "INTERNAL" : "UNSUPPORTED"); + if (ret < 0 || (size_t) ret > buflen) + return -1; + return ret; +} + #endif /* CONFIG_TDLS */ @@ -3180,6 +3195,11 @@ static int wpa_supplicant_ctrl_iface_get_capability( if (os_strcmp(field, "freq") == 0) return ctrl_iface_get_capability_freq(wpa_s, buf, buflen); +#ifdef CONFIG_TDLS + if (os_strcmp(field, "tdls") == 0) + return ctrl_iface_get_capability_tdls(wpa_s, buf, buflen); +#endif + wpa_printf(MSG_DEBUG, "CTRL_IFACE: Unknown GET_CAPABILITY field '%s'", field);