Patchwork [RFC,2/3] driver: detect and store P2P Device driver capability

login
register
mail settings
Submitter Arend van Spriel
Date Jan. 12, 2013, 4:28 p.m.
Message ID <1358008099-11846-3-git-send-email-arend@broadcom.com>
Download mbox | patch
Permalink /patch/211511/
State Superseded
Headers show

Comments

Arend van Spriel - Jan. 12, 2013, 4:28 p.m.
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 <david.spinadel@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Greg Goldman <ggoldman@broadcom.com>
Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
 src/drivers/driver.h         |    4 ++++
 src/drivers/driver_nl80211.c |    3 +++
 2 files changed, 7 insertions(+)

Patch

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;