From patchwork Sat Jan 12 16:28:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 211511 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 9546B2C00B0 for ; Sun, 13 Jan 2013 03:30:13 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 5FCF79C15A; Sat, 12 Jan 2013 11:30:08 -0500 (EST) 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 uO+KlsHnZVv7; Sat, 12 Jan 2013 11:30:08 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9AC2C9C189; Sat, 12 Jan 2013 11:28:53 -0500 (EST) 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 C79409C17E for ; Sat, 12 Jan 2013 11:28:50 -0500 (EST) 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 by5n8-7rwb+X for ; Sat, 12 Jan 2013 11:28:47 -0500 (EST) Received: from mms3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 463E79C129 for ; Sat, 12 Jan 2013 11:28:37 -0500 (EST) Received: from [10.9.208.57] by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Sat, 12 Jan 2013 08:23:17 -0800 X-Server-Uuid: B86B6450-0931-4310-942E-F00ED04CA7AF Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.355.2; Sat, 12 Jan 2013 08:28:25 -0800 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.355.2; Sat, 12 Jan 2013 08:28:25 -0800 Received: from arend-vb-linux (unknown [10.177.252.171]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 32632207C4; Sat, 12 Jan 2013 08:28:25 -0800 (PST) Received: from arend by arend-vb-linux with local (Exim 4.80) ( envelope-from ) id 1Tu3wX-00035m-JD; Sat, 12 Jan 2013 17:28:25 +0100 From: "Arend van Spriel" To: "Jouni Malinen" Subject: [RFC 2/3] driver: detect and store P2P Device driver capability Date: Sat, 12 Jan 2013 17:28:18 +0100 Message-ID: <1358008099-11846-3-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358008099-11846-1-git-send-email-arend@broadcom.com> References: <1358008099-11846-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 7CEF527F3Q4678221-02-01 Cc: Greg Goldman , Johannes Berg , hostap-list 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: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Since Linux v3.7 the concept of a P2P_DEVICE object has been introduced in nl80211/cfg80211. This patch added a driver flag and detection of the capability in the nl80211 driver. Cc: David Spinadel Cc: Johannes Berg Cc: Greg Goldman Signed-hostap: Arend van Spriel --- src/drivers/driver.h | 4 ++++ src/drivers/driver_nl80211.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 4a9db01..948df27 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -844,6 +844,10 @@ struct wpa_driver_capa { * P2P group operations. */ #define WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P 0x00000008 +/* + * Driver supports creation of P2P Device for P2P management. + */ +#define WPA_DRIVER_FLAGS_P2P_DEVICE 0x00004000 unsigned int p2p_flags; int max_scan_ssids; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 5275185..ea984b2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2507,6 +2507,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) case NL80211_IFTYPE_AP: capa->flags |= WPA_DRIVER_FLAGS_AP; break; + case NL80211_IFTYPE_P2P_DEVICE: + capa->flags |= WPA_DRIVER_FLAGS_P2P_DEVICE; + break; case NL80211_IFTYPE_P2P_GO: p2p_go_supported = 1; break;