From patchwork Sat Jan 12 16:28:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,2/3] driver: detect and store P2P Device driver capability Date: Sat, 12 Jan 2013 06:28:18 -0000 From: Arend van Spriel X-Patchwork-Id: 211511 Message-Id: <1358008099-11846-3-git-send-email-arend@broadcom.com> To: "Jouni Malinen" Cc: Greg Goldman , Johannes Berg , hostap-list 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;