From patchwork Thu May 16 13:28:17 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: 244312 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 E2CAA2C015E for ; Thu, 16 May 2013 23:32:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7B2409D2FA; Thu, 16 May 2013 09:31:24 -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 aHkMqDkHVHcH; Thu, 16 May 2013 09:31:24 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6CB849D24B; Thu, 16 May 2013 09:29:16 -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 B79529D1FD for ; Thu, 16 May 2013 09:29:14 -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 KKXjctVB151m for ; Thu, 16 May 2013 09:29:09 -0400 (EDT) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2EB8E9D204 for ; Thu, 16 May 2013 09:28:51 -0400 (EDT) Received: from [10.9.208.57] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 16 May 2013 06:25:08 -0700 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 16 May 2013 06:28:42 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Thu, 16 May 2013 06:28:42 -0700 Received: from arend-ubuntu-1 (unknown [10.176.68.33]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 4D011207CD; Thu, 16 May 2013 06:28:39 -0700 (PDT) Received: from arend by arend-ubuntu-1 with local (Exim 4.80) ( envelope-from ) id 1UcyEX-0008O0-Vn; Thu, 16 May 2013 15:28:38 +0200 From: "Arend van Spriel" To: "Jouni Malinen" Subject: [PATCH 02/20] driver: nl80211: Identify if nl80211 is capable of p2p device abstraction Date: Thu, 16 May 2013 15:28:17 +0200 Message-ID: <1368710915-32176-3-git-send-email-arend@broadcom.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368710915-32176-1-git-send-email-arend@broadcom.com> References: <1368710915-32176-1-git-send-email-arend@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 7D8A01BE31W20416624-02-01 Cc: hostap@lists.shmoo.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: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Nirav Shah Check the supported interfaces attribute to identify support for a dedicated p2p device interface type. If set update the driver capabilities flag to notify the supplicant. Signed-off-by: David Spinadel --- src/drivers/driver.h | 12 ++++++++++-- src/drivers/driver_nl80211.c | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 59102a4..56a1e60 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -830,7 +830,7 @@ struct wpa_driver_capa { * it cannot be used for P2P group operations or non-P2P purposes. */ #define WPA_DRIVER_FLAGS_P2P_DEDICATED_INTERFACE 0x00000400 -/* This interface is P2P capable (P2P Device, GO, or P2P Client */ +/* This interface is P2P capable (P2P GO, or P2P Client */ #define WPA_DRIVER_FLAGS_P2P_CAPABLE 0x00000800 /* Driver supports concurrent operations on multiple channels */ #define WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT 0x00001000 @@ -874,6 +874,8 @@ struct wpa_driver_capa { #define WPA_DRIVER_FLAGS_IBSS 0x08000000 /* Driver supports radar detection */ #define WPA_DRIVER_FLAGS_RADAR 0x10000000 +/* Driver supports a dedicated interface for p2p device */ +#define WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE 0x10000000 unsigned int flags; int max_scan_ssids; @@ -1001,7 +1003,13 @@ enum wpa_driver_if_type { * WPA_IF_P2P_GROUP - P2P Group interface (will become either * WPA_IF_P2P_GO or WPA_IF_P2P_CLIENT, but the role is not yet known) */ - WPA_IF_P2P_GROUP + WPA_IF_P2P_GROUP, + + /** + * WPA_IF_P2P_DEVICE - P2P device interface is used to indentify the + * abstracted p2p device function in the driver + */ + WPA_IF_P2P_DEVICE }; struct wpa_init_params { diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 6cc47cc..b304ddd 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2653,6 +2653,10 @@ static void wiphy_info_supported_iftypes(struct wiphy_info_data *info, case NL80211_IFTYPE_ADHOC: info->capa->flags |= WPA_DRIVER_FLAGS_IBSS; break; + case NL80211_IFTYPE_P2P_DEVICE: + info->capa->flags |= + WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE; + break; case NL80211_IFTYPE_P2P_GO: info->p2p_go_supported = 1; break; @@ -6280,6 +6284,8 @@ static const char * nl80211_iftype_str(enum nl80211_iftype mode) return "P2P_CLIENT"; case NL80211_IFTYPE_P2P_GO: return "P2P_GO"; + case NL80211_IFTYPE_P2P_DEVICE: + return "P2P_DEVICE"; default: return "unknown"; } @@ -8442,6 +8448,8 @@ static enum nl80211_iftype wpa_driver_nl80211_if_type( return NL80211_IFTYPE_AP; case WPA_IF_P2P_GO: return NL80211_IFTYPE_P2P_GO; + case WPA_IF_P2P_DEVICE: + return NL80211_IFTYPE_P2P_DEVICE; } return -1; }